Exemple #1
0
        /// <summary>
        /// To the view model.
        /// </summary>
        /// <param name="entity">The entity.</param>
        /// <returns></returns>
        public static ProgressNoteAssessmentViewModel ToViewModel(this ProgressNoteAssessmentModel entity)
        {
            if (entity == null)
            {
                return(null);
            }
            if (entity.NoteAssessmentTime == null)
            {
                entity.NoteAssessmentTime = new TimeSpan();
            }
            var model = new ProgressNoteAssessmentViewModel
            {
                ScheduleNoteAssessmentID = entity.ScheduleNoteAssessmentID,
                NoteAssessmentDate       = entity.NoteAssessmentDate,
                NoteAssessmentTime       = entity.NoteAssessmentTime,
                LocationID             = entity.LocationID,
                Location               = entity.Location,
                ProviderID             = entity.ProviderID,
                MembersInvited         = entity.MembersInvited,
                ProgressNoteID         = entity.ProgressNoteID,
                NoteAssessmentTimeSecs = (entity.NoteAssessmentTime.Value.Days * 24 * 60 * 60 +
                                          entity.NoteAssessmentTime.Value.Hours * 60 * 60 +
                                          entity.NoteAssessmentTime.Value.Minutes * 60 +
                                          entity.NoteAssessmentTime.Value.Seconds),
                ModifiedOn = entity.ModifiedOn
            };

            return(model);
        }
Exemple #2
0
        /// <summary>
        /// To the model.
        /// </summary>
        /// <param name="model">The model.</param>
        /// <returns></returns>
        public static ProgressNoteAssessmentModel ToModel(this ProgressNoteAssessmentViewModel model)
        {
            if (model == null)
            {
                return(null);
            }

            var entity = new ProgressNoteAssessmentModel
            {
                ScheduleNoteAssessmentID = model.ScheduleNoteAssessmentID,
                NoteAssessmentDate       = model.NoteAssessmentDate,
                NoteAssessmentTime       = TimeSpan.FromSeconds(model.NoteAssessmentTimeSecs),
                LocationID     = model.LocationID,
                Location       = model.Location,
                ProviderID     = model.ProviderID,
                MembersInvited = model.MembersInvited,
                ProgressNoteID = model.ProgressNoteID,
                ModifiedOn     = model.ModifiedOn
            };

            return(entity);
        }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NoteHeaderViewModel"/> class.
 /// </summary>
 public NoteHeaderViewModel()
 {
     Discharge              = new DischargeViewModel();
     ProgressNote           = new ProgressNoteViewModel();
     ProgressNoteAssessment = new ProgressNoteAssessmentViewModel();
 }