コード例 #1
0
        public ActionResult Create(MissionViewModel model, int taskIdNew)
        {
            var task = taskService.GetById(taskIdNew);

            missionService.Create(new MissionEntity
            {
                Name        = task.Name,
                TaskId      = taskIdNew,
                IsDone      = false,
                Description = model.Description
            });
            var mission = missionService.GetAllByPredicate(m => m.TaskId == taskIdNew).Select(m => m.GetMissionViewModel
                                                                                                  ());

            ViewBag.Tasks      = taskService.GetAllEntities();
            ViewBag.Precentage = 0;
            return(PartialView("_MissionView", mission));
        }