protected override Task <ErrorCodes> saveGrid()
 {
     if (!BlankFieldExist())
     {
         var t   = base.saveGrid();
         var lst = dgInvPriceListLineClientGrid.ItemsSource as IEnumerable <InvPriceListLineClient>;
         var rec = lst?.FirstOrDefault();
         if (rec != null)
         {
             InvPriceList plst = rec.MasterDebtorPriceList;
             if (plst == null)
             {
                 plst = rec.MasterCreditorPriceList;
             }
             if (plst != null)
             {
                 plst.ItemPrices = null; // clear cache
             }
         }
         return(t);
     }
     else
     {
         UnicontaMessageBox.Show(string.Format(Uniconta.ClientTools.Localization.lookup("CannotBeBlank"), Uniconta.ClientTools.Localization.lookup("ItemAndGroup")), Uniconta.ClientTools.Localization.lookup("Warning"), MessageBoxButton.OK);
         return(null);
     }
 }
예제 #2
0
 async void SaveAndOpenPriceList(InvPriceList selectedItem)
 {
     if (dgCreditorPriceListGrid.HasUnsavedData)
     {
         var tsk = saveGrid(selectedItem);
         if (tsk != null && (CopiedData || selectedItem.RowId == 0))
         {
             await tsk;
         }
     }
     if (selectedItem.RowId != 0)
     {
         AddDockItem(TabControls.CustomerPriceListLinePage, dgCreditorPriceListGrid.syncEntity);
     }
 }