Exemplo n.º 1
0
 /// <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))
         {
             MonthlySalarySP spMonthlySalary = new MonthlySalarySP();
             if (spMonthlySalary.MonthlySalarySettingsMonthlySalaryIdSearchUsingSalaryMonth(Convert.ToDateTime(dtpSalaryMonth.Text)) > 0)
             {
                 Delete();
             }
             else
             {
                 btnDelete.Enabled = false;
             }
         }
         else
         {
             Messages.NoPrivillageMessage();
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "MSS14:" + ex.Message;
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Function for Delete
 /// </summary>
 public void DeleteFunction()
 {
     try
     {
         MonthlySalaryDetailsSP spMonthlySalaryDetails = new MonthlySalaryDetailsSP();
         MonthlySalarySP        spMonthlySalary        = new MonthlySalarySP();
         string strMonth = dtpSalaryMonth.Text;
         spMonthlySalary.MonthlySalaryDeleteAll(spMonthlySalary.MonthlySalarySettingsMonthlySalaryIdSearchUsingSalaryMonth(Convert.ToDateTime(dtpSalaryMonth.Text)));
         Messages.DeletedMessage();
         SalaryPackageComboFill();
         GridFill();
         UpdateDataGridViewRowColors();
         DeleteButtonEnableDisableChoose();
         dtpSalaryMonth.Focus();
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "MSS5:" + ex.Message;
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Function to Enable/Disable delete button
 /// </summary>
 public void DeleteButtonEnableDisableChoose()
 {
     try
     {
         MonthlySalarySP spMonthlySalary = new MonthlySalarySP();
         if (spMonthlySalary.MonthlySalarySettingsMonthlySalaryIdSearchUsingSalaryMonth(Convert.ToDateTime(dtpSalaryMonth.Text)) > 0)
         {
             btnDelete.Enabled = true;
             btnSave.Text      = "Update";
         }
         else
         {
             btnDelete.Enabled = false;
             btnSave.Text      = "Save";
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "MSS3:" + ex.Message;
     }
 }