Example #1
0
        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);
        }
Example #2
0
        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));
            }
        }
Example #3
0
        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;
        }
Example #4
0
 partial void DeleteStory(Story instance);
Example #5
0
 partial void UpdateStory(Story instance);
Example #6
0
 partial void InsertStory(Story instance);
Example #7
0
 //
 // GET: /Stories/Create
 public ActionResult Create()
 {
     Story s = new Story();
     StoriesViewModel m = new StoriesViewModel(s);
     return View(m);
 }
Example #8
0
 //
 // GET: /Stories/AddTasks
 public ActionResult AddTasks(int id)
 {
     Story s = new Story();
     StoriesViewModel m = new StoriesViewModel(s);
     return View(m);
 }