Пример #1
0
        public ActionResult Add()
        {
            var m = new TaskEditVM { /*[todo:set default value]*/
            };

            return(ForView("Edit", m));
        }
Пример #2
0
        public ActionResult Edit(int id)
        {
            var m = new TaskEditVM
            {
                Input = Map <Task, TaskEditVM.EditInput>(TaskBD.Get(id))
            };

            return(ForView(m));
        }
Пример #3
0
 public ActionResult Save(TaskEditVM editvm)
 {
     if (ModelState.IsValid)
     {
         Save(editvm.Input);
         SetViewMessage(Message_SaveSuccessfully);
         if (editvm.Input.Id == 0)
         {
             return(RcJson());
         }
     }
     return(ClientShowMessage());
 }