Beispiel #1
0
        public ActionResult Edit(int id)
        {
            SubToDoHelper h   = new SubToDoHelper(new Repository());
            SubToDo       t   = h.GetSubToDo(id);
            sToDoModel    stm = new sToDoModel
            {
                Name        = t.Name,
                Description = t.Description,
                State       = t.State,
                TID         = t.ToDo.ID
            };

            DropDownInit(t.State);

            return(View(stm));
        }
Beispiel #2
0
        public ActionResult Edit(int id, sToDoModel stm)
        {
            SubToDoHelper h  = new SubToDoHelper(new Repository());
            var           st = h.GetSubToDo(id);

            st.Name        = stm.Name;
            st.State       = stm.State;
            st.Description = stm.Description;
            DropDownInit(st.State);
            if (ModelState.IsValid)
            {
                SubToDoHelper Helper = new SubToDoHelper(new Repository());
                Helper.EditSubToDo(st);
                return(RedirectToAction("Details", "ToDo", new { id = stm.TID }));
            }
            else
            {
                return(View(stm));
            }
        }