private void BtnInsertUpdate_Click(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(TxtCGST.Text.ToString())) { messageShow.singlemsgtext("CGST should not be empty"); TxtCGST.Focus(); return; } if (string.IsNullOrEmpty(TxtSGST.Text.ToString())) { messageShow.singlemsgtext("SGST should not be empty"); TxtSGST.Focus(); return; } if (string.IsNullOrEmpty(TxtIGST.Text.ToString())) { messageShow.singlemsgtext("IGST should not be empty"); TxtIGST.Focus(); return; } var tax_master = new TaxMaster { CGST = Convert.ToDecimal(TxtCGST.Text.ToString()), SGST = Convert.ToDecimal(TxtSGST.Text.ToString()), IGST = Convert.ToDecimal(TxtIGST.Text.ToString()), IsActive = ChkBoxIsActive.Checked ? 1 : 0, OperationType = SelectedTaxCode == 0 ? 1 : 2 }; int id = _instanceRepository.InsertUpdateDeleteTaxMaster(tax_master); if (id <= 0) { messageShow.singlemsgtext("Can't add one or more tax details"); } GetTaxLedgerList(); TxtCGST.Focus(); } catch (Exception _exception) { CmC.InsertException(_exception); messageShow.singlemsgtext(CmC.ExceptionErrorMessage); } }
private void Tax_Load(object sender, EventArgs e) { TxtCGST.Focus(); this.AcceptButton = BtnInsertUpdate; GetTaxLedgerList(); }