/// <summary> /// Creates the edit view by identifier. /// </summary> /// <param name="training">The training.</param> /// <param name="trainingReport">The training report.</param> /// <param name="certificationModel">The certification model.</param> /// <param name="trainingHistoryModel">The training history model.</param> /// <param name="processingMessage">The processing message.</param> /// <returns></returns> public ITrainingHistoryViewModel CreateEditViewById(IList <ITraining> training, IList <ITrainingReport> trainingReport , IList <ICertificationModel> certificationModel , ITrainingHistoryModel trainingHistoryModel , string processingMessage) { var certificateDDL = GetDropDownList.CertificateListItem(certificationModel, trainingHistoryModel.CertificationId); var TrainingDDL = GetDropDownList.TrainingListItems(training, trainingHistoryModel.TrainingNameId); var trainingReportDDL = GetDropDownList.TrainingReportListItem(trainingReport, trainingHistoryModel.TrainingVendorId); var viewModel = new TrainingHistoryViewModel { TrainingHistoryId = trainingHistoryModel.TrainingHistoryId, CertificateDropDownList = certificateDDL, TrainingDropDownList = TrainingDDL, TrainingVendorDropList = trainingReportDDL, processingmessage = processingMessage, TrainingId = trainingHistoryModel.TrainingNameId, TrainingVendorId = trainingHistoryModel.TrainingVendorId, Year = trainingHistoryModel.Year, UserId = trainingHistoryModel.UserId, CertificationId = trainingHistoryModel.CertificationId, IsActive = trainingHistoryModel.IsActive }; return(viewModel); }
/// <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 edit training calendar view. /// </summary> /// <param name="trainingCalendar">The training calendar.</param> /// <param name="companyCollection">The company collection.</param> /// <param name="trainingCollection">The training collection.</param> /// <param name="trainingStatusCollection">The training status collection.</param> /// <returns></returns> /// <exception cref="ArgumentNullException"> /// companyCollection /// or /// trainingCollection /// or /// trainingStatusCollection /// </exception> public ITraininingCalendarView CreateEditTrainingCalendarView(ITrainingCalendar trainingCalendar, IList <ICompanyDetail> companyCollection, IList <ITraining> trainingCollection, IList <ITrainingStatus> trainingStatusCollection) { if (companyCollection == null) { throw new ArgumentNullException(nameof(companyCollection)); } if (trainingCollection == null) { throw new ArgumentNullException(nameof(trainingCollection)); } if (trainingStatusCollection == null) { throw new ArgumentNullException(nameof(trainingStatusCollection)); } var companyDDL = GetDropDownList.CompanyListItems(companyCollection, trainingCalendar.CompanyId); var trainingDDL = GetDropDownList.TrainingListItems(trainingCollection, trainingCalendar.TrainingId); var trainingStatusDDL = GetDropDownList.TrainingStatusListItems(trainingStatusCollection, trainingCalendar.TrainingStatusId); var result = new TrainingCalendarView { CompanyDropDown = companyDDL, TrainingDropDown = trainingDDL, TrainingStatusDropDown = trainingStatusDDL, CompanyId = trainingCalendar.CompanyId, TrainingId = trainingCalendar.TrainingId, TrainingStatusId = trainingCalendar.TrainingStatusId, Location = trainingCalendar.Location, DeliveryEndDate = trainingCalendar.DeliveryEndDate, DeliveryStartDate = trainingCalendar.DeliveryStartDate, TrainingCalenderId = trainingCalendar.TrainingCalenderId, }; return(result); }
/// <summary> /// Creates the training calendar view. /// </summary> /// <param name="traininingCalendarView">The trainining calendar view.</param> /// <param name="companyCollection">The company collection.</param> /// <param name="trainingCollection">The training collection.</param> /// <param name="trainingStatusCollection">The training status collection.</param> /// <param name="message">The message.</param> /// <returns></returns> /// <exception cref="ArgumentNullException"> /// companyCollection /// or /// trainingCollection /// or /// trainingStatusCollection /// </exception> public ITraininingCalendarView CreateTrainingCalendarView(ITraininingCalendarView traininingCalendarView, IList <ICompanyDetail> companyCollection, IList <ITraining> trainingCollection, IList <ITrainingStatus> trainingStatusCollection, string message) { if (companyCollection == null) { throw new ArgumentNullException(nameof(companyCollection)); } if (trainingCollection == null) { throw new ArgumentNullException(nameof(trainingCollection)); } if (trainingStatusCollection == null) { throw new ArgumentNullException(nameof(trainingStatusCollection)); } var companyDDL = GetDropDownList.CompanyListItems(companyCollection, traininingCalendarView.CompanyId); var trainingDDL = GetDropDownList.TrainingListItems(trainingCollection, traininingCalendarView.TrainingId); var trainingStatusDDL = GetDropDownList.TrainingStatusListItems(trainingStatusCollection, traininingCalendarView.TrainingStatusId); traininingCalendarView.CompanyDropDown = companyDDL; traininingCalendarView.TrainingDropDown = trainingDDL; traininingCalendarView.TrainingStatusDropDown = trainingStatusDDL; traininingCalendarView.ProcessingMessage = message; return(traininingCalendarView); }
/// <summary> /// Creates the updated training report view. /// </summary> /// <param name="trainingInfo">The training information.</param> /// <returns></returns> /// <exception cref="ArgumentNullException">trainingInfo</exception> public ITrainingReportViewModel CreateUpdatedTrainingReportView(ITrainingReportViewModel trainingReportInfo, IList <ITrainingEvaluationRating> trainingEvaluationRatings, IList <ITrainingCalendar> trainingCalendars, string message) { if (trainingReportInfo == null) { throw new ArgumentNullException(nameof(trainingReportInfo)); } if (trainingEvaluationRatings == null) { throw new ArgumentNullException(nameof(trainingEvaluationRatings)); } if (trainingCalendars == null) { throw new ArgumentNullException(nameof(trainingCalendars)); } var traingCalendarDDL = GetDropDownList.TrainingCalendarListItems(trainingCalendars, trainingReportInfo.TrainingCalendarID); var traingRatingDDL = GetDropDownList.TrainingEvaluationListItems(trainingEvaluationRatings, trainingReportInfo.TrainerEvaluationRating); trainingReportInfo.TrainingEvaluationRatingDropDownlist = traingRatingDDL; trainingReportInfo.TrainingCalendarDropDownlist = traingCalendarDDL; trainingReportInfo.ProcessingMessage = message; return(trainingReportInfo); }
/// <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); }
/// <summary> /// Creates the updated vacancy view. /// </summary> /// <param name="vacancyInfo">The vacancy information.</param> /// <param name="processingMessage">The processing message.</param> /// <param name="departmentDropDown">The department drop down.</param> /// <param name="jobTitleDropDown">The job title drop down.</param> /// <param name="gradesDropDown">The grades drop down.</param> /// <returns></returns> /// <exception cref="ArgumentNullException">vacancyInfo</exception> /// <exception cref="System.ArgumentNullException">vacancyInfo</exception> public IVacancyView CreateUpdatedVacancyView(IVacancyView vacancyInfo, string processingMessage, IList <IDepartment> departmentDropDown, IList <IJobTitle> jobTitleDropDown, IList <IGrade> gradesDropDown) { if (vacancyInfo == null) { throw new ArgumentNullException(nameof(vacancyInfo)); } if (vacancyInfo == null) { throw new System.ArgumentNullException(nameof(vacancyInfo)); } var departmentDDL = GetDropDownList.DepartmentListItems(departmentDropDown, vacancyInfo.DepartmentId); //Get Grades var gradesDDl = GetDropDownList.GradeListItems(gradesDropDown, vacancyInfo.GradeId); //Get Job titles var jobTitleDDL = GetDropDownList.JobTitlesListItems(jobTitleDropDown, vacancyInfo.JobTitleId); vacancyInfo.GradesDropDown = gradesDDl; vacancyInfo.DepartmentDropDown = departmentDDL; vacancyInfo.JobTitleDropDown = jobTitleDDL; vacancyInfo.ProcessingMessage = processingMessage; return(vacancyInfo); }
/// <summary> /// Gets the trainee ListView. /// </summary> /// <param name="selectedCompanyId">The selected company identifier.</param> /// <param name="selectedTrainingId">The selected training identifier.</param> /// <param name="TraineeView">The trainee view.</param> /// <param name="companyInfo">The company information.</param> /// <param name="trainingCollection">The training collection.</param> /// <param name="processingMessage">The processing message.</param> /// <param name="trainigReport">The trainig report.</param> /// <returns></returns> /// <exception cref="ArgumentNullException"> /// TraineeView /// or /// trainingCollection /// </exception> public IEmployeeTrainingListView GetTraineeListView(int?selectedCompanyId, int?selectedTrainingId, IList <IEmployeeTrainingModel> TraineeView, ICompanyDetail companyInfo, IList <ITraining> trainingCollection, string processingMessage, IList <ITrainingReport> trainigReport) { if (TraineeView == null) { throw new ArgumentNullException(nameof(TraineeView)); } if (trainingCollection == null) { throw new ArgumentNullException(nameof(trainingCollection)); } var trainingDDL = GetDropDownList.TrainingListItems(trainingCollection, -1); var filteredList = TraineeView .Where(x => x.CompanyId.Equals(selectedCompanyId < 1 ? x.CompanyId : selectedCompanyId)).ToList(); filteredList = filteredList .Where(x => x.TrainingId.Equals(selectedTrainingId < 1 ? x.TrainingId : selectedTrainingId)).ToList(); var view = new EmployeeTrainingListView { employeeTrainingView = filteredList, Company = companyInfo, TrainingDropDownList = trainingDDL, ProcessingMessage = processingMessage ?? "" }; return(view); }
/// <summary> /// Creates the exit management view. /// </summary> /// <param name="employeeId">The employee identifier.</param> /// <param name="companyId">The company identifier.</param> /// <param name="typeOfExitCollection">The type of exit collection.</param> /// <returns></returns> /// <exception cref="ArgumentNullException"> /// employeeId /// or /// companyId /// or /// typeOfExitCollection /// </exception> public IEmployeeExitView CreateExitManagementView(IEmployee employee, ICompanyDetail company, IList <ITypeOfExit> typeOfExitCollection) { if (employee == null) { throw new ArgumentNullException(nameof(employee)); } if (company == null) { throw new ArgumentNullException(nameof(company)); } if (typeOfExitCollection == null) { throw new ArgumentNullException(nameof(typeOfExitCollection)); } var typeOfExitDDL = GetDropDownList.TypeOfExitListItems(typeOfExitCollection, -1); var result = new EmployeeExitView { TypeOfExitDropDown = typeOfExitDDL, ProcessingMessage = string.Empty, Employee = employee, Company = company, }; return(result); }
/// <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); }
/// <summary> /// Creates the edit user view. /// </summary> /// <param name="userDetail">The user detail.</param> /// <param name="companyCollection">The company collection.</param> /// <param name="appRoleCollection">The application role collection.</param> /// <param name="processingMessage">The processing message.</param> /// <returns></returns> /// <exception cref="ArgumentNullException"> /// userDetail /// or /// companyCollection /// or /// appRoleCollection /// </exception> public IUserViewModel CreateEditUserView(IUserViewModel userDetail, IList <ICompanyDetail> companyCollection, IList <IAppRole> appRoleCollection, string processingMessage) { if (userDetail == null) { throw new ArgumentNullException(nameof(userDetail)); } if (companyCollection == null) { throw new ArgumentNullException(nameof(companyCollection)); } if (appRoleCollection == null) { throw new ArgumentNullException(nameof(appRoleCollection)); } var companyDropDown = GetDropDownList.CompanyListItems(companyCollection, -1); var appRoleDropDown = GetDropDownList.AppRoleListItems(appRoleCollection, -1); userDetail.CompanyDropDown = companyDropDown; userDetail.RoleDropDown = appRoleDropDown; userDetail.ProcessingMessage = processingMessage; return(userDetail); }
/// <summary> /// Creates the department ListView. /// </summary> /// <param name="selectedCompanyId">The selected company identifier.</param> /// <param name="selectedDepartmentId">The selected department identifier.</param> /// <param name="selectedDepartment">The selected department.</param> /// <param name="companyList">The company list.</param> /// <param name="departmentsList">The departments list.</param> /// <param name="message">The message.</param> /// <returns></returns> public IDepartmentListView CreateDepartmentListView(int selectedCompanyId, int selectedDepartmentId, string selectedDepartment, IList <ICompanyDetail> companyList, IList <IDepartment> departmentsList, string message) { // get parentcompany drop down list var companytDDL = GetDropDownList.CompanyListItems(companyList, selectedCompanyId); // filter with companyId var filteredList = departmentsList .Where(x => x.CompanyId.Equals(selectedCompanyId < 1 ? x.CompanyId : selectedCompanyId)).ToList(); //filter with departmentId filteredList = filteredList.Where(x => x.DepartmentId.Equals(selectedDepartmentId < 1 ? x.DepartmentId : selectedDepartmentId)).ToList(); //filter with departmentname filteredList = filteredList.Where(x => x.DepartmentName.Contains(string.IsNullOrEmpty(selectedDepartment) ? x.DepartmentName : selectedDepartment)).ToList(); var viewModel = new DepartmentListView { CompanyDropDownList = companytDDL, DepartmentCollection = filteredList.ToList(), ProcessingMessage = message, SelectedCompanyId = selectedCompanyId, SelectedDepartment = selectedDepartment, SelectedDepartmentId = selectedDepartmentId }; return(viewModel); }
/// <summary> /// Creates the user role view. /// </summary> /// <param name="userDetail">The user detail.</param> /// <param name="userAppCollection">The user application collection.</param> /// <param name="appRoleCollection">The application role collection.</param> /// <returns></returns> /// <exception cref="ArgumentNullException"> /// userDetail /// or /// userAppCollection /// or /// appRoleCollection /// </exception> public IUsersView CreateUserRoleViewList(IUserDetail userDetail, IList <IUserAppRole> userAppCollection, IList <IAppRole> appRoleCollection) { if (userDetail == null) { throw new ArgumentNullException(nameof(userDetail)); } if (userAppCollection == null) { throw new ArgumentNullException(nameof(userAppCollection)); } if (appRoleCollection == null) { throw new ArgumentNullException(nameof(appRoleCollection)); } var appRoleDropDown = GetDropDownList.AppRoleListItems(appRoleCollection, -1); var returnView = new UsersView { UserId = userDetail.UserId, Username = userDetail.Username, IsUserVerified = userDetail.IsUserVerified, FirstName = userDetail.FirstName, LastName = userDetail.LastName, Email = userDetail.Email, AppRoleCollection = userAppCollection, RoleDropDown = appRoleDropDown }; return(returnView); }
/// <summary> /// Creates the company registration view. /// </summary> /// <param name="companyCollection">The company collection.</param> /// <param name="industryCollection"></param> /// <returns></returns> /// <exception cref="ArgumentNullException"> /// companyCollection /// or /// industryCollection /// </exception> public ICompanyRegistrationView CreateCompanyRegistrationView(IList <ICompanyDetail> companyCollection, IList <IIndustry> industryCollection, IList <ICountry> countryCollection) { if (companyCollection == null) { throw new ArgumentNullException(nameof(companyCollection)); } if (industryCollection == null) { throw new ArgumentNullException(nameof(industryCollection)); } if (countryCollection == null) { throw new ArgumentNullException(nameof(countryCollection)); } // get parentcompany drop down list var parentCompanytDDL = GetDropDownList.CompanyListItems(companyCollection, -1); var industryDDl = GetDropDownList.IIndsutryListItems(industryCollection, -1); var countryDDL = GetDropDownList.CountryListItem(countryCollection, 161); var model = new CompanyRegistrationView() { IndustryDropDownList = industryDDl, ParentCompanyDropDownList = parentCompanytDDL, CountryDropDownList = countryDDL, CompanyCountryId = 161 }; return(model); }
/// <summary> /// Creates the edit department view. /// </summary> /// <param name="departmentInfo">The department information.</param> /// <param name="departmentsList">The departments list.</param> /// <param name="companyList">The company list.</param> /// <param name="message">The message.</param> /// <returns></returns> /// <exception cref="ArgumentNullException"> /// departmentInfo /// or /// departmentsList /// or /// companyList /// </exception> public IDepartmentView CreateEditDepartmentView(IDepartment departmentInfo, IList <IDepartment> departmentsList, string message) { if (departmentInfo == null) { throw new ArgumentNullException(nameof(departmentInfo)); } if (departmentsList == null) { throw new ArgumentNullException(nameof(departmentsList)); } var departmentDDL = GetDropDownList.DepartmentListItems(departmentsList, departmentInfo.ParentDepartmentId); var view = new DepartmentView { DepartmentId = departmentInfo.DepartmentId, CompanyId = departmentInfo.CompanyId, ParentDepartmentDropDown = departmentDDL, ProcessingMessage = message, DepartmentName = departmentInfo.DepartmentName, Description = departmentInfo.Description, IsActive = departmentInfo.IsActive, ParentDepartmentId = departmentInfo.ParentDepartmentId, DateCreated = departmentInfo.DateCreated }; return(view); }
/// <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 department view. /// </summary> /// <param name="departmentInfo">The department information.</param> /// <param name="departmentCollection">The department collection.</param> /// <returns></returns> /// <exception cref="ArgumentNullException"> /// departmentInfo /// or /// departmentCollection /// </exception> public IDepartmentViews CreateEditDepartmentView(IDepartment departmentInfo, IList <IDepartment> departmentCollection) { if (departmentInfo == null) { throw new ArgumentNullException(nameof(departmentInfo)); } if (departmentCollection == null) { throw new ArgumentNullException(nameof(departmentCollection)); } var departmentDDL = GetDropDownList.DepartmentListItems(departmentCollection, -1); var returnDepartment = new DepartmentView { CompanyId = departmentInfo.CompanyId, DepartmentId = departmentInfo.DepartmentId, DepartmentName = departmentInfo.DepartmentName, Description = departmentInfo.Description, ParentDepartmentId = departmentInfo.ParentDepartmentId, ParentDepartmentDropDown = departmentDDL, IsActive = departmentInfo.IsActive, }; return(returnDepartment); }
/// <summary> /// Creates the vacancy view. /// </summary> /// <param name="companyCollection">The company collection.</param> /// <param name="departmentDropDown">The department drop down.</param> /// <param name="jobTitleDropDown">The job title drop down.</param> /// <param name="gradesDropDown">The grades drop down.</param> /// <param name="vacancyInfo">The vacancy information.</param> /// <param name="message">The message.</param> /// <returns></returns> public IVacancyView CreateVacancyView(IList <ICompanyDetail> companyCollection, IList <IDepartment> departmentDropDown, IList <IJobTitle> jobTitleDropDown, IList <IGrade> gradesDropDown, IVacancyView vacancyInfo, string message) { //Get Department var departmentDDL = GetDropDownList.DepartmentListItems(departmentDropDown, vacancyInfo.DepartmentId); //Get Job titles var jobTitleDDL = GetDropDownList.JobTitlesListItems(jobTitleDropDown, vacancyInfo.JobTitleId); //Get Grades var gradesDDl = GetDropDownList.GradeListItems(gradesDropDown, vacancyInfo.GradeId); // get company drop down list var companyDDL = GetDropDownList.CompanyListItems(companyCollection, vacancyInfo.CompanyId); var viewModel = vacancyInfo; viewModel.DepartmentDropDown = departmentDDL; viewModel.JobTitleDropDown = jobTitleDDL; viewModel.GradesDropDown = gradesDDl; viewModel.CompanyDropDown = companyDDL; viewModel.ProcessingMessage = message; return(viewModel); }
/// <summary> /// Gets the job titles ListView. /// </summary> /// <param name="seletedJobTitle">The seleted job title.</param> /// <param name="selectedJobTitle">The selected job title.</param> /// <param name="jobTitleCollections">The job title collections.</param> /// <param name="companyDetail">The company detail.</param> /// <param name="message">The message.</param> /// <returns></returns> /// <exception cref="ArgumentNullException"> /// jobTitleCollections /// or /// companyDetail /// </exception> public IJobTitleListView GetJobTitlesListView(int selectedCompanyId, string selectedJobTitle, IList <IJobTitle> jobTitleCollections, ICompanyDetail companyDetail, IList <ICompanyDetail> companyList, string message) { if (jobTitleCollections == null) { throw new ArgumentNullException(nameof(jobTitleCollections)); } if (companyDetail == null) { throw new ArgumentNullException(nameof(companyDetail)); } var companyDDL = GetDropDownList.CompanyListItems(companyList, selectedCompanyId); var filteredList = jobTitleCollections.Where(x => x.JobTitleName.Contains(string.IsNullOrEmpty(selectedJobTitle) ? x.JobTitleName : selectedJobTitle)).ToList(); var returnedView = new JobTitleListView { JobTitlesCollection = filteredList.ToList(), CompanyDetails = companyDetail, ProcessingMessage = message, SelectedJobTitle = selectedJobTitle, CompanyDropDownList = companyDDL }; return(returnedView); }
/// <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); }
/// <summary> /// Creates the employee payroll list. /// </summary> /// <param name="selectedMonth">The selected month.</param> /// <param name="selectedYear">The selected year.</param> /// <param name="payrollCollection">The payroll collection.</param> /// <param name="company">The company.</param> /// <param name="employee">The employee.</param> /// <param name="monthCollection">The month collection.</param> /// <param name="yearCollection">The year collection.</param> /// <param name="message">The message.</param> /// <returns></returns> /// <exception cref="ArgumentNullException"> /// monthCollection /// or /// yearCollection /// or /// payrollCollection /// </exception> public IPayrollListView CreateEmployeePayrollList(string selectedMonth, int?selectedYear, IList <IPayroll> payrollCollection, ICompanyDetail company, IEmployee employee, IList <IMonth> monthCollection, IList <IYear> yearCollection, string message) { if (monthCollection == null) { throw new ArgumentNullException(nameof(monthCollection)); } if (yearCollection == null) { throw new ArgumentNullException(nameof(yearCollection)); } if (payrollCollection == null) { throw new ArgumentNullException(nameof(payrollCollection)); } var monthDDL = GetDropDownList.Month(monthCollection, ""); var yearDDL = GetDropDownList.Year(yearCollection, -1); var viewwModel = new PayrollListView { MonthDropDown = monthDDL, YearDropDown = yearDDL, PayrollList = payrollCollection, ProcessingMessage = message, Company = company, Employee = employee, }; return(viewwModel); }
/// <summary> /// Gets the employee ListView. /// </summary> /// <param name="onboardingCollections">The onboarding collections.</param> /// <param name="staffNumber">The staff number.</param> /// <param name="staffName">Name of the staff.</param> /// <param name="message">The message.</param> /// <returns></returns> public IEmployeeOnBoardListView GetEmployeeListView( IList <IEmployee> employeeCollections, IList <ICompanyDetail> companyCollection, string sortOrder, string searchString, string message, int?page) { if (string.IsNullOrEmpty(searchString)) { searchString = ""; } searchString.ToLower(); //Filter Employee by Name var filteredList = employeeCollections.Where(x => (x.FirstName.ToLower()).Contains(string.IsNullOrEmpty(searchString) ? (x.FirstName.ToLower()) : searchString) || (x.LastName.ToLower()).Contains(string.IsNullOrEmpty(searchString) ? (x.LastName.ToLower()) : searchString) || (x.StaffNumber.ToLower()).Contains(string.IsNullOrEmpty(searchString) ? (x.StaffNumber.ToLower()) : searchString)); switch (sortOrder) { case "name_desc": filteredList = filteredList.OrderByDescending(s => s.LastName); break; case "Date": filteredList = filteredList.OrderBy(s => s.DateEmployed); break; case "date_desc": filteredList = filteredList.OrderByDescending(s => s.DateEmployed); break; default: filteredList = filteredList.OrderBy(s => s.LastName); break; } var companyDDL = GetDropDownList.CompanyListItems(companyCollection, -1); int pageSize = 10; int pageNumber = (page ?? 1); var returnedView = new EmployeeOnBoardListView { EmployeeList = filteredList.ToPagedList(pageNumber, pageSize), CompanyDropDown = companyDDL, sortOrder = string.IsNullOrEmpty(sortOrder) ? "name_desc" : "", searchString = (searchString == "Date" ? "date_desc" : "Date"), ProcessingMessage = message, }; return(returnedView); }
/// <summary> /// Creates the vacancy view. /// </summary> /// <param name="companyCollection"></param> /// <returns></returns> public IVacancyView CreateVacancyView(IList <ICompanyDetail> companyCollection) { // get company drop down list var companyDDL = GetDropDownList.CompanyListItems(companyCollection, -1); return(new VacancyView { CompanyDropDown = companyDDL, }); }
/// <summary> /// Creates the department view. /// </summary> /// <param name="departmentCollection">The department collection.</param> /// <param name="companyCollection">The company collection.</param> /// <param name="deptInfo">The dept information.</param> /// <param name="message">The message.</param> /// <returns></returns> public IDepartmentView CreateDepartmentView(IList <IDepartment> departmentCollection, IDepartmentView deptInfo, string message) { var departmentDDL = GetDropDownList.DepartmentListItems(departmentCollection, deptInfo.ParentDepartmentId); var view = deptInfo; view.ProcessingMessage = message; view.ParentDepartmentDropDown = departmentDDL; return(view); }
/// <summary> /// Creates the company registration view. /// </summary> /// <param name="companyInfo">The company information.</param> /// <param name="companyCollection">The company collection.</param> /// <returns></returns> /// <exception cref="ArgumentNullException">companyCollection</exception> public ICompanyRegistrationView CreateCompanyRegistrationView(ICompanyDetail companyInfo, IList <ICompanyDetail> companyCollection, IList <IIndustry> industryCollection, IList <ICountry> countryCollection) { if (companyCollection == null) { throw new ArgumentNullException(nameof(companyCollection)); } if (industryCollection == null) { throw new ArgumentNullException(nameof(industryCollection)); } // get parentcompany drop down list var parentCompanytDDL = GetDropDownList.CompanyListItems(companyCollection, companyInfo.ParentCompanyId ?? -1); var industryDDL = GetDropDownList.IIndsutryListItems(industryCollection, companyInfo.IndustryId); var countryDDL = GetDropDownList.CountryListItem(countryCollection, 161); var model = new CompanyRegistrationView() { ParentCompanyDropDownList = parentCompanytDDL, CountryDropDownList = countryDDL, ProcessingMessage = string.Empty, CompanyCountry = companyInfo.CompanyCountry, CACRegistrationNumber = companyInfo.CACRegistrationNumber, CompanyAddressLine1 = companyInfo.CompanyAddressLine1, CompanyAddressLine2 = companyInfo.CompanyAddressLine2, CompanyCity = companyInfo.CompanyCity, CompanyCountryId = 161, CompanyEmail = companyInfo.CompanyEmail, CompanyId = companyInfo.CompanyId, CompanyName = companyInfo.CompanyName, CompanyPhone = companyInfo.CompanyPhone, CompanyState = companyInfo.CompanyState, CompanyWebsite = companyInfo.CompanyWebsite, CompanyZipCode = companyInfo.CompanyZipCode, DateCreated = companyInfo.DateCreated, ParentCompanyId = companyInfo.ParentCompanyId, LogoDigitalFileId = companyInfo.LogoDigitalFileId, CompanyAlias = companyInfo.CompanyAlias, IsActive = companyInfo.IsActive, IndustryDropDownList = industryDDL, IndustryId = companyInfo.IndustryId, CompanyLogo = companyInfo.CompanyLogo }; return(model); }
/// <summary> /// Creates the department view. /// </summary> /// <param name="departmentCollection">The department collection.</param> /// <param name="companyId">The company identifier.</param> /// <param name="companyCollection"></param> /// <returns></returns> public IDepartmentView CreateDepartmentView(IList <IDepartment> departmentCollection, int companyId) { var departmentDDL = GetDropDownList.DepartmentListItems(departmentCollection, -1); var view = new DepartmentView { CompanyId = companyId, ParentDepartmentDropDown = departmentDDL, ProcessingMessage = string.Empty }; return(view); }
public IHomeView GetDashBoardOption(IUserDetail userInfo, IList <ICompanyDetail> companyCollection) { var companyDDL = GetDropDownList.CompanyListItems(companyCollection, -1); var result = new HomeModelView { CompanyCollection = companyCollection, CompanyDropDown = companyDDL, User = userInfo }; return(result); }
public ITrainingNeedAnalysisView CreateTrainingNeedAnalysisView(IList <ICompanyDetail> companyCollection) { //if (trainingNeedAnalysisId == null) throw new ArgumentNullException(nameof(trainingNeedAnalysisId)); var companyDDL = GetDropDownList.CompanyListItems(companyCollection, -1); var viewModel = new TrainingNeedAnalysisView { //TrainingNeedAnalysisID = trainingNeedAnalysisId, CompanyCollection = companyDDL }; return(viewModel); }
/// <summary> /// Creates the leave request update view. /// </summary> /// <param name="leaveRequestInfo">The leave request information.</param> /// <param name="viewModelData">The view model data.</param> /// <returns></returns> public ILeaveRequestViewModel CreateLeaveRequestUpdateView(ILeaveRequestViewModel leaveRequestInfo, Hashtable viewModelData) { // Extract relevant data from the viewModelData var leaveTypeCollection = viewModelData["leaveTypeCollection"] as List <ILeaveType>; var leaveStatusCollection = viewModelData["leaveStatusCollection"] as List <ILeaveStatus>; var processingMessage = (string)viewModelData["processingMessage"]; var employeeName = (string)viewModelData["employeeName"]; var approvingAuthorityName = (string)viewModelData["approvingAuthorityName"]; var hrApproverName = (string)viewModelData["hrApproverName"]; var leaveStatusName = (string)viewModelData["leaveStatusName"]; var leaveTypeName = (string)viewModelData["leaveTypeName"]; var annualLeaveDuration = (int)viewModelData["annualLeaveDuration"]; var employeeId = (int)viewModelData["employeeId"]; // Get the dropdown list items var leaveTypeDDL = GetDropDownList.LeaveTypeListItems(leaveTypeCollection, leaveRequestInfo.LeaveTypeID); var leaveStatusDDL = GetDropDownList.LeaveStatusListItems(leaveStatusCollection, leaveRequestInfo.LeaveStatusID); var viewModel = new LeaveRequestViewModel { ProcessingMessage = processingMessage, LeaveTypeDropDown = leaveTypeDDL, LeaveStatusDropDown = leaveStatusDDL, LeaveID = leaveRequestInfo.LeaveID, EmployeeID = leaveRequestInfo.EmployeeID, LeaveTypeID = leaveRequestInfo.LeaveTypeID, DateLeaveStart = leaveRequestInfo.DateLeaveStart, DateLeaveEnds = leaveRequestInfo.DateLeaveEnds, Comment = leaveRequestInfo.Comment, LeaveStatusID = leaveRequestInfo.LeaveStatusID, DateRequested = leaveRequestInfo.DateRequested, ApprovingAuthorityID = leaveRequestInfo.ApprovingAuthorityID, HRApproverID = leaveRequestInfo.HRApproverID, ApprovingAuthorityComment = leaveRequestInfo.ApprovingAuthorityComment, HRApproverComment = leaveRequestInfo.HRApproverComment, DateApprovedDept = leaveRequestInfo.DateApprovedDept, DateApprovedHR = leaveRequestInfo.DateApprovedHR, DateCreated = leaveRequestInfo.DateCreated, EmployeeName = employeeName, ApprovingAuthorityName = approvingAuthorityName, HRApproverName = hrApproverName, LeaveStatusName = leaveStatusName, LeaveTypeName = leaveTypeName, AnnualLeaveDuration = annualLeaveDuration }; return(viewModel); }
/// <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); }