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);
        }
Beispiel #2
0
        public VMEmpSelection GetStepOne(VMLoggedUser LoggedInUser)
        {
            VMEmpSelection obj = new VMEmpSelection();

            obj.Company            = DDService.GetCompany(LoggedInUser).OrderBy(aa => aa.CompanyName).ToList();
            obj.OUCommon           = DDService.GetOUCommon(LoggedInUser).OrderBy(aa => aa.OUCommonName).ToList();
            obj.OrganizationalUnit = DDService.GetOU(LoggedInUser).OrderBy(aa => aa.OUName).ToList();
            obj.EmploymentType     = DDService.GetEmploymentType(LoggedInUser).OrderBy(aa => aa.EmploymentTypeName).ToList();
            obj.Location           = DDService.GetLocation(LoggedInUser).OrderBy(aa => aa.LocationName).ToList();
            obj.Grade       = DDService.GetGrade(LoggedInUser).OrderBy(aa => aa.GradeName).ToList();
            obj.JobTitle    = DDService.GetJobTitle(LoggedInUser).OrderBy(aa => aa.JobTitleName).ToList();
            obj.Designation = DDService.GetDesignation(LoggedInUser).OrderBy(aa => aa.DesignationName).ToList();
            obj.Crew        = DDService.GetCrew(LoggedInUser).OrderBy(aa => aa.CrewName).ToList();
            obj.Shift       = DDService.GetShift(LoggedInUser).OrderBy(aa => aa.ShiftName).ToList();
            return(obj);
        }
        public ActionResult Grade()
        {
            List <VMFilterAttribute> vm           = new List <VMFilterAttribute>();
            VMSelectedFilter         vmf          = Session["FiltersModel"] as VMSelectedFilter;
            VMLoggedUser             LoggedInUser = Session["LoggedInUser"] as VMLoggedUser;

            foreach (var item in DDService.GetGrade(LoggedInUser).ToList())
            {
                VMFilterAttribute obj = new VMFilterAttribute();
                obj.FilterID   = item.PGradeID;
                obj.FilterName = item.GradeName;
                obj.IsSlected  = vmf.SelectedGrade.Where(aa => aa.FilterID == obj.FilterID).Count() > 0 ? true : false;
                vm.Add(obj);
            }
            vm = CompanyVMHelper(vm, vmf);
            return(View(vm));
        }