Exemplo n.º 1
0
        /// <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);
        }
Exemplo n.º 2
0
        //----------------------------------------------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);
        }