/// <summary>
 /// On 'Delete' button click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         if (CheckUserPrivilege.PrivilegeCheck(PublicVariables._decCurrentUserId, this.Name, btnDelete.Text))
         {
             MonthlySalaryVoucherBll BllMonthlySalary = new MonthlySalaryVoucherBll();
             if (BllMonthlySalary.MonthlySalarySettingsMonthlySalaryIdSearchUsingSalaryMonth(Convert.ToDateTime(dtpSalaryMonth.Text)) > 0)
             {
                 Delete();
             }
             else
             {
                 btnDelete.Enabled = false;
             }
         }
         else
         {
             Messages.NoPrivillageMessage();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("MSS14" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// Function to Enable/Disable delete button
 /// </summary>
 public void DeleteButtonEnableDisableChoose()
 {
     try
     {
         MonthlySalaryVoucherBll BllMonthlySalary = new MonthlySalaryVoucherBll();
         if (BllMonthlySalary.MonthlySalarySettingsMonthlySalaryIdSearchUsingSalaryMonth(Convert.ToDateTime(dtpSalaryMonth.Text)) > 0)
         {
             btnDelete.Enabled = true;
             btnSave.Text = "Update";
         }
         else
         {
             btnDelete.Enabled = false;
             btnSave.Text = "Save";
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("MSS3" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// Function for Delete
 /// </summary>
 public void DeleteFunction()
 {
     try
     {
         MonthlySalaryVoucherBll BllMonthlySalaryDetails = new MonthlySalaryVoucherBll();
         MonthlySalaryVoucherBll BllMonthlySalary = new MonthlySalaryVoucherBll();
         string strMonth = dtpSalaryMonth.Text;
         BllMonthlySalary.MonthlySalaryDeleteAll(BllMonthlySalary.MonthlySalarySettingsMonthlySalaryIdSearchUsingSalaryMonth(Convert.ToDateTime(dtpSalaryMonth.Text)));
         Messages.DeletedMessage();
         SalaryPackageComboFill();
         GridFill();
         UpdateDataGridViewRowColors();
         DeleteButtonEnableDisableChoose();
         dtpSalaryMonth.Focus();
     }
     catch (Exception ex)
     {
         MessageBox.Show("MSS5" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }