/// <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 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 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);
        }
Beispiel #4
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 #5
0
        /// <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);
        }
Beispiel #6
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 training need analysis view.
        /// </summary>
        /// <param name="trainingNeedAnalysus">The training need analysus.</param>
        /// <param name="companyCollection">The company collection.</param>
        /// <param name="training">The training.</param>
        /// <param name="jobCollection">The job collection.</param>
        /// <param name="frequencyOfDeliveryCollection">The frequency of delivery collection.</param>
        /// <param name="currencyCollection">The currency collection.</param>
        /// <param name="message">The message.</param>
        /// <returns></returns>
        public ITrainingNeedAnalysisView CreateTrainingNeedAnalysisView(ITrainingNeedAnalysisView trainingNeedAnalysus, IList <ITraining> training, IList <IJobTitle> jobCollection, IList <IFrequencyOfDeliveryModel> frequencyOfDeliveryCollection, IList <ICurrency> currencyCollection, IList <IMethodOfDelivery> methodOfDeliveryCollection, string message)
        {
            var TrainingDDL            = GetDropDownList.TrainingListItems(training, trainingNeedAnalysus.TrainingID);
            var jobDDL                 = GetDropDownList.JobTitlesListItems(jobCollection, trainingNeedAnalysus.JobID);
            var FrequencyOfDeliveryDDL = GetDropDownList.FrequencyOfDeliveryListItems(frequencyOfDeliveryCollection, trainingNeedAnalysus.FrequencyOfDeliveryID);
            var CurrencyDDL            = GetDropDownList.CurrencyListItems(currencyCollection, trainingNeedAnalysus.Currency);
            var methodOfDeliveryDDL    = GetDropDownList.MethondOfDeliveryListItems(methodOfDeliveryCollection, trainingNeedAnalysus.MethodOfDelivery);

            trainingNeedAnalysus.JobDropDownList                 = jobDDL;
            trainingNeedAnalysus.TrainingDropDownList            = TrainingDDL;
            trainingNeedAnalysus.CurrencyDropDownList            = CurrencyDDL;
            trainingNeedAnalysus.FrequencyOfDeliveryDropDownList = FrequencyOfDeliveryDDL;
            trainingNeedAnalysus.MethodOfDeliveryDropDown        = methodOfDeliveryDDL;

            trainingNeedAnalysus.ProcessingMessage = message;

            return(trainingNeedAnalysus);
        }
        //----------------------------------------------Training Calendar Section End----------------------------------------------------------------//

        //-----------------------------------------------Training Analysis Section-----------------------------------------------------------------------//

        /// <summary>
        /// Creates the training need analysis view.
        /// </summary>
        /// <param name="companyCollection">The company collection.</param>
        /// <param name="training">The training.</param>
        /// <param name="jobCollection">The job collection.</param>
        /// <param name="frequencyOfDeliveryCollection">The frequency of delivery collection.</param>
        /// <param name="currencyCollection">The currency collection.</param>
        /// <returns></returns>
        public ITrainingNeedAnalysisView CreateTrainingNeedAnalysisView(int companyId, IList <ITraining> training, IList <IJobTitle> jobCollection, IList <IFrequencyOfDeliveryModel> frequencyOfDeliveryCollection, IList <ICurrency> currencyCollection, IList <IMethodOfDelivery> methodOfDeliveryCollection)
        {
            var TrainingDDL            = GetDropDownList.TrainingListItems(training, -1);
            var jobDDL                 = GetDropDownList.JobTitlesListItems(jobCollection, -1);
            var FrequencyOfDeliveryDDL = GetDropDownList.FrequencyOfDeliveryListItems(frequencyOfDeliveryCollection, -1);
            var CurrencyDDL            = GetDropDownList.CurrencyListItems(currencyCollection, -1);
            var methodOfDeliveryDDL    = GetDropDownList.MethondOfDeliveryListItems(methodOfDeliveryCollection, -1);

            var Model = new TrainingNeedAnalysisView
            {
                TrainingDropDownList            = TrainingDDL,
                JobDropDownList                 = jobDDL,
                FrequencyOfDeliveryDropDownList = FrequencyOfDeliveryDDL,
                CurrencyDropDownList            = CurrencyDDL,
                MethodOfDeliveryDropDown        = methodOfDeliveryDDL,
                CompanyID = companyId
            };

            return(Model);
        }
        /// <summary>
        /// Creates the edit training analysis view.
        /// </summary>
        /// <param name="trainingNeedAnalysis">The training need analysis.</param>
        /// <param name="companyCollection">The company collection.</param>
        /// <param name="training">The training.</param>
        /// <param name="jobCollection">The job collection.</param>
        /// <param name="frequencyOfDeliveryCollection">The frequency of delivery collection.</param>
        /// <param name="currencyCollection">The currency collection.</param>
        /// <param name="methodOfDeliveryCollection">The method of delivery collection.</param>
        /// <param name="message">The message.</param>
        /// <returns></returns>
        public ITrainingNeedAnalysisView CreateEditTrainingAnalysisView(ITrainingNeedAnalysis trainingNeedAnalysis, IList <ITraining> training,
                                                                        IList <IJobTitle> jobCollection, IList <IFrequencyOfDeliveryModel> frequencyOfDeliveryCollection, IList <ICurrency> currencyCollection, IList <IMethodOfDelivery> methodOfDeliveryCollection, string message)
        {
            var TrainingDDL               = GetDropDownList.TrainingListItems(training, trainingNeedAnalysis.TrainingId);
            var jobDDL                    = GetDropDownList.JobTitlesListItems(jobCollection, trainingNeedAnalysis.JobId);
            var FrequencyOfDeliveryDDL    = GetDropDownList.FrequencyOfDeliveryListItems(frequencyOfDeliveryCollection, trainingNeedAnalysis.FrequecyOfDeliveryId);
            var CurrencyDDL               = GetDropDownList.CurrencyListItems(currencyCollection, trainingNeedAnalysis.CurrencyId);
            var approvedBudgetCurrencyDDL = GetDropDownList.CurrencyListItems(currencyCollection, trainingNeedAnalysis.ApprovedBudgetCurrency);
            var methodOfDeliveryDDL       = GetDropDownList.MethondOfDeliveryListItems(methodOfDeliveryCollection, trainingNeedAnalysis.MethodOfDelivery);

            var Model = new TrainingNeedAnalysisView
            {
                TrainingNeedAnalysisID = trainingNeedAnalysis.TrainingNeedAnaylsisId,
                TrainingID             = trainingNeedAnalysis.TrainingId,
                TrainingDescription    = trainingNeedAnalysis.TrainingDescription,
                JobID                              = trainingNeedAnalysis.JobId,
                TrainingDuration                   = trainingNeedAnalysis.TrainingDuration,
                TrainingName                       = trainingNeedAnalysis.TrainingName,
                TrainingProvider                   = trainingNeedAnalysis.TrainingProvider,
                MethodOfDelivery                   = trainingNeedAnalysis.MethodOfDelivery,
                Cost                               = trainingNeedAnalysis.Cost,
                Location                           = trainingNeedAnalysis.Location,
                IsProviderApproved                 = trainingNeedAnalysis.IsProviderApproved,
                ApprovedBudget                     = trainingNeedAnalysis.ApprovedBudget,
                ApprovedBudgetCurrency             = trainingNeedAnalysis.ApprovedBudgetCurrency,
                FrequencyOfDeliveryID              = trainingNeedAnalysis.FrequecyOfDeliveryId,
                CompanyID                          = trainingNeedAnalysis.CompanyId,
                CertificateIssued                  = trainingNeedAnalysis.CertificateIssued,
                TrainingDropDownList               = TrainingDDL,
                JobDropDownList                    = jobDDL,
                FrequencyOfDeliveryDropDownList    = FrequencyOfDeliveryDDL,
                CurrencyDropDownList               = CurrencyDDL,
                MethodOfDeliveryDropDown           = methodOfDeliveryDDL,
                Currency                           = trainingNeedAnalysis.CurrencyId,
                ProcessingMessage                  = message,
                ApprovedBudgetCurrencyDropDownList = approvedBudgetCurrencyDDL
            };

            return(Model);
        }
        //----------------------------------------------Training Analysis Section End-------------------------------------------------------------------//

        //----------------------------------------------Training History Section Begins-----------------------------------------------------------------//

        public ITrainingHistoryViewModel CreateTrainingHistoryView(IList <ICertificationModel> certificateCollection, IList <ITraining> trainingCollection, IList <ITrainingReport> trainingReport, int userId)
        {
            if (certificateCollection == null)
            {
                throw new ArgumentNullException(nameof(certificateCollection));
            }


            var certificateDDL    = GetDropDownList.CertificateListItem(certificateCollection, -1);
            var TrainingDDL       = GetDropDownList.TrainingListItems(trainingCollection, -1);
            var trainingReportDDL = GetDropDownList.TrainingReportListItem(trainingReport, -1);

            var viewModel = new TrainingHistoryViewModel
            {
                //Assigning the drop down to the View model
                CertificateDropDownList = certificateDDL,
                TrainingDropDownList    = TrainingDDL,
                TrainingVendorDropList  = trainingReportDDL,
                UserId = userId
            };

            return(viewModel);
        }
Beispiel #11
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 training calendar view.
        /// </summary>
        /// <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 CreateTrainingCalendarView(int companyId, IList <ITraining> trainingCollection, IList <ITrainingStatus> trainingStatusCollection)
        {
            if (trainingCollection == null)
            {
                throw new ArgumentNullException(nameof(trainingCollection));
            }
            if (trainingStatusCollection == null)
            {
                throw new ArgumentNullException(nameof(trainingStatusCollection));
            }

            var trainingDDL       = GetDropDownList.TrainingListItems(trainingCollection, -1);
            var trainingStatusDDL = GetDropDownList.TrainingStatusListItems(trainingStatusCollection, -1);

            var result = new TrainingCalendarView
            {
                TrainingStatusDropDown = trainingStatusDDL,
                TrainingDropDown       = trainingDDL,
                CompanyId         = companyId,
                ProcessingMessage = string.Empty,
            };

            return(result);
        }