ShowCxCtrl.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. using Serilog;
  16. using DW5S.Service;
  17. namespace DW5S.App.PopupControl
  18. {
  19. public partial class ShowCxCtrl : DevExpress.XtraEditors.XtraUserControl
  20. {
  21. PosRes posItem;
  22. List<CxRes> list = new List<CxRes>();
  23. public ShowCxCtrl()
  24. {
  25. InitializeComponent();
  26. gridShowCx.UseDefault(list);
  27. }
  28. public ShowCxCtrl(PosRes posItem)
  29. : this()
  30. {
  31. this.posItem = posItem;
  32. }
  33. private async void ShowCxCtrl_Load(object sender, EventArgs e)
  34. {
  35. var unitOfWork = IocContainer.UnitOfWork;
  36. var repsCx = unitOfWork.Of<CxRes>();
  37. var items =await repsCx.FindAsync(p => p.Id == posItem.CxResID);
  38. this.list.AddRange(items);
  39. gridView1.RefreshData();
  40. }
  41. }
  42. }