/// <summary>
        /// Creates the discipline view.
        /// </summary>
        /// <param name="disciplineView">The discipline view.</param>
        /// <param name="companyCollection">The company collection.</param>
        /// <param name="queryStatus">The query status.</param>
        /// <param name="actionTaken">The action taken.</param>
        /// <param name="processingMessage">The processing message.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">
        /// companyCollection
        /// or
        /// queryStatus
        /// or
        /// actionTaken
        /// </exception>
        public IDisciplineView CreateDisciplineView(IDisciplineView disciplineView, IList <IEmployee> employeeCollection, IList <IQueryStatus> queryStatus, IList <IActionTaken> actionTaken, string processingMessage)
        {
            if (queryStatus == null)
            {
                throw new ArgumentNullException(nameof(queryStatus));
            }

            if (actionTaken == null)
            {
                throw new ArgumentNullException(nameof(actionTaken));
            }

            if (employeeCollection == null)
            {
                throw new ArgumentNullException(nameof(employeeCollection));
            }

            var employeeDDL = GetDropDownList.EmployeeListitems(employeeCollection, -1);


            var queryDDL = GetDropDownList.QueryStatusListItem(queryStatus, disciplineView.QueryStatusId);

            var actionTakenDDL = GetDropDownList.ActionTakenListItem(actionTaken, disciplineView.ActionTakenId);

            disciplineView.ProcessingMessage   = processingMessage;
            disciplineView.ActionTakenDropDown = actionTakenDDL;
            disciplineView.EmployeeDropDown    = employeeDDL;
            disciplineView.QueryDropDown       = queryDDL;

            return(disciplineView);
        }
Beispiel #2
0
        /// <summary>
        /// Creates the exit management view.
        /// </summary>
        /// <param name="employeeExitView">The employee exit view.</param>
        /// <param name="processingMessage">The processing message.</param>
        /// <returns></returns>
        public IEmployeeExitView CreateExitManagementView(IEmployeeExitView employeeExitView, IList <ICompanyDetail> companyCollection, IList <IEmployee> employeeCollection, IList <ITypeOfExit> typeOfExitCollection, string processingMessage)
        {
            if (employeeExitView == null)
            {
                throw new ArgumentNullException(nameof(employeeExitView));
            }

            if (companyCollection == null)
            {
                throw new ArgumentNullException(nameof(companyCollection));
            }

            if (employeeCollection == null)
            {
                throw new ArgumentNullException(nameof(employeeCollection));
            }

            if (typeOfExitCollection == null)
            {
                throw new ArgumentNullException(nameof(typeOfExitCollection));
            }

            var companyDDL    = GetDropDownList.CompanyListItems(companyCollection, employeeExitView.CompanyId);
            var employeeDDL   = GetDropDownList.EmployeeListitems(employeeCollection, employeeExitView.EmployeeId);
            var typeOfExitDDL = GetDropDownList.TypeOfExitListItems(typeOfExitCollection, employeeExitView.TypeOfExitId);

            employeeExitView.CompanyDropDown    = companyDDL;
            employeeExitView.EmployeeDropDown   = employeeDDL;
            employeeExitView.TypeOfExitDropDown = typeOfExitDDL;
            employeeExitView.ProcessingMessage  = processingMessage;

            return(employeeExitView);
        }
Beispiel #3
0
        /// <summary>
        /// Creates the employee training view.
        /// </summary>
        /// <param name="employeeTrainingInfo">The employee training information.</param>
        /// <param name="training">The training.</param>
        /// <param name="employee">The employee.</param>
        /// <param name="processingMessage">The processing message.</param>
        /// <param name="trainingReport">The training report.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">
        /// employeeTrainingInfo
        /// or
        /// employeeTrainingInfo
        /// or
        /// training
        /// </exception>
        public IEmployeeTrainingView CreateEmployeeTrainingView(IEmployeeTrainingView employeeTrainingInfo, IList <ITraining> training, IList <IEmployee> employee, string processingMessage, IList <ITrainingReport> trainingReport)
        {
            if (employeeTrainingInfo == null)
            {
                throw new ArgumentNullException(nameof(employeeTrainingInfo));
            }

            if (employeeTrainingInfo == null)
            {
                throw new ArgumentNullException(nameof(employeeTrainingInfo));
            }

            if (training == null)
            {
                throw new ArgumentNullException(nameof(training));
            }

            var TrainingDDL = GetDropDownList.TrainingListItems(training, employeeTrainingInfo.TrainingId);
            var EmployeeDDL = GetDropDownList.EmployeeListitems(employee, employeeTrainingInfo.EmployeeId);

            employeeTrainingInfo.EmployeeDropDownList = EmployeeDDL;
            employeeTrainingInfo.TrainingDropDownList = TrainingDDL;

            employeeTrainingInfo.ProcessingMessage = processingMessage;

            return(employeeTrainingInfo);
        }
Beispiel #4
0
        /// <summary>
        /// Creates the type of exit view.
        /// </summary>
        /// <param name="typeOfExitView">The type of exit view.</param>
        /// <param name="employeeCollection">The employee collection.</param>
        /// <param name="typeOfExitCollection">The type of exit collection.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">
        /// typeOfExitView
        /// or
        /// employeeCollection
        /// or
        /// typeOfExitCollection
        /// </exception>
        public ITypeOfExitView CreateTypeOfExitView(ITypeOfExitView typeOfExitView, IList <IEmployee> employeeCollection, IList <ITypeOfExit> typeOfExitCollection)
        {
            if (typeOfExitView == null)
            {
                throw new ArgumentNullException(nameof(typeOfExitView));
            }

            if (employeeCollection == null)
            {
                throw new ArgumentNullException(nameof(employeeCollection));
            }

            if (typeOfExitCollection == null)
            {
                throw new ArgumentNullException(nameof(typeOfExitCollection));
            }
            var employeeDDL    = GetDropDownList.EmployeeListitems(employeeCollection, typeOfExitView.EmployeeId);
            var typeOfExitDDL  = GetDropDownList.TypeOfExitListItems(typeOfExitCollection, typeOfExitView.TypeOfExitId);
            var interViewerDDL = GetDropDownList.EmployeeListitems(employeeCollection, typeOfExitView.EmployeeId);

            typeOfExitView.EmployeeDropDown    = employeeDDL;
            typeOfExitView.TypeOfExitDropDown  = typeOfExitDDL;
            typeOfExitView.InterViewerDropDown = interViewerDDL;

            return(typeOfExitView);
        }
        /// <summary>
        /// Creates the discipline view.
        /// </summary>
        /// <param name="companyCollection">The company collection.</param>
        /// <param name="queryStatus">The query status.</param>
        /// <param name="actionTaken">The action taken.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">
        /// companyCollection
        /// or
        /// queryStatus
        /// or
        /// actionTaken
        /// </exception>
        public IDisciplineView CreateDisciplineView(int employeeId, int companyId, IList <IEmployee> employeeCollection, IList <IQueryStatus> queryStatus, IList <IActionTaken> actionTaken)
        {
            if (queryStatus == null)
            {
                throw new ArgumentNullException(nameof(queryStatus));
            }

            if (actionTaken == null)
            {
                throw new ArgumentNullException(nameof(actionTaken));
            }

            if (employeeCollection == null)
            {
                throw new ArgumentNullException(nameof(employeeCollection));
            }

            var queryDDL = GetDropDownList.QueryStatusListItem(queryStatus, -1);

            var actionTakenDDL = GetDropDownList.ActionTakenListItem(actionTaken, -1);

            var employeeDDL = GetDropDownList.EmployeeListitems(employeeCollection, -1);
            var result      = new DisciplineView
            {
                QueryDropDown       = queryDDL,
                ActionTakenDropDown = actionTakenDDL,
                EmployeeDropDown    = employeeDDL,
                EmployeeId          = employeeId,
                CompanyId           = companyId,
                ProcessingMessage   = string.Empty
            };

            return(result);
        }
        /// <summary>
        /// Creates the edit discipling view.
        /// </summary>
        /// <param name="discipline">The discipline.</param>
        /// <param name="employeeCollection">The employee collection.</param>
        /// <param name="queryStatusCollecction">The query status collecction.</param>
        /// <param name="actionTaken">The action taken.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">
        /// queryStatusCollecction
        /// or
        /// actionTaken
        /// or
        /// employeeCollection
        /// </exception>
        public IDisciplineView CreateEditDisciplingView(IDiscipline discipline, IList <IEmployee> employeeCollection, IList <IQueryStatus> queryStatusCollecction, IList <IActionTaken> actionTaken)
        {
            if (queryStatusCollecction == null)
            {
                throw new ArgumentNullException(nameof(queryStatusCollecction));
            }

            if (actionTaken == null)
            {
                throw new ArgumentNullException(nameof(actionTaken));
            }

            if (employeeCollection == null)
            {
                throw new ArgumentNullException(nameof(employeeCollection));
            }


            var queryDDL = GetDropDownList.QueryStatusListItem(queryStatusCollecction, discipline.QueryStatusId);

            var actionTakenDDL = GetDropDownList.ActionTakenListItem(actionTaken, discipline.ActionTakenId);

            var employeeDDL = GetDropDownList.EmployeeListitems(employeeCollection, discipline.EmployeeId);

            var result = new DisciplineView
            {
                DisciplineId        = discipline.DisciplineId,
                EmployeeId          = discipline.EmployeeId,
                QueryStatusId       = discipline.QueryStatusId,
                QueryDate           = discipline.QueryDate,
                Offence             = discipline.Offence,
                QueryInitiator      = discipline.QueryInitiator,
                Investigator        = discipline.Investigator,
                Response            = discipline.Response,
                InvestigatorReport  = discipline.InvestigatorReport,
                RecommendedSanction = discipline.RecommendedSanction,
                DisciplineCommitteeRecommendation = discipline.DisciplineCommitteeRecommendation,
                ActionTakenId         = discipline.ActionTakenId,
                EvidenceDigitalFileId = discipline.EvidenceDigitalFileId,
                DateCreated           = discipline.DateCreated,
                CompanyId             = discipline.CompanyId,
                QueryDropDown         = queryDDL,
                ActionTakenDropDown   = actionTakenDDL,
                EmployeeDropDown      = employeeDDL,
                ProcessingMessage     = string.Empty
            };

            return(result);
        }
Beispiel #7
0
        /// <summary>
        /// Creates the employee training view.
        /// </summary>
        /// <param name="employeeTrainingModel">The employee training model.</param>
        /// <param name="companyInfo">The company information.</param>
        /// <param name="training">The training.</param>
        /// <param name="employee">The employee.</param>
        /// <param name="trainingReport">The training report.</param>
        /// <returns></returns>
        public IEmployeeTrainingView CreateEmployeeTrainingView(IList <IEmployeeTrainingModel> employeeTrainingModel, ICompanyDetail companyInfo, IList <ITraining> training, IList <IEmployee> employee, IList <ITrainingReport> trainingReport)
        {
            var TrainingDDL = GetDropDownList.TrainingListItems(training, -1);
            var EmployeeDDL = GetDropDownList.EmployeeListitems(employee, -1);


            var model = new EmployeeTrainingView
            {
                TrainingDropDownList = TrainingDDL,
                EmployeeDropDownList = EmployeeDDL,
                ProcessingMessage    = string.Empty,
                CompanyId            = companyInfo.CompanyId
            };

            return(model);
        }
        /// <summary>
        /// Creates the suspension update view.
        /// </summary>
        /// <param name="suspensionInfo">The suspension information.</param>
        /// <param name="employeeCollection">The employee collection.</param>
        /// <param name="queryCollection">The query collection.</param>
        /// <param name="processingMessage">The processing message.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">suspensionInfo</exception>
        public ISuspensionView CreateSuspensionUpdateView(ISuspensionView suspensionInfo, IList <IEmployee> employeeCollection, IList <IQuery> queryCollection, string processingMessage)
        {
            //Throw exception for null companyCollection
            if (suspensionInfo == null)
            {
                throw new ArgumentNullException(nameof(suspensionInfo));
            }


            var employeeDDL = GetDropDownList.EmployeeListitems(employeeCollection, -1);
            var queryDDL    = GetDropDownList.QueryListItems(queryCollection, -1);

            //Assigning processingMessage if any back to the view
            suspensionInfo.ProcessingMessage = processingMessage;

            return(suspensionInfo);
        }
Beispiel #9
0
        /// <summary>
        /// </summary>
        /// <param name="companyCollection"></param>
        /// <param name="typeOfExitCollection"></param>
        /// <param name="employeeCollection"></param>
        /// <param name="typeOfExitInfo"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        public ITypeOfExitView CreateTypeOfExitView(int companyId, IList <ITypeOfExit> typeOfExitCollection, IList <IEmployee> employeeCollection, ITypeOfExit typeOfExitInfo, string message)
        {
            //if (typeOfExitId == null) throw new ArgumentNullException(nameof(typeOfExitId));

            var employeeDDL   = GetDropDownList.EmployeeListitems(employeeCollection, -1);
            var typeOfExitDDL = GetDropDownList.TypeOfExitListItems(typeOfExitCollection, -1);

            var viewModel = new TypeOfExitView
            {
                EmployeeDropDown    = employeeDDL,
                InterViewerDropDown = employeeDDL,
                ProcessingMessage   = string.Empty,
                CompanyId           = companyId
            };

            return(viewModel);
        }
        /// <summary>
        /// Creates the updated employee view.
        /// </summary>
        /// <param name="onboardInfo">The onboard information.</param>
        /// <param name="maritalStatusCollection">The marital status collection.</param>
        /// <param name="companyCollection">The company collection.</param>
        /// <param name="employeeCollection">The employee collection.</param>
        /// <param name="religionCollection">The religion collection.</param>
        /// <param name="genderCollection">The gender collection.</param>
        /// <param name="departmentCollection">The department collection.</param>
        /// <param name="levelCollection">The level collection.</param>
        /// <param name="gradeCollection">The grade collection.</param>
        /// <param name="jobTitleCollection">The job title collection.</param>
        /// <param name="countryCollection">The country collection.</param>
        /// <param name="stateCollection">The state collection.</param>
        /// <param name="processMessage">The process message.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">onboardInfo</exception>
        public IEmployeeOnBoardView CreateUpdatedEmployeeView(IEmployeeOnBoardView onboardInfo, IList <IMaritalStatus> maritalStatusCollection,
                                                              IList <IEmployee> employeeCollection, IList <IReligion> religionCollection, IList <IYourGender> genderCollection, IList <IDepartment> departmentCollection, IList <ILevel> levelCollection,
                                                              IList <IGrade> gradeCollection, IList <IPayScale> payScaleCollection, IList <IJobTitle> jobTitleCollection, IList <ICountry> countryCollection, IList <IState> stateCollection,
                                                              IList <IEmploymentType> employmentTypeCollection, string processMessage)
        {
            if (onboardInfo == null)
            {
                throw new ArgumentNullException(nameof(onboardInfo));
            }

            var maritalStatusDDL  = GetDropDownList.MaritalStatusListItems(maritalStatusCollection, onboardInfo.MaritalStatusId);
            var religionDDL       = GetDropDownList.ReligionListItems(religionCollection, onboardInfo.ReligionId);
            var genderDDL         = GetDropDownList.GenderListItems(genderCollection, onboardInfo.GenderId);
            var departmentDDL     = GetDropDownList.DepartmentListItems(departmentCollection, onboardInfo.DepartmentId);
            var gradeDDL          = GetDropDownList.GradeListItems(gradeCollection, onboardInfo.GradeID);
            var jobTitleDDL       = GetDropDownList.JobTitlesListItems(jobTitleCollection, onboardInfo.JobTitleID);
            var levelDDL          = GetDropDownList.LevelListItems(levelCollection, onboardInfo.LevelID);
            var employeeDDL       = GetDropDownList.EmployeeListitems(employeeCollection, onboardInfo.SupervisorEmployeeId);
            var countryDDL        = GetDropDownList.CountryListItem(countryCollection, onboardInfo.NationalityId);
            var permanentStateDDL = GetDropDownList.StateListItem(stateCollection, onboardInfo.PermanentAddressStateId);
            var homeStateDDL      = GetDropDownList.StateListItem(stateCollection, onboardInfo.HomeAddressStateId);
            var employmentTypeDDL = GetDropDownList.EmploymentTypeListItem(employmentTypeCollection, onboardInfo.EmploymentTypeId);
            var payScaleDDL       = GetDropDownList.PayScaleListItem(payScaleCollection, onboardInfo.LevelGradeId);

            onboardInfo.ProcessingMessage = processMessage;
            //Updating drop down list
            onboardInfo.MaritalStatusDropDownList  = maritalStatusDDL;
            onboardInfo.ReligionDropDownList       = religionDDL;
            onboardInfo.GradeDropDownList          = gradeDDL;
            onboardInfo.DepartmentDropDownList     = departmentDDL;
            onboardInfo.JobTitleDropDownList       = jobTitleDDL;
            onboardInfo.LevelDropDownList          = levelDDL;
            onboardInfo.GenderDropDownList         = genderDDL;
            onboardInfo.CountryDropDownList        = countryDDL;
            onboardInfo.PermanentStateDropDownList = permanentStateDDL;
            onboardInfo.HomeStateDropDownList      = homeStateDDL;
            onboardInfo.EmployeeDropDownList       = employeeDDL;
            onboardInfo.EmploymentTypeDropDownList = employmentTypeDDL;
            onboardInfo.PayScaleDropDownList       = payScaleDDL;

            return(onboardInfo);
        }
        /// <summary>
        /// Creates the employee view.
        /// </summary>
        /// <param name="maritalStatusCollection">The marital status collection.</param>
        /// <param name="companyCollection">The company collection.</param>
        /// <param name="employeeCollection">The employee collection.</param>
        /// <param name="religionCollection">The religion collection.</param>
        /// <param name="genderCollection">The gender collection.</param>
        /// <param name="departmentCollection">The department collection.</param>
        /// <param name="levelCollection">The level collection.</param>
        /// <param name="gradeCollection">The grade collection.</param>
        /// <param name="jobTitleCollection">The job title collection.</param>
        /// <param name="countryCollection">The country collection.</param>
        /// <param name="stateCollection">The state collection.</param>
        /// <returns></returns>
        public IEmployeeOnBoardView CreateEmployeeView(IList <IMaritalStatus> maritalStatusCollection, int companyId, IList <IEmployee> employeeCollection,
                                                       IList <IReligion> religionCollection, IList <IYourGender> genderCollection, IList <IDepartment> departmentCollection, IList <ILevel> levelCollection,
                                                       IList <IGrade> gradeCollection, IList <IPayScale> payScaleCollection, IList <IJobTitle> jobTitleCollection, IList <ICountry> countryCollection, IList <IState> stateCollection, IList <IEmploymentType> employmentTypeCollection)
        {
            var maritalStatusDDL  = GetDropDownList.MaritalStatusListItems(maritalStatusCollection, -1);
            var religionDDL       = GetDropDownList.ReligionListItems(religionCollection, -1);
            var genderDDL         = GetDropDownList.GenderListItems(genderCollection, -1);
            var departmentDDL     = GetDropDownList.DepartmentListItems(departmentCollection, -1);
            var gradeDDL          = GetDropDownList.GradeListItems(gradeCollection, -1);
            var jobTitleDDL       = GetDropDownList.JobTitlesListItems(jobTitleCollection, -1);
            var levelDDL          = GetDropDownList.LevelListItems(levelCollection, -1);
            var countryDDL        = GetDropDownList.CountryListItem(countryCollection, 161);
            var stateDDL          = GetDropDownList.StateListItem(stateCollection, -1);
            var permanentStateDDL = GetDropDownList.StateListItem(stateCollection, -1);
            var homeStateDDL      = GetDropDownList.StateListItem(stateCollection, -1);
            var employeeDDL       = GetDropDownList.EmployeeListitems(employeeCollection, -1);
            var employmentTypeDDL = GetDropDownList.EmploymentTypeListItem(employmentTypeCollection, -1);
            var payScaleDDL       = GetDropDownList.PayScaleListItem(payScaleCollection, -1);

            var view = new EmployeeOnBoardView
            {
                MaritalStatusDropDownList  = maritalStatusDDL,
                ReligionDropDownList       = religionDDL,
                GenderDropDownList         = genderDDL,
                LevelDropDownList          = levelDDL,
                GradeDropDownList          = gradeDDL,
                DepartmentDropDownList     = departmentDDL,
                JobTitleDropDownList       = jobTitleDDL,
                ProcessingMessage          = string.Empty,
                CountryDropDownList        = countryDDL,
                HomeStateDropDownList      = homeStateDDL,
                PermanentStateDropDownList = permanentStateDDL,
                StateDropDownList          = stateDDL,
                EmployeeDropDownList       = employeeDDL,
                EmploymentTypeDropDownList = employmentTypeDDL,
                NationalityId        = 161,
                CompanyID            = companyId,
                PayScaleDropDownList = payScaleDDL
            };

            return(view);
        }
        /// <summary>
        /// Creates the training report.
        /// </summary>
        /// <param name="trainingReportViewModel">The training report view model.</param>
        /// <param name="companyCollection">The company collection.</param>
        /// <param name="employeeCollection">The employee collection.</param>
        /// <param name="trainingCollection">The training collection.</param>
        /// <param name="trainingRatingCollection">The training rating collection.</param>
        /// <param name="trainingCalendarCollection">The training calendar collection.</param>
        /// <param name="message">The message.</param>
        /// <returns></returns>
        public ITrainingReportViewModel CreateTrainingReport(ITrainingReportViewModel trainingReportViewModel, IList <ICompanyDetail> companyCollection, IList <IEmployee> employeeCollection, ITraining trainingInfo, IList <ITrainingEvaluationRating> trainingRatingCollection, IList <ITrainingCalendar> trainingCalendarCollection, string message)
        {
            //if (trainingId == null) throw new ArgumentNullException(nameof(trainingId));

            var companyDDL          = GetDropDownList.CompanyListItems(companyCollection, -1);
            var employeeDDL         = GetDropDownList.EmployeeListitems(employeeCollection, -1);
            var evaluationDDL       = GetDropDownList.TrainingEvaluationListItems(trainingRatingCollection, -1);
            var trainingcalendarDDL = GetDropDownList.TrainingCalendarListItems(trainingCalendarCollection, -1);


            trainingReportViewModel.CompanyDropDownlist  = companyDDL;
            trainingReportViewModel.EmployeeDropDownlist = employeeDDL;
            trainingReportViewModel.Training             = trainingInfo;
            trainingReportViewModel.TrainingEvaluationRatingDropDownlist = evaluationDDL;
            trainingReportViewModel.TrainingCalendarDropDownlist         = trainingcalendarDDL;

            trainingReportViewModel.ProcessingMessage = message;

            return(trainingReportViewModel);
        }
        /// <summary>
        /// Creates the training report.
        /// </summary>
        /// <param name="companyInfo">The company information.</param>
        /// <param name="employeeCollection">The employee collection.</param>
        /// <param name="trainingCollection">The training collection.</param>
        /// <param name="trainingRatingCollection">The training rating collection.</param>
        /// <param name="trainingCalendarCollection">The training calendar collection.</param>
        /// <returns></returns>
        public ITrainingReportViewModel CreateTrainingReport(ICompanyDetail companyInfo, IList <IEmployee> employeeCollection, int employeeId, ITraining trainingInfo, IList <ITrainingEvaluationRating> trainingRatingCollection, IList <ITrainingCalendar> trainingCalendarCollection)
        {
            var employeeDDL         = GetDropDownList.EmployeeListitems(employeeCollection, -1);
            var evaluationDDL       = GetDropDownList.TrainingEvaluationListItems(trainingRatingCollection, -1);
            var trainingcalendarDDL = GetDropDownList.TrainingCalendarListItems(trainingCalendarCollection, -1);



            var viewModel = new TrainingReportViewModel
            {
                EmployeeDropDownlist = employeeDDL,
                EmployeeID           = employeeId,
                Training             = trainingInfo,

                TrainingCalendarDropDownlist         = trainingcalendarDDL,
                TrainingEvaluationRatingDropDownlist = evaluationDDL,
                CompanyID = companyInfo.CompanyId,
            };

            return(viewModel);
        }
        /// <summary>
        /// </summary>
        /// <param name="selectedCompanyId"></param>
        /// <param name="queryCollection"></param>
        /// <param name="suspensionCollection"></param>
        /// <param name="employeeCollection"></param>
        /// <param name="companyCollection"></param>
        /// <param name="company"></param>
        /// <param name="processingMessage"></param>
        /// <returns></returns>
        public ISuspensionListView CreateSuspensionListView(int?selectedCompanyId, IList <IQuery> queryCollection, IList <ISuspension> suspensionCollection, IList <IEmployee> employeeCollection, ICompanyDetail company, string processingMessage)
        {
            //Create a Compny drop down for the filter at the list view
            var employeeDDL = GetDropDownList.EmployeeListitems(employeeCollection, -1);
            var queryDDL    = GetDropDownList.QueryListItems(queryCollection, -1);
            //Filter by companyId
            var filteredList = suspensionCollection
                               .Where(x => x.CompanyId.Equals(selectedCompanyId < 1 ? x.CompanyId : selectedCompanyId)).ToList();



            //Create a return view model of type suspensionListView
            var viewModel = new SuspensionListView
            {
                SuspensionCollection = filteredList,

                Company           = company,
                ProcessingMessage = processingMessage
            };

            return(viewModel);
        }
        /// <summary>
        /// Creates the suspension view.
        /// </summary>
        /// <param name="suspensionView">The suspension view.</param>
        /// <param name="companyId">The company identifier.</param>
        /// <param name="employeeCollection">The employee collection.</param>
        /// <param name="queryCollection">The query collection.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">companyId</exception>
        public ISuspensionView CreateSuspensionView(IList <ISuspension> suspensionView, int companyId, IList <IEmployee> employeeCollection, IList <IQuery> queryCollection)
        {
            //throw an exception if the companyCollection is null
            if (companyId <= 0)
            {
                throw new ArgumentNullException(nameof(companyId));
            }


            var employeeDDL = GetDropDownList.EmployeeListitems(employeeCollection, -1);
            var queryDDL    = GetDropDownList.QueryListItems(queryCollection, -1);

            var viewModel = new SuspensionView
            {
                //Assigning the drop down to the View model
                CompanyId        = companyId,
                EmployeeDropDown = employeeDDL,
                QueryDropDown    = queryDDL,
            };

            return(viewModel);
        }
        /// <summary>
        /// Creates the edit suspension view.
        /// </summary>
        /// <param name="suspensionInfo">The suspension information.</param>
        /// <param name="companyInfo">The company information.</param>
        /// <param name="employeeCollection">The employee collection.</param>
        /// <param name="queryCollection">The query collection.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">
        /// suspensionInfo
        /// or
        /// employeeCollection
        /// or
        /// queryCollection
        /// </exception>
        public ISuspensionView CreateEditSuspensionView(ISuspension suspensionInfo, int companyId, IList <IEmployee> employeeCollection, IList <IQuery> queryCollection)
        {
            if (suspensionInfo == null)
            {
                throw new ArgumentNullException(nameof(suspensionInfo));
            }

            if (employeeCollection == null)
            {
                throw new ArgumentNullException(nameof(employeeCollection));
            }

            if (queryCollection == null)
            {
                throw new ArgumentNullException(nameof(queryCollection));
            }

            var employeeDDL = GetDropDownList.EmployeeListitems(employeeCollection, -1);
            var queryDDL    = GetDropDownList.QueryListItems(queryCollection, -1);

            var returnSuspension = new SuspensionView
            {
                SuspensionId     = suspensionInfo.SuspensionId,
                EmployeeId       = suspensionInfo.EmployeeId,
                QueryId          = suspensionInfo.QueryId,
                StartDate        = suspensionInfo.StartDate,
                EndDate          = suspensionInfo.EndDate,
                Percentage       = suspensionInfo.EmployeeId,
                IsActive         = suspensionInfo.IsActive,
                DateCreated      = suspensionInfo.DateCreated,
                CompanyId        = companyId,
                EmployeeDropDown = employeeDDL,
                QueryDropDown    = queryDDL,
                QueryName        = suspensionInfo.QueryName
            };

            return(returnSuspension);
        }
Beispiel #17
0
        /// <summary>
        /// Creates the edit employee training view.
        /// </summary>
        /// <param name="employeeTrainingModel">The employee training model.</param>
        /// <param name="companyInfo">The company information.</param>
        /// <param name="employeeCollection">The employee collection.</param>
        /// <param name="trainingCollection">The training collection.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">
        /// employeeTrainingModel
        /// or
        /// companyCollecction
        /// or
        /// trainingCollection
        /// or
        /// companyCollecction
        /// </exception>
        public IEmployeeTrainingView CreateEditEmployeeTrainingView(IEmployeeTrainingModel employeeTrainingModel, ICompanyDetail companyInfo, IList <IEmployee> employeeCollection, IList <ITraining> trainingCollection)
        {
            if (employeeTrainingModel == null)
            {
                throw new ArgumentNullException(nameof(employeeTrainingModel));
            }


            if (trainingCollection == null)
            {
                throw new ArgumentNullException(nameof(trainingCollection));
            }

            if (employeeCollection == null)
            {
                throw new ArgumentNullException(nameof(employeeCollection));
            }

            var trainingDDL = GetDropDownList.TrainingListItems(trainingCollection, employeeTrainingModel.TrainingId);
            var employeeDDL = GetDropDownList.EmployeeListitems(employeeCollection, employeeTrainingModel.EmployeeId);

            var viewModel = new EmployeeTrainingView
            {
                EmployeeTrainingId   = employeeTrainingModel.EmployeeTrainingId,
                TrainingId           = employeeTrainingModel.TrainingId,
                SupervisorId         = employeeTrainingModel.SupervisorId,
                EmployeeId           = employeeTrainingModel.EmployeeId,
                DateApproved         = employeeTrainingModel.DateApproved,
                CompanyId            = employeeTrainingModel.CompanyId,
                DateCreated          = employeeTrainingModel.DateCreated,
                EmployeeDropDownList = employeeDDL,
                TrainingDropDownList = trainingDDL,
                ProcessingMessage    = string.Empty,
            };

            return(viewModel);
        }
        /// <summary>
        /// Creates the edit employee view.
        /// </summary>
        /// <param name="onboardInfo">The onboard information.</param>
        /// <param name="maritalStatusCollection">The marital status collection.</param>
        /// <param name="religionCollection">The religion collection.</param>
        /// <param name="genderCollection">The gender collection.</param>
        /// <param name="employeeCollection">The employee collection.</param>
        /// <param name="departmentCollection">The department collection.</param>
        /// <param name="levelCollection">The level collection.</param>
        /// <param name="gradeCollection">The grade collection.</param>
        /// <param name="jobTitleCollection">The job title collection.</param>
        /// <param name="profilePictureDetail">The profile picture detail.</param>
        /// <param name="employeeUser">The employee user.</param>
        /// <param name="countryCollection">The country collection.</param>
        /// <param name="stateCollection">The state collection.</param>
        /// <param name="employmentTypeCollection">The employment type collection.</param>
        /// <param name="processingMessage">The processing message.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">
        /// onboardInfo
        /// or
        /// maritalStatusCollection
        /// or
        /// religionCollection
        /// or
        /// genderCollection
        /// or
        /// departmentCollection
        /// or
        /// gradeCollection
        /// or
        /// levelCollection
        /// or
        /// jobTitleCollection
        /// or
        /// employmentTypeCollection
        /// </exception>
        public IEmployeeOnBoardView CreateEditEmployeeView(IEmployee onboardInfo, IList <IMaritalStatus> maritalStatusCollection,
                                                           IList <IReligion> religionCollection, IList <IYourGender> genderCollection, IList <IEmployee> employeeCollection,
                                                           IList <IDepartment> departmentCollection, IList <ILevel> levelCollection, IList <IGrade> gradeCollection,
                                                           IList <IJobTitle> jobTitleCollection, IDigitalFile profilePictureDetail, IUser employeeUser, IList <ICountry> countryCollection, IList <IState> stateCollection, IList <IEmploymentType> employmentTypeCollection, string processingMessage)
        {
            if (onboardInfo == null)
            {
                throw new ArgumentNullException(nameof(onboardInfo));
            }

            if (maritalStatusCollection == null)
            {
                throw new ArgumentNullException(nameof(maritalStatusCollection));
            }

            if (religionCollection == null)
            {
                throw new ArgumentNullException(nameof(religionCollection));
            }

            if (genderCollection == null)
            {
                throw new ArgumentNullException(nameof(genderCollection));
            }


            if (departmentCollection == null)
            {
                throw new ArgumentNullException(nameof(departmentCollection));
            }

            if (gradeCollection == null)
            {
                throw new ArgumentNullException(nameof(gradeCollection));
            }

            if (levelCollection == null)
            {
                throw new ArgumentNullException(nameof(levelCollection));
            }

            if (jobTitleCollection == null)
            {
                throw new ArgumentNullException(nameof(jobTitleCollection));
            }

            if (employmentTypeCollection == null)
            {
                throw new ArgumentNullException(nameof(employmentTypeCollection));
            }


            var maritalStatusDDL =
                GetDropDownList.MaritalStatusListItems(maritalStatusCollection, onboardInfo.MartialStatusId);
            var religionDDL       = GetDropDownList.ReligionListItems(religionCollection, onboardInfo.ReligionId);
            var genderDDL         = GetDropDownList.GenderListItems(genderCollection, onboardInfo.GenderId);
            var departmentDDL     = GetDropDownList.DepartmentListItems(departmentCollection, onboardInfo.DepartmentId);
            var gradeDDL          = GetDropDownList.GradeListItems(gradeCollection, onboardInfo.GradeId);
            var jobTitleDDL       = GetDropDownList.JobTitlesListItems(jobTitleCollection, onboardInfo.JobTitleId ?? -1);
            var levelDDL          = GetDropDownList.LevelListItems(levelCollection, onboardInfo.LevelId);
            var countryDDL        = GetDropDownList.CountryListItem(countryCollection, onboardInfo.NationalityId);
            var permanentStateDDL = GetDropDownList.StateListItem(stateCollection, onboardInfo.PermanentAddressStateId);
            var homeStateDDL      = GetDropDownList.StateListItem(stateCollection, onboardInfo.HomeAddressStateId);
            var employeeDDL       = GetDropDownList.EmployeeListitems(employeeCollection, onboardInfo.SupervisorEmployeeId);
            var employmentTypeDDL = GetDropDownList.EmploymentTypeListItem(employmentTypeCollection, onboardInfo.EmploymentTypeId);
            var returnView        = new EmployeeOnBoardView
            {
                LastName                   = onboardInfo.LastName,
                FirstName                  = onboardInfo.FirstName,
                MiddleName                 = onboardInfo.MiddleName,
                Email                      = onboardInfo.Email,
                CompanyID                  = onboardInfo.CompanyId,
                LevelID                    = onboardInfo.LevelId,
                GradeID                    = onboardInfo.GradeId,
                LevelGradeId               = onboardInfo.LevelGradeId,
                JobTitleID                 = onboardInfo.JobTitleId ?? -1,
                MobileNumber               = onboardInfo.MobileNumber,
                PermanentAddress           = onboardInfo.PermanentAddress,
                PermanentAddressCity       = onboardInfo.PermanentAddressCity,
                PermanentAddressState      = onboardInfo.PermanentAddressState,
                HomeAddress                = onboardInfo.HomeAddress,
                HomeAddressCity            = onboardInfo.HomeAddressCity,
                HomeAddressState           = onboardInfo.HomeAddressState,
                OtherEmail                 = onboardInfo.OtherEmail,
                Birthday                   = onboardInfo.Birthday,
                MaritalStatusId            = onboardInfo.MartialStatusId,
                GenderId                   = onboardInfo.GenderId,
                StaffNumber                = onboardInfo.StaffNumber,
                DateEmployed               = onboardInfo.DateEmployed,
                About                      = onboardInfo.About,
                DateExited                 = onboardInfo.DateExited,
                SkillSet                   = onboardInfo.SkillSet,
                SupervisorEmployeeId       = onboardInfo.SupervisorEmployeeId,
                SeatingLocation            = onboardInfo.SeatingLocation,
                DepartmentId               = onboardInfo.DepartmentId,
                MaidenName                 = onboardInfo.MaidenName,
                PhotoDigitalFileId         = onboardInfo.PhotoDigitalFileId,
                ReligionId                 = onboardInfo.ReligionId,
                Nationality                = onboardInfo.Nationality,
                DateCreated                = onboardInfo.DateCreated,
                EmployeeID                 = onboardInfo.EmployeeId,
                ProcessingMessage          = processingMessage ?? "",
                LevelDropDownList          = levelDDL,
                DepartmentDropDownList     = departmentDDL,
                GradeDropDownList          = gradeDDL,
                JobTitleDropDownList       = jobTitleDDL,
                GenderDropDownList         = genderDDL,
                MaritalStatusDropDownList  = maritalStatusDDL,
                ReligionDropDownList       = religionDDL,
                ProfilePictureDetail       = profilePictureDetail,
                EmployeeUser               = employeeUser,
                IsLocked                   = onboardInfo.IsLocked,
                CountryDropDownList        = countryDDL,
                HomeStateDropDownList      = homeStateDDL,
                PermanentStateDropDownList = permanentStateDDL,
                NationalityId              = onboardInfo.NationalityId,
                PermanentAddressStateId    = onboardInfo.PermanentAddressStateId,
                HomeAddressStateId         = onboardInfo.HomeAddressStateId,
                EmployeeDropDownList       = employeeDDL,
                EmploymentTypeId           = onboardInfo.EmploymentTypeId,
                EmploymentTypeDropDownList = employmentTypeDDL,
                GenderOther                = onboardInfo.GenderOother,
                ReligionOther              = onboardInfo.ReligionOther
            };

            return(returnView);
        }