public static List <MissionDto> GetMissionByListId(Guid listId) { using (var missionSvc = new MissionService()) { return(missionSvc.GetAll(m => m.MissionListId == listId).OrderBy(m => m.CreateTime).Select(m => new MissionDto() { Id = m.Id, MissionName = m.MissionName, MissionListId = m.MissionListId, Desc = m.Desc, Priority = m.Priority, Score = m.Score, DueDate = m.DueDate, }).ToList()); } }
public void Add() { if (!IsEdit) { newMission.Name = Name; newMission.Description = Description; newMission.StartTime = StartTime; newMission.EndTime = EndTime; newMission.MissionTypeId = SelectedMissionType?.Id; SelectedTeams = ActualTeams.ToList(); string x = MissionService.Add(newMission); if (x == null) { MissionService.SetObserversToMission(newMission.Observers, MissionService.GetAll().Last().Id); TryClose(); } else { Error = x; } } else { toEdit.Name = Name; toEdit.Description = Description; toEdit.StartTime = StartTime; toEdit.EndTime = EndTime; toEdit.MissionTypeId = SelectedMissionType?.Id; SelectedTeams = ActualTeams.ToList(); string x = MissionService.Edit(toEdit); if (x == null) { MissionService.SetObserversToMission(toEdit.Observers, toEdit.Id); TryClose(); } else { Error = x; } } }
public void Reload() { Missions = MissionService.GetAll(); NotifyOfPropertyChange(() => Missions); }
public IEnumerable <MissionViewModel> GetAll() { var items = _missionService.GetAll(); return(items); }