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) { Story s = new Story(); try { UpdateModel(s); repo.AddStory(s); repo.Save(); // TODO: Add insert logic here return RedirectToAction("Index"); } catch { ModelState.AddRuleViolations(s.GetRuleViolations()); return View(new StoriesViewModel(s)); } }
public static List<SelectListItem> StoriesWithSelected(Story s) { var items = _repo.FindAllStories(); List<SelectListItem> list = new List<SelectListItem>(); foreach (var item in items) { SelectListItem i; i = new SelectListItem { Value = item.StoryID.ToString(), Text = item.Name, Selected = s.StoryID == item.StoryID }; list.Add(i); } return list; }
partial void DeleteStory(Story instance);
partial void UpdateStory(Story instance);
partial void InsertStory(Story instance);
// // GET: /Stories/Create public ActionResult Create() { Story s = new Story(); StoriesViewModel m = new StoriesViewModel(s); return View(m); }
// // GET: /Stories/AddTasks public ActionResult AddTasks(int id) { Story s = new Story(); StoriesViewModel m = new StoriesViewModel(s); return View(m); }