Ejemplo n.º 1
0
        public VMEditMonthlyCreate GetCreate2(VMEditMonthlyCreate es, int?[] SelectedCompanyIds, int?[] SelectedOUCommonIds, int?[] SelectedOUIds,
                                              int?[] SelectedEmploymentTypeIds, int?[] SelectedLocationIds, int?[] SelectedGradeIds, int?[] SelectedJobTitleIds,
                                              int?[] SelectedDesignationIds, int?[] SelectedCrewIds, int?[] SelectedShiftIds, VMLoggedUser LoggedInUser)
        {
            VMEmpSelection vmEmpSelection = EmpSelectionService.GetStepTwo(SelectedCompanyIds,
                                                                           SelectedOUCommonIds, SelectedOUIds, SelectedEmploymentTypeIds,
                                                                           SelectedLocationIds, SelectedGradeIds, SelectedJobTitleIds, SelectedDesignationIds,
                                                                           SelectedCrewIds, SelectedShiftIds, es.EmpNo, LoggedInUser);

            es.Criteria     = vmEmpSelection.Criteria;
            es.CriteriaName = vmEmpSelection.CriteriaName;
            es.EmpNo        = vmEmpSelection.EmpNo;
            es.Employee     = vmEmpSelection.Employee.Where(aa => aa.Status == "Active").ToList();
            return(es);
        }
Ejemplo n.º 2
0
        public VMLeaveQuotaSelection GetCreate2(VMLeaveQuotaSelection es, int?[] SelectedCompanyIds, int?[] SelectedOUCommonIds, int?[] SelectedOUIds, int?[] SelectedEmploymentTypeIds,
                                                int?[] SelectedLocationIds, int?[] SelectedGradeIds, int?[] SelectedJobTitleIds, int?[] SelectedDesignationIds,
                                                int?[] SelectedCrewIds, int?[] SelectedShiftIds, VMLoggedUser LoggedInUser)
        {
            VMEmpSelection vmEmpSelection = EmpSelectionService.GetStepTwo(SelectedCompanyIds,
                                                                           SelectedOUCommonIds, SelectedOUIds, SelectedEmploymentTypeIds,
                                                                           SelectedLocationIds, SelectedGradeIds, SelectedJobTitleIds, SelectedDesignationIds,
                                                                           SelectedCrewIds, SelectedShiftIds, es.EmpNo, LoggedInUser);

            es.Criteria          = vmEmpSelection.Criteria;
            es.CriteriaName      = vmEmpSelection.CriteriaName;
            es.EmpNo             = vmEmpSelection.EmpNo;
            es.Employee          = vmEmpSelection.Employee;
            es.FinancialYearName = DDService.GetFinancialYear().Where(aa => aa.PFinancialYearID == es.FinancialYearID).First().FYName;
            return(es);
        }
        public VMOvertimeEncashableSelection GetCreate2(VMOvertimeEncashableSelection es, int?[] SelectedCompanyIds, int?[] SelectedOUCommonIds, int?[] SelectedOUIds, int?[] SelectedEmploymentTypeIds,
                                                        int?[] SelectedLocationIds, int?[] SelectedGradeIds, int?[] SelectedJobTitleIds, int?[] SelectedDesignationIds,
                                                        int?[] SelectedCrewIds, int?[] SelectedShiftIds, VMLoggedUser LoggedInUser)
        {
            VMEmpSelection vmEmpSelection = EmpSelectionService.GetStepTwo(SelectedCompanyIds,
                                                                           SelectedOUCommonIds, SelectedOUIds, SelectedEmploymentTypeIds,
                                                                           SelectedLocationIds, SelectedGradeIds, SelectedJobTitleIds, SelectedDesignationIds,
                                                                           SelectedCrewIds, SelectedShiftIds, es.EmpNo, LoggedInUser);

            es.Criteria          = vmEmpSelection.Criteria;
            es.CriteriaName      = vmEmpSelection.CriteriaName;
            es.EmpNo             = vmEmpSelection.EmpNo;
            es.Employee          = vmEmpSelection.Employee;
            es.PayrollPeriodName = DDService.GetPayrollPeriod().Where(aa => aa.PPayrollPeriodID == es.PayrollPeriodID).First().PRName;
            return(es);
        }
Ejemplo n.º 4
0
        public VMJobCardCreate GetCreate2(VMJobCardCreate es, int?[] SelectedCompanyIds, int?[] SelectedOUCommonIds, int?[] SelectedOUIds, int?[] SelectedEmploymentTypeIds,
                                          int?[] SelectedLocationIds, int?[] SelectedGradeIds, int?[] SelectedJobTitleIds, int?[] SelectedDesignationIds,
                                          int?[] SelectedCrewIds, int?[] SelectedShiftIds, VMLoggedUser LoggedInUser)
        {
            VMEmpSelection vmEmpSelection = EmpSelectionService.GetStepTwo(SelectedCompanyIds,
                                                                           SelectedOUCommonIds, SelectedOUIds, SelectedEmploymentTypeIds,
                                                                           SelectedLocationIds, SelectedGradeIds, SelectedJobTitleIds, SelectedDesignationIds,
                                                                           SelectedCrewIds, SelectedShiftIds, es.EmpNo, LoggedInUser);

            es.Criteria        = vmEmpSelection.Criteria;
            es.CriteriaName    = vmEmpSelection.CriteriaName;
            es.EmpNo           = vmEmpSelection.EmpNo;
            es.Employee        = vmEmpSelection.Employee;
            es.JobCardTypeName = DDService.GetJobCardType().Where(aa => aa.PJobCardTypeID == es.JobCardTypeID).First().JobCardName;
            return(es);
        }
Ejemplo n.º 5
0
        public VMOvertimeApprovalSelection GetCreate2(VMOvertimeApprovalSelection es, int?[] SelectedCompanyIds, int?[] SelectedOUCommonIds, int?[] SelectedOUIds, int?[] SelectedEmploymentTypeIds,
                                                      int?[] SelectedLocationIds, int?[] SelectedGradeIds, int?[] SelectedJobTitleIds, int?[] SelectedDesignationIds,
                                                      int?[] SelectedCrewIds, int?[] SelectedShiftIds, VMLoggedUser LoggedInUser)
        {
            List <MonthData> dbMontData     = new List <MonthData>();
            VMEmpSelection   vmEmpSelection = EmpSelectionService.GetStepTwo(SelectedCompanyIds,
                                                                             SelectedOUCommonIds, SelectedOUIds, SelectedEmploymentTypeIds,
                                                                             SelectedLocationIds, SelectedGradeIds, SelectedJobTitleIds, SelectedDesignationIds,
                                                                             SelectedCrewIds, SelectedShiftIds, es.EmpNo, LoggedInUser);

            es.Criteria     = vmEmpSelection.Criteria;
            es.CriteriaName = vmEmpSelection.CriteriaName;
            es.EmpNo        = vmEmpSelection.EmpNo;
            if (LoggedInUser.UserRoleID == "U")// HR Normal
            {
                Expression <Func <MonthData, bool> > SpecificEntries = c => c.PayrollPeriodID == es.PayrollPeriodID && (c.MonthDataStageID == "P" || c.MonthDataStageID == null) && (c.EncashbaleSingleOT > 0 || c.EncashbaleDoubleOT > 0 || c.CPLConversionOT > 0);
                dbMontData = MonthDataReporsitory.FindBy(SpecificEntries);
            }
            else if (LoggedInUser.UserRoleID == "H")// HR Admin
            {
                Expression <Func <MonthData, bool> > SpecificEntries = c => c.PayrollPeriodID == es.PayrollPeriodID && (c.MonthDataStageID == "H") && (c.EncashbaleSingleOT > 0 || c.EncashbaleDoubleOT > 0 || c.CPLConversionOT > 0);
                dbMontData = MonthDataReporsitory.FindBy(SpecificEntries);
            }
            else if (LoggedInUser.UserRoleID == "A")// Admin
            {
                Expression <Func <MonthData, bool> > SpecificEntries = c => c.PayrollPeriodID == es.PayrollPeriodID && (c.MonthDataStageID == "P") && (c.EncashbaleSingleOT > 0 || c.EncashbaleDoubleOT > 0 || c.CPLConversionOT > 0);
                dbMontData = MonthDataReporsitory.FindBy(SpecificEntries);
            }
            else
            {
                Expression <Func <MonthData, bool> > SpecificEntries = c => c.PayrollPeriodID == es.PayrollPeriodID && (c.EncashbaleSingleOT > 0 || c.EncashbaleDoubleOT > 0 || c.CPLConversionOT > 0);
                dbMontData = MonthDataReporsitory.FindBy(SpecificEntries);
            }
            List <VHR_EmployeeProfile> dbEmployees = new List <VHR_EmployeeProfile>();

            foreach (var item in vmEmpSelection.Employee)
            {
                if (dbMontData.Where(aa => aa.EmployeeID == item.PEmployeeID).Count() > 0)
                {
                    dbEmployees.Add(item);
                }
            }
            es.Employee          = dbEmployees;
            es.PayrollPeriodName = DDService.GetPayrollPeriod().Where(aa => aa.PPayrollPeriodID == es.PayrollPeriodID).First().PRName;
            return(es);
        }