private void BtnInsertUpdate_Click(object sender, EventArgs e)
 {
     try
     {
         if (string.IsNullOrEmpty(TxtSName.Text.ToString()))
         {
             messageShow.singlemsgtext("Supplier name should not be empty");
             TxtSName.Focus();
             return;
         }
         if (string.IsNullOrEmpty(TxtSMobNum.Text.ToString()))
         {
             messageShow.singlemsgtext("Supplier mobile number should not be empty");
             TxtSMobNum.Focus();
             return;
         }
         if (string.IsNullOrEmpty(TxtSEmailId.Text.ToString()))
         {
             messageShow.singlemsgtext("Email id should not be empty");
             TxtSEmailId.Focus();
             return;
         }
         if (string.IsNullOrEmpty(TxtSGSTNum.Text.ToString()))
         {
             messageShow.singlemsgtext("GSTIN number should not be empty");
             TxtSGSTNum.Focus();
             return;
         }
         if (string.IsNullOrEmpty(TxtArSAddrOne.Text.ToString()))
         {
             messageShow.singlemsgtext("Address should not be empty");
             TxtArSAddrOne.Focus();
             return;
         }
         var supplier_master = new SupplierMaster
         {
             SupplierCode  = SelectedSupplierCode,
             SupplierName  = TxtSName.Text.ToString(),
             MobileNumber  = Convert.ToInt64(TxtSMobNum.Text.ToString()),
             EmailId       = TxtSEmailId.Text.ToString(),
             GSTINNumber   = TxtSGSTNum.Text.ToString(),
             Address1      = TxtArSAddrOne.Text.ToString(),
             Address2      = TxtArSAddrTwo.Text.ToString(),
             OperationType = SelectedSupplierCode == 0 ? 1 : 2
         };
         int id = _instanceRepository.InsertUpdateDeleteSupplierLegder(supplier_master);
         supplier_master.SupplierName = "";
         ResetControllers();
     }
     catch (Exception _exception)
     {
         CmC.InsertException(_exception);
         messageShow.singlemsgtext(CmC.ExceptionErrorMessage);
     }
 }
        private void SupplierLedger_Load(object sender, EventArgs e)
        {
            LblHeaderText.BackColor = Color.FromName(CmC.LblBackColor);
            LblHeaderText.Font      = new Font(CmC.LblFontStyle, CmC.LblFontSize); //, 17pt, style=Bold
            LblHeaderText.Font      = new Font(LblHeaderText.Font, FontStyle.Bold);
            LblHeaderText.ForeColor = Color.FromName(CmC.LblFontColor);

            TxtSName.Focus();
            this.AcceptButton = BtnInsertUpdate;
            GetSupplierLedgerList("", 0);
        }
 private void ResetControllers()
 {
     GetSupplierLedgerList("", 0);
     TxtSName.Focus();
     TxtSName.Text               = "";
     TxtSMobNum.Text             = "";
     TxtSEmailId.Text            = "";
     TxtSGSTNum.Text             = "";
     TxtArSAddrOne.Text          = "";
     TxtArSAddrTwo.Text          = "";
     TxtSearchItem._TextBox.Text = "";
 }