private void btnSave_Click(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(txtCustFullName.Text.Trim())) { throw new Exception("Vollständiger Name Cannot be empty"); } if (!dxReqValidationProvider.Validate()) { return; } if (ObjECustomer == null) { ObjECustomer = new ECustomer(); } ParseCustomerDetails(); ObjBCustomer = new BCustomer(); ObjECustomer.Customer_CustomerID = ObjBCustomer.SaveCustomerDetails(ObjECustomer); BindCustomerData(); cmbCustomer.EditValue = ObjECustomer.Customer_CustomerID; cmbCustomer.Focus(); } catch (Exception ex) { Utility.ShowError(ex); } }
private void btnAddressAdd_Click(object sender, EventArgs e) { try { ObjECustomer = new ECustomer(); int Ivalue = 0; if (int.TryParse(Convert.ToString(cmbCustomer.EditValue), out Ivalue)) { ObjECustomer.AddressID = -1; ObjECustomer.Customer_CustomerID = Ivalue; frmCustomerMaster frm = new frmCustomerMaster("Address", ObjECustomer); frm.ShowDialog(); if (frm.DialogResult == DialogResult.OK) { BindAddressData(); Setfocus(gvAddress, "AddressID", ObjECustomer.AddressID); if (Utility._IsGermany == true) { frmOTTOPro.UpdateStatus("Vorgang abgeschlossen: Speichern der Kunden-Adressdaten"); } else { frmOTTOPro.UpdateStatus("Customer address saved successfully"); } } } } catch (Exception ex) { Utility.ShowError(ex); } }
/// <summary> /// Code to save customer address details /// </summary> /// <param name="XmlDoc"></param> /// <returns></returns> public int SaveCustomerAddressDetails(ECustomer ObjECustomer) { try { int AddressID = -1; XmlDocument Xdoc = new XmlDocument(); string XPath = "/Nouns/CustomerAddress"; Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "CustomerID", Convert.ToString(ObjECustomer.Customer_CustomerID)); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "AddressID", Convert.ToString(ObjECustomer.AddressID)); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "AddressShortName", ObjECustomer.AddressShortName); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "StreetNo", ObjECustomer.StreetNo); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "PostalCode", ObjECustomer.AddrPostalCode); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "City", ObjECustomer.AddrCity); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Country", ObjECustomer.AddrCountry); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "DefaultAddress", Convert.ToString(ObjECustomer.DefaultAddress)); AddressID = ObjDCustomer.SaveCustomerAddressDetails(Xdoc); if (AddressID < 0) { if (System.Threading.Thread.CurrentThread.CurrentCulture.Name.ToString() == "de-DE") { throw new Exception("Fehler beim Speichern der Kundenaddresse"); } else { throw new Exception("Failed to Save Customer Address"); } } return(AddressID); } catch (Exception ex) { throw; } }
private void gvAddress_DoubleClick(object sender, EventArgs e) { try { GridView view = (GridView)sender; Point pt = view.GridControl.PointToClient(Control.MousePosition); GridHitInfo info = view.CalcHitInfo(pt); if (info.InRow || info.InRowCell) { ObjECustomer = new ECustomer(); int Ivalue = 0; if (int.TryParse(Convert.ToString(cmbCustomer.EditValue), out Ivalue)) { ObjECustomer.Customer_CustomerID = Ivalue; GetAddressDetails(); frmCustomerMaster frm = new frmCustomerMaster("Address", ObjECustomer); frm.ObjEcustomer = ObjECustomer; frm.ShowDialog(); if (frm.DialogResult == DialogResult.OK) { BindAddressData(); Setfocus(gvAddress, "AddressID", ObjECustomer.AddressID); } } } } catch (Exception ex) { Utility.ShowError(ex); } }
private void btnSaveContact_Click(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(txtContactName.Text.Trim())) { _isValidate = false; throw new Exception("Bitte eingeben: Name"); } bool isvalidName = dxValidationProviderContactName.Validate(txtContactName); if (!isvalidName) { _isValidate = false; } else { _isValidate = true; } if (_isValidate == true) { if (ObjECustomer == null) { ObjECustomer = new ECustomer(); } ParseCustomerContactsDetails(); ObjBCustomer = new BCustomer(); ObjECustomer.ContactPersonID = ObjBCustomer.SaveCustomerContactDetails(ObjECustomer); _isValidate = true; } } catch (Exception ex) { Utility.ShowError(ex); } }
public void Take_Returns_CorrectQueryable(bool parameterize) { // Arrange & Act IQueryable actual = ExpressionHelpers.Take(_querable, 1, typeof(ECustomer), parameterize); // Assert ECustomer customer = Assert.Single(actual.Cast <ECustomer>()); Assert.Equal(1, customer.Id); }
public void Where_Returns_CorrectQueryable() { // Arrange Expression <Func <ECustomer, bool> > expression = x => x.Name == "Peter"; // Act IQueryable actual = ExpressionHelpers.Where(_querable, expression, typeof(ECustomer)); // Assert ECustomer customer = Assert.Single(actual.Cast <ECustomer>()); Assert.Equal(2, customer.Id); }
/// <summary> /// Code to get Customer List /// </summary> /// <returns></returns> public void GetCustomers(ECustomer ObjECustomer) { try { if (ObjECustomer != null) { ObjECustomer.dsCustomer = ObjDCustomer.GetCustomers(); } } catch (Exception ex) { throw; } }
/// <summary> /// Code to save customer details from customer master /// </summary> /// <param name="ObjECustomer"></param> /// <returns></returns> public int SaveCustomerDetails(ECustomer ObjECustomer) { try { int CustomerID = -1; XmlDocument Xdoc = new XmlDocument(); string XPath = "/Nouns/Customer"; Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "CustomerID", ObjECustomer.Customer_CustomerID.ToString()); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "CustomerFullName", ObjECustomer.CustomerFullName); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "CustomerShortName", ObjECustomer.CustomerShortName); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Street", ObjECustomer.CustStreet); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "PostalCode", ObjECustomer.CustPostalCode); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "City", ObjECustomer.CustCity); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Country", ObjECustomer.CustCountry); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "ILN", ObjECustomer.ILN); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Telephone", ObjECustomer.Telephone); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Fax", ObjECustomer.CustFax); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "EmailID", ObjECustomer.CustEmailID); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "TaxNumber", ObjECustomer.CustTaxNumber); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "BankName", ObjECustomer.BankName); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "BankPostalCode", ObjECustomer.BankPostalCode); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "BankAccountNumber", ObjECustomer.BankAccountNumber); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "DVNr", ObjECustomer.DVNr); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "TenderNumber", ObjECustomer.TenderNumber); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "DebitorNumber", ObjECustomer.DebitorNumber); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "CountryType", ObjECustomer.CountryType); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "CountryName", ObjECustomer.CountryName); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Commentary", ObjECustomer.Commentary); CustomerID = ObjDCustomer.SaveCustomerDetails(Xdoc); if (CustomerID < 0) { if (System.Threading.Thread.CurrentThread.CurrentCulture.Name.ToString() == "de-DE") { // throw new Exception("Fehler beim Speichern der LV Angaben"); } else { throw new Exception("Failed to Save Customer"); } } return(CustomerID); } catch (Exception ex) { throw; } }
/// <summary> /// Code to customer contact details /// </summary> /// <param name="ObjECustomer"></param> /// <returns></returns> public int SaveCustomerContactDetails(ECustomer ObjECustomer) { try { int ContactPersonID = -1; XmlDocument Xdoc = new XmlDocument(); string XPath = "/Nouns/CustomerContact"; Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "CustomerID", Convert.ToString(ObjECustomer.Customer_CustomerID)); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "ContactPersonID", Convert.ToString(ObjECustomer.ContactPersonID)); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Salutation", ObjECustomer.Salutation); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "ContatPersonName", ObjECustomer.ContatPersonName); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Designation", ObjECustomer.Designation); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "EmailID", ObjECustomer.ContEmailID); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Telephone", ObjECustomer.ContTelephone); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "FAX", ObjECustomer.ContFax); Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "DefaultContact", Convert.ToString(ObjECustomer.DefaultContact)); ContactPersonID = ObjDCustomer.SaveCustomerContactDetails(Xdoc); if (ContactPersonID < 0) { if (System.Threading.Thread.CurrentThread.CurrentCulture.Name.ToString() == "de-DE") { throw new Exception("Fehler beim Speichern der Kundeninformation"); } else { throw new Exception("Failed to Save Customer Contact"); } } return(ContactPersonID); } catch (Exception ex) { throw; } }
public frmCustomerMaster(string _Type, ECustomer ObjECustomer1) { InitializeComponent(); _CustomerType = _Type; ObjECustomer = ObjECustomer1; }