ShowCxCtrl.cs 1.2 KB

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