예제 #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)
     {
         MessageBox.Show("MSS14" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
        public decimal MonthlySalarySettingsMonthlySalaryIdSearchUsingSalaryMonth(DateTime dtSalaryMonth)
        {
            decimal decResult = 0;

            try
            {
                decResult = SPMonthlySalary.MonthlySalarySettingsMonthlySalaryIdSearchUsingSalaryMonth(dtSalaryMonth);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Ms2:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(decResult);
        }
예제 #3
0
 public ActionResult DeleteMonthlySalarySettings(string month)
 {
     try
     {
         MonthlySalaryDetailsSP spMonthlySalaryDetails = new MonthlySalaryDetailsSP();
         MonthlySalarySP        spMonthlySalary        = new MonthlySalarySP();
         spMonthlySalary.MonthlySalaryDeleteAll(spMonthlySalary.MonthlySalarySettingsMonthlySalaryIdSearchUsingSalaryMonth(Convert.ToDateTime(month)));
     }
     catch (Exception ex)
     {
         return(Json(new { success = "false", ex = "MSS5" + ex.Message }));
     }
     return(Json(new { success = "true", ex = "no" }));
 }
예제 #4
0
        public ActionResult MonthlySalarySettings()
        {
            ViewData["month"] = DateTime.UtcNow.ToString("yyyy-MM");
            MonthlySalarySP spMonthlySalary = new MonthlySalarySP();

            if (spMonthlySalary.MonthlySalarySettingsMonthlySalaryIdSearchUsingSalaryMonth(DateTime.Now) > 0)
            {
                ViewData["btnText"] = "Update";
            }
            else
            {
                ViewData["btnText"] = "Save";
                ViewData["btnDel"]  = "disabled";
            }
            return(View());
        }
예제 #5
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)
     {
         MessageBox.Show("MSS5" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
예제 #6
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)
     {
         MessageBox.Show("MSS3" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
예제 #7
0
        public ActionResult GetMonthlySalarySettingsDetails(string month)
        {
            DataTable       dtMonthly         = GetMonthlySalarySettingsFromDB(month);
            DataTable       dtblSalaryPackage = new DataTable();
            SalaryPackageSP spSalaryPackage   = new SalaryPackageSP();

            dtblSalaryPackage = spSalaryPackage.SalaryPackageViewAllForMonthlySalarySettings();
            string jsonTableData = Utils.ConvertDataTabletoString(dtMonthly);
            string jsonComboData = Utils.ConvertDataTabletoString(dtblSalaryPackage);

            string          jsonBtnStatus   = string.Empty;
            MonthlySalarySP spMonthlySalary = new MonthlySalarySP();

            if (spMonthlySalary.MonthlySalarySettingsMonthlySalaryIdSearchUsingSalaryMonth(Convert.ToDateTime(month)) > 0)
            {
                jsonBtnStatus = "Update";
            }
            else
            {
                jsonBtnStatus = "Save";
            }

            return(Json(new { success = "true", tableData = jsonTableData, comboData = jsonComboData, btnStatus = jsonBtnStatus }));
        }