// PAYMENT SAVE BUTTON // PAYMENT SAVE BUTTON private void buPaymentSave_Click_1(object sender, EventArgs e) { if (IsValidData()) { VBRAsiaCusModel c = FillModel(); List <VBRAsiaCusModel> lc = VBRAsia_CustomersDA.GetVBRAsiaCustomer(Config.VBR4000Connection, c.Customer_No); if (lc.Count > 0) { if (IsValidPaymentData()) { PaymentsModel m = PaymentFillModel(); int i = PaymentDetailsDA.UpdatePaymentDetails(Config.VBR4000Connection, m); i = PaymentDetailsDA.InsertPaymentDetails(Config.VBR4000Connection, m); if (i == 1) { MessageBox.Show("Saved"); lc = VBRAsia_CustomersDA.GetVBRAsiaCustomer(Config.VBR4000Connection, m.Customer_No); if (lc.Count > 0) { FillForm(lc[0]); } } } } } else { MessageBox.Show("Please First save the customer"); } }
//SUPPORT BUTTON---SUPPORT BUTTON---SUPPORT BUTTON---SUPPORT BUTTON---SUPPORT BUTTON private void btnSaveSupport_Click(object sender, EventArgs e) { if (IsValidData()) { VBRAsiaCusModel c = FillModel(); List <VBRAsiaCusModel> lc = VBRAsia_CustomersDA.GetVBRAsiaCustomer(Config.VBR4000Connection, c.Customer_No); if (lc.Count > 0) { if (IsSupportValidData()) { SupportDetailsModel m = SupportFillModel(); int i = SupportDetailsDA.UpdateSupportDetail(Config.VBR4000Connection, m); i = SupportDetailsDA.InsertSupportDetails(Config.VBR4000Connection, m); if (i == 1) { MessageBox.Show("Saved"); lc = VBRAsia_CustomersDA.GetVBRAsiaCustomer(Config.VBR4000Connection, m.CutomerNo); if (lc.Count > 0) { FillForm(lc[0]); } } } } else { MessageBox.Show("Please save the customer"); } } }
private void btnFind_Click(object sender, EventArgs e) { string customerNo = txtCustomer_No.Text.Trim(); if (!String.IsNullOrEmpty(customerNo)) { List <VBRAsiaCusModel> lm = VBRAsia_CustomersDA.GetVBRAsiaCustomer(Config.VBR4000Connection, customerNo); if (lm.Count > 0) { FillForm(lm[0]); } } }
private void txtCustomer_No_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { string customerNo = txtCustomer_No.Text.Trim(); if (!String.IsNullOrEmpty(customerNo)) { List <VBRAsiaCusModel> lm = VBRAsia_CustomersDA.GetVBRAsiaCustomer(Config.VBR4000Connection, customerNo); if (lm.Count > 0) { FillForm(lm[0]); } } } }
public void LoadDetails(string customerId) { txtCustomer_No.Text = customerId; List <VBRAsiaCusModel> lm = VBRAsia_CustomersDA.GetVBRAsiaCustomer(Config.VBR4000Connection, customerId); if (lm.Count > 0) { FillForm(lm[0]); } else { List <CustomerModel> lm1 = CustomerDA.GetCustomerById(Config.VBR4000Connection, customerId); if (lm1.Count > 0) { FillForm(lm1[0]); } } }
private void btnSave_Click(object sender, EventArgs e) { if (IsValidData()) { VBRAsiaCusModel m = FillModel(); int i = VBRAsia_CustomersDA.UpdateVBRAsiaCustomer(Config.VBR4000Connection, m); if (i == 0) { i = VBRAsia_CustomersDA.InsertVBRAsiaCustomer(Config.VBR4000Connection, m); if (i == 1) { MessageBox.Show("Saved"); } } else { MessageBox.Show("UPDATED"); } } }
// END PAYMNET TAB CONTROLS private void buHardwareSave_Click(object sender, EventArgs e) { if (IsValidHardwareData()) { VBRAsiaCusModel c = FillModel(); List <VBRAsiaCusModel> lc = VBRAsia_CustomersDA.GetVBRAsiaCustomer(Config.VBR4000Connection, c.Customer_No); if (lc.Count > 0) { int jobid; if (int.TryParse(laJobID.Text, out jobid)) { JobCardHardwareModel m = JobCardHardwareFillModel(); int i = JobCardHardwareDA.InsertHardwareDetails(Config.VBR4000Connection, m); if (i == 1) { MessageBox.Show("Saved"); } { lc = VBRAsia_CustomersDA.GetVBRAsiaCustomer(Config.VBR4000Connection, m.Customer_No); if (lc.Count > 0) { FillForm(lc[0]); } } } else { MessageBox.Show("NO JOBIB SELECT!!"); } } else { MessageBox.Show("Please First save the customer"); } } }
// PAYMNET INSTALLEMENT SAVE BUTTON private void buInstallmentSave_Click_1(object sender, EventArgs e) { if (IsValidPaymentData()) { VBRAsiaCusModel c = FillModel(); List <VBRAsiaCusModel> lc = VBRAsia_CustomersDA.GetVBRAsiaCustomer(Config.VBR4000Connection, c.Customer_No); if (lc.Count > 0) { int jobid; if (int.TryParse(laJobID.Text, out jobid)) { PaymentInstallmentModel m = PaymentInstallmentFillModel(); int i = PaymentInstallmentDA.InsertPaymentInstallment(Config.VBR4000Connection, m); if (i == 1) { MessageBox.Show("Saved"); } { lc = VBRAsia_CustomersDA.GetVBRAsiaCustomer(Config.VBR4000Connection, m.Customer_No); if (lc.Count > 0) { FillForm(lc[0]); } } } else { MessageBox.Show("NO PAYMENT HEADER"); } } else { MessageBox.Show("Please First save the customer"); } } }