public TaskFormViewModel(Task task , Sprint sprint , User user, Code code, Story story) { TimeforingRepository repo = new TimeforingRepository(); Task = task; Sprint = SelectListMaker.SprintsWithSelected(Task); User = SelectListMaker.UsersWithSelected(Task); Code = SelectListMaker.CodesWithSelected(Task); Story = SelectListMaker.StoriesWithSelected(Task); }
public ActionResult Create(FormCollection collection) { Sprint s = new Sprint(); try { UpdateModel(s); repo.AddSprint(s); repo.Save(); return RedirectToAction("Index"); } catch { return View(s); } }
public static List<SelectListItem> SprintsWithSelected(Sprint sprint) { var items = _repo.FindAllSprints().Where(s => s.Archived != true).Select(s => s); ; List<SelectListItem> list = new List<SelectListItem>(); foreach (var item in items) { SelectListItem i; i = new SelectListItem { Value = item.SprintID.ToString(), Text = item.Name, Selected = sprint.SprintID == item.SprintID }; list.Add(i); } return list; }
partial void DeleteSprint(Sprint instance);
partial void UpdateSprint(Sprint instance);
partial void InsertSprint(Sprint instance);