Beispiel #1
0
        public void Post()
        {
            var saveRow = new TblSalesOrderRequestInvoiceHeader();

            saveRow.InjectFrom(TransactionHeader);
            WarehouseClient.PostTblSalesOrderRequestInvoiceHeaderAsync(saveRow, LoggedUserInfo.Iserial, LoggedUserInfo.DatabasEname);
        }
Beispiel #2
0
        public void GetRecieveDetailData()
        {
            var row = new TblSalesOrderRequestInvoiceHeader();

            row.InjectFrom(TransactionHeader);
            var headers = new ObservableCollection <int>(RecieveHeaderChoosedList.Select(x => x.Iserial));

            WarehouseClient.SearchSalesOrderRequestInvoiceAsync(row, LoggedUserInfo.Iserial, headers);
        }
Beispiel #3
0
        public void SaveOrder()
        {
            var valiationCollectionHeader = new List <ValidationResult>();
            var isvalidHeader             = Validator.TryValidateObject(TransactionHeader,
                                                                        new ValidationContext(TransactionHeader, null, null), valiationCollectionHeader, true);

            var details = new ObservableCollection <TblSalesOrderRequestInvoiceDetail>();
            var isvalid = false;

            foreach (var item in TransactionDetails)
            {
                var valiationCollection = new List <ValidationResult>(); isvalid = Validator.TryValidateObject(item, new ValidationContext(item, null, null), valiationCollection, true);
                if (isvalid == false)
                {
                    return;
                }

                details.Add((TblSalesOrderRequestInvoiceDetail) new TblSalesOrderRequestInvoiceDetail().InjectFrom(item));
            }
            var newrow = new  TblSalesOrderRequestInvoiceHeader();

            newrow.InjectFrom(TransactionHeader);

            newrow.TblSalesOrderRequestInvoiceDetails = details;
            if (isvalid && isvalidHeader)
            {
                if (Loading == false)
                {
                    Loading = true;
                    WarehouseClient.UpdateOrInsertTblSalesOrderRequestInvoiceHeaderAsync(newrow, 0, LoggedUserInfo.Iserial);
                }
            }
            else
            {
                MessageBox.Show("Data Is NOt Valid");
            }
        }