private void cmd_tax_Click(object sender, EventArgs e) { Bus_Cus.CreateFolder(dgv_Data.Rows[index].Cells[0].Value.ToString().Trim()); Bus_Letter.Kill_process(); DTO_TaxInvoice _tax = new DTO_TaxInvoice(); BUS_TaxInvoce _bus_tax = new BUS_TaxInvoce(); BUS_Payment _bus_pay = new BUS_Payment(); DataTable tb_payment = new DataTable(); _tax.Matter_ID = dgv_Data.Rows[index].Cells[0].Value.ToString().Trim(); DataTable tb_tax = new DataTable(); tb_tax = _bus_tax.Load(_tax.Matter_ID); if (tb_tax.Rows.Count > 0) { _tax.Tax_No = tb_tax.Rows[0][0].ToString().Trim(); } else { _tax.Tax_No = _bus_tax.CreateID(); } _bus_tax.Insert(_tax); BUS_TimeAndFees _bus_time = new BUS_TimeAndFees(); DataTable tb_Sum; tb_payment = _bus_pay.Load(_tax.Matter_ID); string d = dgv_Data.Rows[index].Cells[17].Value.ToString().Trim(); if (d == "True") { tb_Sum = _bus_time.LoadFixedPrice(_tax.Matter_ID); } else { tb_Sum = _bus_time.LoadHoursPrice(_tax.Matter_ID); } string Des = ""; for (int i = 0; i < tb_Sum.Rows.Count; i++) { Des += tb_Sum.Rows[i][2].ToString().Trim() + "\t" + tb_Sum.Rows[i][3].ToString().Trim() + "\n"; } Bus_Letter.Fill_TaxInvoice("" + dgv_Data.Rows[index].Cells[5].Value.ToString().Trim() + " " + dgv_Data.Rows[index].Cells[6].Value.ToString().Trim(), dgv_Data.Rows[index].Cells[0].Value.ToString().Trim(), _tax.Tax_No, txt_address1.Text.Trim() + " " + txt_address2.Text.Trim(), cbx_suburb.Text.Trim() + " " + txt_State.Text.Trim() + " " + txt_Post_Code.Text.Trim(), cbx_Salutation.Text.Trim(), Des, tb_payment.Rows[0][2].ToString().Trim(), tb_payment.Rows[0][3].ToString().Trim(), tb_payment.Rows[0][4].ToString().Trim(), tb_payment.Rows[0][5].ToString().Trim(), dgv_Data.Rows[index].Cells[6].Value.ToString().Trim(), fileLocation); }
private void Time_And_Fees_Load(object sender, EventArgs e) { if (GlobalVariable.CheckFixPrice) { tab_Hours.TabPages.Remove(tab_Fixedprice); } else { tab_Hours.TabPages.Remove(tab_ByHours); } _cus = GlobalVariable.Global_Customer; dgv_Fixed.DataSource = _Bus_Time.LoadFixedPrice(_cus.Matter_ID.Trim()); dgv_hours.DataSource = _Bus_Time.LoadHoursPrice(_cus.Matter_ID.Trim()); txt_Amount.ReadOnly = true; txt_desF.ReadOnly = true; dtp_F.Enabled = false; txt_Hours.ReadOnly = true; txt_desH.ReadOnly = true; dtp_H.Enabled = false; }