Ejemplo n.º 1
0
        private static Interval ThemisMap(ChoreFormViewModel model)
        {
            var result = IntervalService.CreateNew(model.IntervalType);

            result.Duration    = (uint)model.Duration;
            result.StartDay    = model.StartDay.Value; // MUST have a valid StartDay here!
            result.StartOfWeek = model.StartOfWeek;
            return(result);
        }
Ejemplo n.º 2
0
        private static Chore MapFromDb(DbChore dbChore)
        {
            var interval = IntervalService.CreateNew(dbChore.IntervalType);

            interval.Duration    = dbChore.Duration;
            interval.StartDay    = dbChore.StartDay;
            interval.StartOfWeek = dbChore.StartOfWeek;

            string[] assis = { };
            if (!string.IsNullOrEmpty(dbChore.AssignedUsers))
            {
                assis = dbChore.AssignedUsers.Split(";");
            }

            return(new Chore
            {
                Title = dbChore.Title,
                Description = dbChore.Description,
                AssignedUsers = assis,
                Interval = interval
            });
        }