private void HelperMethod(LeaveApplication obj) { VMLoggedUser LoggedInUser = Session["LoggedInUser"] as VMLoggedUser; ViewBag.EmpNo = LoggedInUser.OEmpID; ViewBag.LineManagerID = new SelectList(DDService.GetUser().ToList().OrderBy(aa => aa.UserName).ToList(), "PUserID", "UserName", obj.LineManagerID); ViewBag.LeaveTypeID = new SelectList(DDService.GetLeaveType().ToList().Where(aa => aa.PLeaveTypeID != 2 && aa.PLeaveTypeID != 5 && aa.PLeaveTypeID != 6 && aa.PLeaveTypeID != 7 && aa.PLeaveTypeID != 8 && aa.PLeaveTypeID != 9 && aa.PLeaveTypeID != 10).ToList(), "PLeaveTypeID", "LeaveTypeName", obj.LeaveTypeID); ViewBag.FinancialYearID = new SelectList(DDService.GetFinancialYear().Where(aa => aa.FYStatus == true).ToList().OrderByDescending(aa => aa.PFinancialYearID).ToList(), "PFinancialYearID", "FYName"); }
private void EditHelper(VMEmployee obj) { VMLoggedUser vmf = Session["LoggedInUser"] as VMLoggedUser; ViewBag.LineManagerID = new SelectList(AppAssistant.GetLineManagers(DDService.GetUser().ToList()), "PUserID", "UserName", obj.LineManagerID); ViewBag.OTPolicyID = new SelectList(DDService.GetOTPolicy().ToList().OrderBy(aa => aa.OTPolicyName).ToList(), "POTPolicyID", "OTPolicyName", obj.OTPolicyID); ViewBag.ShiftID = new SelectList(DDService.GetShift(vmf).ToList().OrderBy(aa => aa.ShiftName).ToList(), "PShiftID", "ShiftName", obj.ShiftID); ViewBag.ALPolicyID = new SelectList(DDService.GetLeavePolicy().Where(aa => aa.LeaveTypeID == 1).ToList().OrderBy(aa => aa.LeavePolicyName).ToList(), "PLeavePolicyID", "LeavePolicyName", obj.ALPolicyID); ViewBag.SLPolicyID = new SelectList(DDService.GetLeavePolicy().Where(aa => aa.LeaveTypeID == 3).ToList().OrderBy(aa => aa.LeavePolicyName).ToList(), "PLeavePolicyID", "LeavePolicyName", obj.SLPolicyID); ViewBag.CLPolicyID = new SelectList(DDService.GetLeavePolicy().Where(aa => aa.LeaveTypeID == 2).ToList().OrderBy(aa => aa.LeavePolicyName).ToList(), "PLeavePolicyID", "LeavePolicyName", obj.CLPolicyID); ViewBag.CPLPolicyID = new SelectList(DDService.GetLeavePolicy().Where(aa => aa.LeaveTypeID == 4).ToList().OrderBy(aa => aa.LeavePolicyName).ToList(), "PLeavePolicyID", "LeavePolicyName", obj.CPLPolicyID); ViewBag.CrewID = new SelectList(DDService.GetCrew(vmf).ToList().OrderBy(aa => aa.CrewName).ToList(), "PCrewID", "CrewName", obj.CrewID); ViewBag.DesigationID = new SelectList(DDService.GetDesignation(vmf).ToList().OrderBy(aa => aa.DesignationName).ToList(), "PDesignationID", "DesignationName", obj.DesigationID); ViewBag.LocationID = new SelectList(DDService.GetLocation(vmf).ToList().OrderBy(aa => aa.LocationName).ToList(), "PLocationID", "LocationName", obj.LocationID); ViewBag.DepartmentID = new SelectList(DDService.GetOU(vmf).ToList().OrderBy(aa => aa.OUName).ToList(), "POUID", "OUName", obj.DepartmentID); ViewBag.EmploymentTypeID = new SelectList(DDService.GetEmploymentType(vmf).ToList().OrderBy(aa => aa.EmploymentTypeName).ToList(), "PEmploymentTypeID", "EmploymentTypeName", obj.EmploymentTypeID); ViewBag.ShiftID = new SelectList(DDService.GetShift(vmf).ToList().OrderBy(aa => aa.ShiftName).ToList(), "PShiftID", "ShiftName", obj.ShiftID); ViewBag.GradeID = new SelectList(DDService.GetGrade(vmf).ToList().OrderBy(aa => aa.GradeName).ToList(), "PGradeID", "GradeName", obj.GradeID); }
public ActionResult Create3(VMOvertimeApprovalSelection es, int?[] SelectedEmpIds) { VMLoggedUser LoggedInUser = Session["LoggedInUser"] as VMLoggedUser; //H HR Admin //U HR Normal VMOvertimeApproval vmOvertimeApproval = new VMOvertimeApproval(); vmOvertimeApproval = OvertimeAprrovalService.GetCreate3(es, SelectedEmpIds, vmOvertimeApproval); ViewBag.SubmittedToUserID = ViewBag.LineManagerID = new SelectList(AppAssistant.GetLineManagers(DDService.GetUser().Where(aa => aa.UserRoleID == "H").ToList()), "PUserID", "UserName", LoggedInUser.LineManagerID); ViewBag.OTStatusID = new SelectList(DDService.GetMonthOTStage().Where(aa => aa.PMonthDataOTStageID == "H" || aa.PMonthDataOTStageID == "A"), "PMonthDataOTStageID", "MonthDataOTStageName", "H"); return(View(vmOvertimeApproval)); }