private void btnSave_Click(object sender, EventArgs e) { customerInformation = new CustomerInformation() { Firstname = txtFname.Text, Middlename = txtMname.Text, Lastname = txtLname.Text, Mobile_number = txtMobile.Text, Email_address = txtEmail.Text, Address = txtAdd1.Text, }; if (Validation.isFilled(newClient_tab)) { dbController.customerInformationMapper.insertCustomerInformation(customerInformation); } else { MessageBanner banner = new MessageBanner("Please fill up all the fields and try again.", 2000); banner.BackColor = System.Drawing.Color.DarkRed; banner.ForeColor = System.Drawing.Color.White; banner.Opacity = 1; banner.Show(); } MyExtension.Validation.clearFields(newClient_tab); }
private void btnSave_Click(object sender, EventArgs e) { customerInformation = new CustomerInformation() { Firstname = txtFname.Text, Middlename = txtMname.Text, Lastname = txtLname.Text, Mobile_number = txtMobile.Text, Telephone_number = txtMobile.Text, Email_address = txtEmail.Text, Address = txtAdd1.Text + " " + txtAdd2.Text }; if (Validation.isFilled(customerInfo_panel)) { dbController.customerInformationMapper.insertCustomerInformation(customerInformation); } else { MessageBanner banner = new MessageBanner("Please fill up the required fields.", 2000); banner.ForeColor = System.Drawing.Color.Red; banner.Show(); } MyExtension.Validation.clearFields(newClient_tab); }
private void btnSaveUpdate_Click(object sender, EventArgs e) { MessageBanner banner; if (MyExtension.Validation.isFilled(updateContacts_panel)) { customerInformation = new CustomerInformation() { Mobile_number = mob }; if (dbController.updateContacts(customerInformation.Mobile_number, txtUpdateMobile.Text, txtUpdateOtherContacts.Text)) { banner = new MessageBanner("Successful updating contact details.", 2000); banner.Show(); } else { banner = new MessageBanner("Failed updating contact details.", 2000); banner.ForeColor = Color.Red; banner.Show(); } } MyExtension.Validation.clearFields(updateContacts_panel); }
public CustomerInformation getExistingClientContacts(DataTable dt, string token1, string token2) { string condition = String.Format(" lastname = '{0}' AND mobile_number = '{1}'", token1, token2); CustomerInformation customerInformation = new CustomerInformation(customerInformationMapper.getEntityWhere(condition)); return(customerInformation); }
private void fillUpdateContacts(string token1, string token2) { if (!string.IsNullOrWhiteSpace(token1) && !string.IsNullOrWhiteSpace(token2)) { existingClientTable = new DataTable(); CustomerInformation customerInformation = dbController.getExistingClientContacts(existingClientTable, token1, token2); txtUpdateMobile.Text = customerInformation.Mobile_number; } }
//private void OnCustomerAdded(EventArgs e) //{ // EventHandler onCustomerAdded = CustomerAdded; // if (onCustomerAdded != null) // onCustomerAdded(this, e); //} public void insertCustomerInformation(CustomerInformation customer) { if (create(insertValues(customer.Firstname, customer.Middlename, customer.Lastname, customer.Mobile_number, customer.Telephone_number, customer.Email_address, customer.Address))) { // OnCustomerAdded(new EventArgs()); MessageBanner banner = new MessageBanner("Successful adding information.", 2000); banner.Show(); } }
//private void OnCustomerAdded(EventArgs e) //{ // EventHandler onCustomerAdded = CustomerAdded; // if (onCustomerAdded != null) // onCustomerAdded(this, e); //} public void insertCustomerInformation(CustomerInformation customer) { if (create(insertValues(customer.Firstname, customer.Middlename, customer.Lastname, customer.Mobile_number, customer.Email_address, customer.Address))) { // OnCustomerAdded(new EventArgs()); MessageBanner banner = new MessageBanner("Successful adding information.", 2000); banner.Opacity = 1; banner.ForeColor = System.Drawing.Color.White; banner.Show(); } }
private void btnSaveUpdate_Click(object sender, EventArgs e) { MessageBanner banner; if (MyExtension.Validation.isFilled(updateContacts_panel)) { customerInformation = new CustomerInformation() { Mobile_number = mob }; if (dbController.updateContacts(customerInformation.Mobile_number, txtUpdateMobile.Text)) { banner = new MessageBanner("Successful updating contact details.", 2000); banner.Show(); } else { banner = new MessageBanner("Failed updating contact details.", 2000); banner.ForeColor = Color.Red; banner.Show(); } } MyExtension.Validation.clearFields(updateContacts_panel); }
public CustomerInformation getExistingClientContacts(DataTable dt, string token1, string token2) { string condition = String.Format(" lastname = '{0}' AND mobile_number = '{1}'", token1, token2); // customerInformationMapper.loadTable(dt, condition); CustomerInformation customerInformation = new CustomerInformation(customerInformationMapper.getEntityWhere(condition)); return customerInformation; }