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