async void setSerieBatchSource(ProductionOrderLineClient row) { var cache = api.GetCache(typeof(InvItem)); var invItemMaster = cache.Get(row._Item) as InvItem; if (invItemMaster == null) { return; } if (row.SerieBatches != null && row.SerieBatches.First()._Item == row._Item)/*Bind if Item changed*/ { return; } UnicontaBaseEntity master; if (row._Qty < 0) { master = invItemMaster; } else { // We only select opens var mast = new InvSerieBatchOpen(); mast.SetMaster(invItemMaster); master = mast; } var res = await api.Query <SerialToOrderLineClient>(master); if (res != null && res.Length > 0) { row.SerieBatches = res; row.NotifyPropertyChanged("SerieBatches"); } }
public async override Task InitQuery() { dgLinkedGrid.UpdateMaster(dcorderlineMaster as UnicontaBaseEntity); await dgLinkedGrid.Filter(null); if (dcorderlineMaster._Qty < 0) { // we select all, since it is a credit note. dgUnlinkedGrid.UpdateMaster(invItemMaster); } else { // We only select opens var mast = new InvSerieBatchOpen(); mast.SetMaster(invItemMaster); dgUnlinkedGrid.UpdateMaster(mast); } dgUnlinkedGrid.Filter(null); }
public override Task InitQuery() { dgLinkedGrid.UpdateMaster(dcorderlineMaster as UnicontaBaseEntity); var t1 = dgLinkedGrid.Filter(null); if (dcorderlineMaster._Qty < 0) { // we select all, since it is a credit note. dgUnlinkedGrid.UpdateMaster(invItemMaster); } else { // We only select opens var mast = new InvSerieBatchOpen(); mast.SetMaster(invItemMaster); if (invItemMaster._UseBatch && api.CompanyEntity.Warehouse) { dgUnlinkedGrid.masterRecords = new List <UnicontaBaseEntity>(2) { mast, new InvSerieBatchStorage() } } ; else { dgUnlinkedGrid.UpdateMaster(mast); } } var t2 = dgUnlinkedGrid.Filter(null); #if SILVERLIGHT return(t2); #else return(Task.WhenAll(t1, t2)); #endif }