private void FillVoucherInfo(VouchersClient vc) { vc.Content = Convert.ToString(cmbContentTypes.SelectedItemValue); vc._Amount = NumberConvert.ToDouble(txtAmount.Text); vc._Qty = NumberConvert.ToDouble(txtQty.Text); if (!string.IsNullOrWhiteSpace(txtInvoice.Text)) { vc._Invoice = txtInvoice.Text; } vc._DocumentDate = txtDocumentDate.DateTime; vc.Currency = Convert.ToString(cmbCurrency.SelectedItem); vc.CreditorAccount = leAccount.Text; vc.PayDate = txtPaymentDate.DateTime; vc.CostAccount = leCostAccount.Text; vc.PayAccount = lePayAccount.Text; vc.Vat = leVat.Text; vc.VatOperation = leVatOpenration.Text; vc.TransType = leTransType.Text; vc._Approved = (bool)chkApproved.IsChecked; vc._Approver1 = leApprover1.Text; vc._Approver2 = leApprover2.Text; vc.PaymentId = txtPaymentId.Text; vc.Project = leProject.Text; vc.PrCategory = leProjectcat.Text; vc._PostingInstruction = txedPostingInstruction.Text; vc.PaymentMethod = Convert.ToString(cmbPaymentMethod.SelectedItemValue); #if !SILVERLIGHT vc.ViewInFolder = Convert.ToString(cmbViewInFolder.SelectedItem); vc._PurchaseNumber = GetPurchaseNumber(); #endif if (lbldim1.Visibility == Visibility.Visible) { vc.Dimension1 = cmbDim1.Text; } if (lbldim2.Visibility == Visibility.Visible) { vc.Dimension2 = cmbDim2.Text; } if (lbldim3.Visibility == Visibility.Visible) { vc.Dimension3 = cmbDim3.Text; } if (lbldim4.Visibility == Visibility.Visible) { vc.Dimension4 = cmbDim4.Text; } if (lbldim5.Visibility == Visibility.Visible) { vc.Dimension5 = cmbDim5.Text; } }
void LoadProductCatalog() { var openFileDailog = UtilDisplay.LoadOpenFileDialog; openFileDailog.Filter = "CSV Files |*.csv"; openFileDailog.Multiselect = false; bool?userClickedOK = openFileDailog.ShowDialog(); if (userClickedOK != true) { return; } var selectedFile = openFileDailog.FileName; var data = ProductCatalogHelper.FromCsv(selectedFile); if (data != null) { supplierLst = data.AsEnumerable().Select(x => x.Field <string>("Supplier")).Distinct(); itemGrpLst = data.AsEnumerable().Select(x => x.Field <string>("ItemGroup")).Distinct(); disGrpLst = data.AsEnumerable().Select(x => x.Field <string>("DiscountGroup")).Distinct(); foreach (DataRow row in data.Rows) { var prodItem = new ProdItemClient { _Item = row["Item"].ToString(), _EAN = row["EAN"].ToString(), _Name = row["Name"].ToString(), Unit = row["Unit"].ToString(), _SupplierItemId = row["SupplierItemId"].ToString(), //AlternativeItem = row["AlternativeItem"].ToString(), _SalesPrice = NumberConvert.ToDouble(row["SalesPrice"].ToString()), _Supplier = row["Supplier"].ToString(), _DiscountGroup = row["DiscountGroup"].ToString(), _ItemGroup = row["ItemGroup"].ToString(), _WebArg = row["WebArg"].ToString(), }; prodItem.SetMaster(master); dgProdItem.AddRow(prodItem, -1, false); } } }
private void OKButton_Click(object sender, RoutedEventArgs e) { quantity = isQtyVisible ? NumberConvert.ToDouble(qtyEditor.Text) : 0.0d; storage = AppEnums.ProductionRegister.IndexOf(Convert.ToString(storageType.EditValue)); this.DialogResult = true; }