Esempio n. 1
0
        public void GetMarkUpdata(bool header)
        {
            var client =
                new WarehouseService.WarehouseServiceClient();

            TransactionHeader.MarkUpTransList.Clear();
            client.GetTblSalesOrderRequestInvoiceMarkupTransProdAsync(0, TransactionHeader.Iserial, LoggedUserInfo.DatabasEname);
            client.GetTblSalesOrderRequestInvoiceMarkupTransProdCompleted += (s, sv) =>
            {
                foreach (var row in sv.Result)
                {
                    var newrow = new TblMarkupTranProdViewModel();
                    newrow.InjectFrom(row);
                    newrow.CurrencyPerRow = new CRUDManagerService.GenericTable();
                    newrow.CurrencyPerRow.InjectFrom(CurrencyList.FirstOrDefault(w => w.Iserial == newrow.TblCurrency));
                    newrow.TblMarkupProd1 = new CRUDManagerService.TblMarkupProd();
                    newrow.TblMarkupProd1.InjectFrom(MarkupList.FirstOrDefault(w => w.Iserial == row.TblMarkupProd));
                    newrow.JournalAccountTypePerRow = JournalAccountTypeList.FirstOrDefault(w => w.Iserial == newrow.TblJournalAccountType);
                    newrow.EntityPerRow             = new GlService.Entity().InjectFrom(sv.entityList.FirstOrDefault(w => w.Iserial == row.EntityAccount && w.TblJournalAccountType == row.TblJournalAccountType)) as GlService.Entity;
                    newrow.TblJournalAccountType    = row.TblJournalAccountType;
                    newrow.EntityAccount            = row.EntityAccount;

                    TransactionHeader.MarkUpTransList.Add(newrow);
                }

                Loading = false;

                if (TransactionHeader.MarkUpTransList.Count == 0)
                {
                    AddNewMarkUpRow(false, true);
                }
            };

            Loading = true;
        }