private void companySaveButton_Click(object sender, EventArgs e)
 {
     // Regex Name = new Regex(@"^[a-zA-Z]+(([',. -][a-zA-Z ])?[a-zA-Z]*)*$");
     if (!Ch.IsMatch(companyTextBox.Text.Trim()))
     {
         cMessageBox.Information("Something went wrong");
     }
     else
     {
         CompanyModel companyModel = new CompanyModel();
         companyModel.Name = companyTextBox.Text.Trim();
         SetupGateway companyGateway = new SetupGateway();
         bool         isExist        = companyGateway.IsExistCompany(companyModel);
         if (isExist)
         {
             cMessageBox.Warning("Company Name Already Exist");
         }
         else
         {
             int rowAffect = companyGateway.SaveCompany(companyModel);
             if (rowAffect > 0)
             {
                 cMessageBox.Success("Company Successfully Saved");
                 CompanySetup_Load(sender, e);
             }
             else
             {
                 cMessageBox.Failed("Failed to Save, Please Try Again");
                 CompanySetup_Load(sender, e);
             }
         }
     } // Expression check else function end here......
 }
 private void CompanyUpdateButton_Click(object sender, EventArgs e)
 {
     if (companyIdHidden.Text.Trim() != String.Empty && Ch.IsMatch(companyTextBox.Text.Trim()))
     {
         SetupGateway setupGateway = new SetupGateway();
         CompanyModel companyModel = new CompanyModel();
         companyModel.Name = companyTextBox.Text.Trim();
         companyModel.Id   = Convert.ToInt32(companyIdHidden.Text.Trim());
         bool isExist = setupGateway.IsExistCompany(companyModel);
         if (isExist)
         {
             cMessageBox.Warning("Company Name Already Exist");
         }
         else
         {
             int rowAffect = setupGateway.UpdateCompany(companyModel);
             if (rowAffect > 0)
             {
                 cMessageBox.Success("Company Name Updated Successfully");
                 CompanySetup_Load(sender, e);
             }
             else
             {
                 cMessageBox.Failed("Failed to Update");
                 CompanySetup_Load(sender, e);
             }
         }
     }
 }