Пример #1
0
        public static UserBreakTimeVM MToVM(UserBreakTime item)
        {
            var temp = new UserBreakTimeVM()
            {
                id   = "" + item.ID,
                User = new UsersViewModel()
                {
                    ID = item.UserID
                },
                timeStarted = TimeConverter.ConvertDateTimeToTime(item.StartDateTime.Value),
                timeEnded   = item.EndDateTime.HasValue ? TimeConverter.ConvertDateTimeToTime(item.EndDateTime.Value) : "00:00:00",
                TotalTime   = item.TotalTime.HasValue ? item.TotalTime.Value.ToString() : "N/A",
                Type        = BreakTypeUtility.MToVM(item.BreakType),
                IsFinished  = item.IsFinishedBreak.HasValue ? item.IsFinishedBreak.Value : false,
                Remarks     = item.Remarks
            };

            return(temp);
        }