private void FillForm(VBRAsiaCusModel m) { #region CustomerForm txtCustomer_No.Text = m.Customer_No; txtNamee.Text = m.Name; txtStreet.Text = m.Street; txtPost_Code.Text = m.Post_Code; txtTelephone1.Text = m.Telephone1; txtTelephone2.Text = m.Telephone2; txtAddress_1.Text = m.Address_1; txtAddress_2.Text = m.Address_2; txtE_Mail.Text = m.E_Mail; txtNo_Of_Shops.Text = m.No_Of_Shops.ToString(); dtpSupport_End_Date.Value = m.Support_End_Date; dtpDue_Date.Value = m.Due_Date; dtpAdded_Date.Value = m.Added_Date; cbIsPaid.Checked = m.IsPaid; tbInvoiceTotal.Text = m.InvoiceTotal.ToString(); tbTotalPaid.Text = m.TotalPaid.ToString(); #endregion CustomerForm #region SupportDetail List <SupportDetailsModel> lsm = SupportDetailsDA.GetSupportDetail(Config.VBR4000Connection, m.Customer_No); BindSupportDetailsList(lsm); #endregion SupportDetail #region PaymentDetails List <PaymentsModel> lm = PaymentDetailsDA.GetPaymentDetails(Config.VBR4000Connection, m.Customer_No); NoOfPayments = lm.Count; paymentsList = lm; CurrentIndex = 0; FillPaymentHeaderCard(); #endregion PaymentDetails #region PaymentInstallment List <PaymentInstallmentModel> plm = PaymentInstallmentDA.GetPaymentInstallmentDetails(Config.VBR4000Connection, m.Customer_No); BindPaymentInstallmentList(plm); #endregion PaymentInstallment #region HarwdareDetails List <JobCardHardwareModel> hlm = JobCardHardwareDA.GetHardwareDetails(Config.VBR4000Connection, m.Customer_No); FillHardwareFormCard(); #endregion HardwareDetails }
// 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"); } } }