ShowCxCtrl.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using DevExpress.XtraEditors;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using System.Windows.Documents;
  11. using System.Windows.Forms;
  12. using DW5S.App.Model;
  13. using DW5S.Entity;
  14. using DW5S.Repostory;
  15. namespace DW5S.App.PopupControl
  16. {
  17. public partial class ShowCxCtrl : DevExpress.XtraEditors.XtraUserControl
  18. {
  19. PosRes posItem;
  20. List<CxRes> list = new List<CxRes>();
  21. public ShowCxCtrl()
  22. {
  23. InitializeComponent();
  24. gridShowCx.UseDefault(list);
  25. }
  26. public ShowCxCtrl(PosRes posItem)
  27. : this()
  28. {
  29. this.posItem = posItem;
  30. }
  31. private async void ShowCxCtrl_Load(object sender, EventArgs e)
  32. {
  33. using (RHDWPartContext db = RHDWPartContext.GetContext(posItem.SigTime))
  34. {
  35. if (db == null) return;
  36. var items = await db.CxRes.Where(p => p.ID == posItem.CxResID).ToListAsync();
  37. this.list.AddRange(items);
  38. }
  39. gridView1.RefreshData();
  40. }
  41. }
  42. }