Beispiel #1
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         CustomList <HRM_Emp> lstEmp      = (CustomList <HRM_Emp>)_EmpList;
         CustomList <HRM_Emp> CheckedList = lstEmp.FindAll(f => f.IsChecked);
         if (ddlApprovalList.SelectedValue == "1")
         {
             foreach (HRM_Emp emp in CheckedList)
             {
                 emp.EmpStatus = "Active";
                 emp.SetModified();
             }
             CheckedList.UpdateSpName = "spNewEmpApproval";
             if (CheckedList.IsNotNull())
             {
                 if (!CheckUserAuthentication(CheckedList))
                 {
                     return;
                 }
                 manager.SaveEmpApproval(ref CheckedList);
                 this.SuccessMessage = (StaticInfo.SavedSuccessfullyMsg);
             }
         }
         else if (ddlApprovalList.SelectedValue == "3")
         {
             CustomList <SeparationGrid> SeparationApprovedList = new CustomList <SeparationGrid>();
             foreach (HRM_Emp emp in CheckedList)
             {
                 SeparationGrid newSeparation = new SeparationGrid();
                 newSeparation.EmployeeKey  = emp.EmpKey;
                 newSeparation.ApprovedBy   = CurrentUserSession.EmpKey.ToString();
                 newSeparation.ApprovedDate = DateTime.Now;
                 newSeparation.SetModified();
                 SeparationApprovedList.Add(newSeparation);
             }
             SeparationApprovedList.UpdateSpName = "spEmpSeparationApproval";
             if (!CheckUserAuthentication(SeparationApprovedList))
             {
                 return;
             }
             manager.SaveEmpSeparationApproval(ref SeparationApprovedList);
             this.SuccessMessage = (StaticInfo.SavedSuccessfullyMsg);
         }
         else if (ddlApprovalList.SelectedValue == "2")
         {
             CustomList <Reactive> ReactiveList = new CustomList <Reactive>();
             foreach (HRM_Emp emp in CheckedList)
             {
                 Reactive newReactive = new Reactive();
                 newReactive.EmpKey = emp.EmpKey;
                 newReactive.DOJ    = emp.DOJ;
                 emp.DOJ            = emp.RejoiningDate;
                 emp.SetModified();
                 ReactiveList.Add(newReactive);
             }
             CheckedList.UpdateSpName  = "spSeparatedEmpRejoining";
             ReactiveList.InsertSpName = "spInsertReactive";
             if (CheckedList.IsNotNull())
             {
                 if (!CheckUserAuthentication(CheckedList, ReactiveList))
                 {
                     return;
                 }
                 manager.SaveEmpReActive(ref CheckedList, ref ReactiveList);
                 this.SuccessMessage = (StaticInfo.SavedSuccessfullyMsg);
             }
         }
     }
     catch (SqlException ex)
     {
         this.ErrorMessage = (ExceptionHelper.getSqlExceptionMessage(ex));
     }
     catch (Exception ex)
     {
         this.ErrorMessage = (ExceptionHelper.getExceptionMessage(ex));
     }
 }
Beispiel #2
0
 public CustomList <SeparationGrid> GetAllUnapprovedSeparation()
 {
     return(SeparationGrid.GetAllUnapprovedSeparation());
 }