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)
        {
            Sprint s = new Sprint();
            try
            {
                UpdateModel(s);
                repo.AddSprint(s);
                repo.Save();

                return RedirectToAction("Index");
            }
            catch
            {
                return View(s);
            }
        }
Example #3
0
        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;
        }
Example #4
0
 partial void DeleteSprint(Sprint instance);
Example #5
0
 partial void UpdateSprint(Sprint instance);
Example #6
0
 partial void InsertSprint(Sprint instance);