Example #1
0
 public ResidentShiftModel Map(ResidentShift data)
 {
     return(new ResidentShiftModel
     {
         Id = data.Id,
         // NOTE: THIS SECTION CONTAINS CHANGES ADDED AFTER THE
         //    DEADLINE, TO RESOLVE BUG PERSISTING TIME ENTRIES
         EndDateTime = data.EndDateTimeUtc,
         StartDateTime = data.StartDateTimeUtc,
         EntryDateTime = data.EntryDateTimeUtc,
         InstitutionResidentId = data.InstitutionResidentId
     });
 }
Example #2
0
        public ResidentShift Map(ResidentShiftModel model)
        {
            var resShift = new ResidentShift
            {
                InstitutionResidentId = model.InstitutionResidentId,

                //Ensure that the client times are mapped to UTC before persistence
                EndDateTimeUtc   = model.EndDateTime.HasValue ? model.EndDateTime.Value.ToUniversalTime() : (DateTime?)null,
                StartDateTimeUtc = model.StartDateTime.ToUniversalTime(),
                EntryDateTimeUtc = model.EntryDateTime.ToUniversalTime()
            };

            if (model.Id > 0)
            {
                resShift.Id = model.Id;
            }
            return(resShift);
        }