Beispiel #1
0
        public IActionResult EditScheduleModal(Models.Schedule.EditSchedule model)
        {
            ChangeResult result = new ChangeResult();

            if (ModelState.IsValid)
            {
                ScheduleDto dto = new ScheduleDto
                {
                    EndDate      = model.EndDate.ToUniversalTime(),
                    ScheduleId   = model.ScheduleId,
                    StartDate    = model.StartDate.ToUniversalTime(),
                    SupportLevel = model.SupportLevel,
                    TeamId       = model.TeamId,
                    UserId       = model.UserId
                };
                result = ScheduleService.SaveSchedule(dto);
            }
            else
            {
                model.FillTeamSelectList(TeamService.GetTeams());
                model.FillSupportLevelSelectList();
                model.UserSelectList = new List <SelectListItem>();
            }

            return(PartialView("_ScheduleEditPartial", model));
        }
Beispiel #2
0
        public IActionResult EditScheduleModal(string id)
        {
            Guid?scheduleId = Helper.ConvertToGuid(id);
            var  teams      = TeamService.GetTeams();

            Models.Schedule.EditSchedule model = new Models.Schedule.EditSchedule(teams);
            if (scheduleId.HasValue)
            {
                var schedule = ScheduleService.GetSchedule(scheduleId.Value);
                model = new Models.Schedule.EditSchedule(schedule, teams);
            }

            return(PartialView("_ScheduleEditPartial", model));
        }