Ejemplo n.º 1
0
        public List <VMUserDepartment> GetListofDepartments()
        {
            //Instantiating the list of the user department
            List <VMUserDepartment> vmUserDepartmentList = new List <VMUserDepartment>();

            //If there is more than one department assigned to an employee then foreach department function will repeat and get the department and name of department
            foreach (var item in DDService.GetOUCommon().ToList())
            {
                VMUserDepartment vmUserDepartment = new VMUserDepartment();
                vmUserDepartment.POUCommonID          = item.POUCommonID;
                vmUserDepartment.OUCommonName         = item.OUCommonName;
                vmUserDepartment.IsSelectedDepartment = false;
                vmUserDepartmentList.Add(vmUserDepartment);
            }
            return(vmUserDepartmentList);
        }
Ejemplo n.º 2
0
        public ActionResult CommonOU()
        {
            List <VMFilterAttribute> vm           = new List <VMFilterAttribute>();
            VMSelectedFilter         vmf          = Session["FiltersModel"] as VMSelectedFilter;
            VMLoggedUser             LoggedInUser = Session["LoggedInUser"] as VMLoggedUser;

            foreach (var item in DDService.GetOUCommon(LoggedInUser).ToList())
            {
                VMFilterAttribute obj = new VMFilterAttribute();
                obj.FilterID   = item.POUCommonID;
                obj.FilterName = item.OUCommonName;
                obj.IsSlected  = vmf.SelectedCommonOU.Where(aa => aa.FilterID == obj.FilterID).Count() > 0 ? true : false;
                vm.Add(obj);
            }
            return(View(vm));
        }
Ejemplo n.º 3
0
        private void CreateHelper()
        {
            VMLoggedUser LoggedInUser = Session["LoggedInUser"] as VMLoggedUser;

            ViewData["JobDateFrom"] = DateTime.Today.AddDays(-1).ToString("yyyy-MM-dd");
            ViewData["JobDateTo"]   = DateTime.Today.AddDays(-1).ToString("yyyy-MM-dd");
            ViewBag.JobCardType     = new SelectList(DDService.GetJobCardType().OrderBy(aa => aa.JobCardName).ToList(), "PJobCardTypeID", "JobCardName");
            //ViewBag.RosterType = new SelectList(DDService.ToList().OrderBy(aa => aa.ShiftName).ToList(), "PShiftID", "ShiftName");
            ViewBag.ShiftList      = new SelectList(DDService.GetShift(LoggedInUser).ToList().OrderBy(aa => aa.ShiftName).ToList(), "PShiftID", "ShiftName");
            ViewBag.LocationList   = new SelectList(DDService.GetLocation(LoggedInUser).ToList().OrderBy(aa => aa.LocationName).ToList(), "PLocationID", "LocationName");
            ViewBag.GroupList      = new SelectList(DDService.GetCrew(LoggedInUser).ToList().OrderBy(aa => aa.CrewName).ToList(), "PCrewID", "CrewName");
            ViewBag.SectionList    = new SelectList(DDService.GetOU(LoggedInUser).ToList().OrderBy(aa => aa.OUName).ToList(), "POUID", "OUName");
            ViewBag.DepartmentList = new SelectList(DDService.GetOUCommon(LoggedInUser).ToList().OrderBy(aa => aa.OUCommonName).ToList(), "POUCommonID", "OUCommonName");
        }
Ejemplo n.º 4
0
        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.EALPolicyID      = new SelectList(DDService.GetLeavePolicy().Where(aa => aa.LeaveTypeID == 11).ToList().OrderBy(aa => aa.LeavePolicyName).ToList(), "PLeavePolicyID", "LeavePolicyName", obj.CPLPolicyID);
            ViewBag.CMEPolicyID      = new SelectList(DDService.GetLeavePolicy().Where(aa => aa.LeaveTypeID == 12).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.JobTitleID       = new SelectList(DDService.GetJobTitle(vmf).ToList().OrderBy(aa => aa.JobTitleName).ToList(), "PJobTitleID", "JobTitleName", obj.JobTitleID);
            ViewBag.LocationID       = new SelectList(DDService.GetLocation(vmf).ToList().OrderBy(aa => aa.LocationName).ToList(), "PLocationID", "LocationName", obj.LocationID);
            ViewBag.DepartmentID     = new SelectList(DDService.GetOUCommon(vmf).ToList().OrderBy(aa => aa.OUCommonName).ToList(), "POUCommonID", "OUCommonName", obj.DepartmentID);
            ViewBag.SectionID        = new SelectList(DDService.GetOU(vmf).ToList().OrderBy(aa => aa.OUName).ToList(), "POUID", "OUName", obj.SectionID);
            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);
        }
Ejemplo n.º 5
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);
        }
        private void HelperMethod(OrganizationalUnit obj)
        {
            VMLoggedUser LoggedInUser = Session["LoggedInUser"] as VMLoggedUser;

            ViewBag.OUCommonID = new SelectList(DDService.GetOUCommon(LoggedInUser).ToList().OrderBy(aa => aa.OUCommonName).ToList(), "POUCommonID", "OUCommonName", obj.OUCommonID);
        }