using DevExpress.XtraEditors; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Documents; using System.Windows.Forms; using DW5S.Entity; using DW5S.Repostory; using Serilog; using DW5S.Service; using DW5S.ViewModel; namespace DW5S.App.PopupControl { public partial class ShowCxCtrl : DevExpress.XtraEditors.XtraUserControl { PosResViewModel posItem; List list = new List(); public ShowCxCtrl() { InitializeComponent(); gridShowCx.UseDefault(list); } public ShowCxCtrl(PosResViewModel posItem) : this() { this.posItem = posItem; } private async void ShowCxCtrl_Load(object sender, EventArgs e) { var repsPos = IocContainer.UnitOfWork.OfLong(); var pos = await repsPos.GetByIdAsync(this.posItem.Id); var unitOfWork = IocContainer.UnitOfWork; var repsCx = unitOfWork.OfLong(); var items =await repsCx.FindAsync(p => p.Id == pos.CxResID); this.list.AddRange(items); gridView1.RefreshData(); } } }