Esempio n. 1
0
        /// <summary>
        /// To the model.
        /// </summary>
        /// <param name="model">The model.</param>
        /// <returns></returns>
        public static AssessmentSectionsModel ToModel(this AssessmentSectionsViewModel model)
        {
            if (model == null)
            {
                return(null);
            }

            var entity = new AssessmentSectionsModel
            {
                AssessmentSectionID = model.AssessmentSectionID,
                SectionName         = model.SectionName,
                AssessmentID        = model.AssessmentID,
                SortOrder           = model.SortOrder,
                IsActive            = model.IsActive,
                ModifiedBy          = model.ModifiedBy,
                ModifiedOn          = model.ModifiedOn,
                ForceRollback       = model.ForceRollback
            };

            return(entity);
        }
Esempio n. 2
0
        /// <summary>
        /// To the view model.
        /// </summary>
        /// <param name="entity">The entity.</param>
        /// <returns></returns>
        public static AssessmentSectionsViewModel ToViewModel(this AssessmentSectionsModel entity)
        {
            if (entity == null)
            {
                return(null);
            }

            var model = new AssessmentSectionsViewModel
            {
                AssessmentSectionID = entity.AssessmentSectionID,
                SectionName         = entity.SectionName,
                AssessmentID        = entity.AssessmentID,
                SortOrder           = entity.SortOrder,
                PermissionKey       = entity.PermissionKey,
                IsActive            = entity.IsActive,
                ModifiedBy          = entity.ModifiedBy,
                ModifiedOn          = entity.ModifiedOn,
                ForceRollback       = entity.ForceRollback
            };

            return(model);
        }