public ActionResult OrganizationalUnit()
        {
            List <VMFilterAttribute> vm           = new List <VMFilterAttribute>();
            VMSelectedFilter         vmf          = Session["FiltersModel"] as VMSelectedFilter;
            VMLoggedUser             LoggedInUser = Session["LoggedInUser"] as VMLoggedUser;

            foreach (var item in DDService.GetOU(LoggedInUser).ToList())
            {
                VMFilterAttribute obj = new VMFilterAttribute();
                obj.FilterID       = item.POUID;
                obj.FilterName     = item.OUName;
                obj.IsSlected      = vmf.SelectedOrganizationalUnit.Where(aa => aa.FilterID == obj.FilterID).Count() > 0 ? true : false;
                obj.FieldThreeID   = item.OUCommonID;
                obj.FieldThreeName = item.OUCommonName;
                vm.Add(obj);
            }
            vm = CompanyVMHelper(vm, vmf);
            vm = LocationVMHelper(vm, vmf);
            List <VMFilterAttribute> tempVM = new List <VMFilterAttribute>();

            if (vmf.SelectedCommonOU.Count > 0)
            {
                foreach (var item in vmf.SelectedCommonOU)
                {
                    tempVM.AddRange(vm.Where(aa => aa.FieldThreeID == item.FilterID).ToList());
                }
                vm = tempVM.ToList();
            }
            else
            {
                tempVM = vm.ToList();
            }
            return(View(tempVM));
        }
        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);
        }
        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");
        }
Example #4
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);
        }
Example #5
0
        public VMAppUser GetEdit(int id)
        {
            //Instantiating the VMAppUser
            VMAppUser vmAppUser = new VMAppUser();
            // Get AppUserRole
            AppUser objAppUser = AppUserRepository.GetSingle(id);

            vmAppUser.PUserID          = objAppUser.PUserID;
            vmAppUser.UserName         = objAppUser.UserName;
            vmAppUser.Password         = objAppUser.Password;
            vmAppUser.UserStatus       = objAppUser.UserStatus;
            vmAppUser.LastActiveDate   = objAppUser.LastActiveDate;
            vmAppUser.EmpID            = objAppUser.EmpID;
            vmAppUser.UserAccessTypeID = objAppUser.UserAccessTypeID;
            vmAppUser.UserRoleID       = objAppUser.UserRoleID;
            vmAppUser.HasESSP          = objAppUser.HasESSP;
            vmAppUser.PAppUserTMSID    = 0;

            // Get AppUserTMS if there is any entry of the employee in the AppUser TMS table
            Expression <Func <AppUserTM, bool> > SpecificEntries = c => c.UserID == id;
            List <AppUserTM> listAppUserTMS = AppUserTMRepository.FindBy(SpecificEntries);

            //IF count is greater than zero it means if there is entry in AppUser TMS
            if (listAppUserTMS.Count > 0)
            {
                AppUserTM objAppUserTMS = listAppUserTMS.First();
                vmAppUser.PAppUserTMSID     = objAppUserTMS.PAppUserTMSID;
                vmAppUser.MLeave            = objAppUserTMS.MLeave;
                vmAppUser.LeavePolicy       = objAppUserTMS.LeavePolicy;
                vmAppUser.LeaveApplication  = objAppUserTMS.LeaveApplication;
                vmAppUser.LeaveQuota        = objAppUserTMS.LeaveQuota;
                vmAppUser.LeaveCF           = objAppUserTMS.LeaveCF;
                vmAppUser.MShift            = objAppUserTMS.MShift;
                vmAppUser.Shift             = objAppUserTMS.Shift;
                vmAppUser.ShiftChange       = objAppUserTMS.ShiftChange;
                vmAppUser.ShiftChangeEmp    = objAppUserTMS.ShiftChangeEmp;
                vmAppUser.Roster            = objAppUserTMS.Roster;
                vmAppUser.MOvertime         = objAppUserTMS.MOvertime;
                vmAppUser.OvertimePolicy    = objAppUserTMS.OvertimePolicy;
                vmAppUser.OvertimeAP        = objAppUserTMS.OvertimeAP;
                vmAppUser.OvertimeENCPL     = objAppUserTMS.OvertimeENCPL;
                vmAppUser.MAttendanceEditor = objAppUserTMS.MAttendanceEditor;
                vmAppUser.JobCard           = objAppUserTMS.JobCard;
                vmAppUser.JTCommon          = objAppUserTMS.JTCommon;
                vmAppUser.DailyAttEditor    = objAppUserTMS.DailyAttEditor;
                vmAppUser.MonthlyAttEditor  = objAppUserTMS.MonthlyAttEditor;
                vmAppUser.CompanyStructure  = objAppUserTMS.CompanyStructure;
                vmAppUser.MSettings         = objAppUserTMS.MSettings;
                vmAppUser.Reader            = objAppUserTMS.Reader;
                vmAppUser.Holiday           = objAppUserTMS.Holiday;
                vmAppUser.DownloadTime      = objAppUserTMS.DownloadTime;
                vmAppUser.ServiceLog        = objAppUserTMS.ServiceLog;
                vmAppUser.MUser             = objAppUserTMS.MUser;
                vmAppUser.AppUser           = objAppUserTMS.AppUser;
                vmAppUser.AppUserRole       = objAppUserTMS.AppUserRole;
                vmAppUser.Employee          = objAppUserTMS.Employee;
                //vmAppUser.OtherEmployee = objAppUserTMS.OtherEmployee;
                vmAppUser.Crew                   = objAppUserTMS.Crew;
                vmAppUser.OUCommon               = objAppUserTMS.OUCommon;
                vmAppUser.FinancialYear          = objAppUserTMS.FinancialYear;
                vmAppUser.PayrollPeriod          = objAppUserTMS.PayrollPeriod;
                vmAppUser.TMSAdd                 = objAppUserTMS.TMSAdd;
                vmAppUser.TMSEdit                = objAppUserTMS.TMSEdit;
                vmAppUser.TMSView                = objAppUserTMS.TMSView;
                vmAppUser.TMSDelete              = objAppUserTMS.TMSDelete;
                vmAppUser.MCompany               = objAppUserTMS.MCompany;
                vmAppUser.MAttendance            = objAppUserTMS.MAttendance;
                vmAppUser.Reports                = objAppUserTMS.Reports;
                vmAppUser.RMS                    = objAppUserTMS.RMS;
                vmAppUser.RMSPosition            = objAppUserTMS.RMSPosition;
                vmAppUser.RMSRequisition         = objAppUserTMS.RMSRequisition;
                vmAppUser.RMSCandidateManager    = objAppUserTMS.RMSCandidateManager;
                vmAppUser.RMSShortlisting        = objAppUserTMS.RMSShortlisting;
                vmAppUser.RMSTestManagement      = objAppUserTMS.RMSTestManagement;
                vmAppUser.RMSInterviewManagement = objAppUserTMS.RMSInterviewManagement;
                vmAppUser.RMSMeritList           = objAppUserTMS.RMSMeritList;
                vmAppUser.RMSHiringNote          = objAppUserTMS.RMSHiringNote;
                vmAppUser.RMSReporting           = objAppUserTMS.RMSReporting;
                vmAppUser.PMS                    = objAppUserTMS.PMS;
                vmAppUser.PMSBellCurve           = objAppUserTMS.PMSBellCurve;
                vmAppUser.PMSCompetency          = objAppUserTMS.PMSCompetency;
                vmAppUser.PMSSetting             = objAppUserTMS.PMSSetting;
                vmAppUser.PMSCycle               = objAppUserTMS.PMSCycle;
                vmAppUser.PROBATIONEVALUATION    = objAppUserTMS.PROBATIONEVALUATION;
            }
            // Get UserLocations
            Expression <Func <AppUserLocation, bool> > SpecificEntries2 = c => c.UserID == id;
            List <AppUserLocation>  listAppUserLocations = DDService.GetUserLocation(SpecificEntries2);
            List <VMUserLocation>   vmUserLocationList   = new List <VMUserLocation>();
            List <VMUserDepartment> vmUserDepartmentList = new List <VMUserDepartment>();

            foreach (var item in DDService.GetLocation().ToList())
            {
                VMUserLocation vmUserLocation = new VMUserLocation();
                vmUserLocation.PLocationID  = item.PLocationID;
                vmUserLocation.LocationName = item.LocationName;
                if (listAppUserLocations.Where(aa => aa.LocationID == item.PLocationID).Count() > 0)
                {
                    vmUserLocation.IsSelected = true;
                }
                else
                {
                    vmUserLocation.IsSelected = false;
                }
                vmUserLocationList.Add(vmUserLocation);
            }
            vmAppUser.UserLocations = vmUserLocationList;
            foreach (var item in DDService.GetOU().ToList())
            {
                VMUserDepartment vmUserDepartment = new VMUserDepartment();
                vmUserDepartment.POUID  = item.POUID;
                vmUserDepartment.OUName = item.OUName;
                if (listAppUserLocations.Where(aa => aa.LocationID == item.POUID).Count() > 0)
                {
                    vmUserDepartment.IsSelected = true;
                }
                else
                {
                    vmUserDepartment.IsSelected = false;
                }
                vmUserDepartmentList.Add(vmUserDepartment);
            }
            vmAppUser.UserDepartment = vmUserDepartmentList;
            return(vmAppUser);
        }