public ActionResult TaskDetail(TaskDetailViewModel model) { DAL.Task task = bundleService.GetTaskWithId(model.Id); if (task == null) return HttpNotFound("Item Not Found"); task.task_name = model.Name; task.task_type_id = model.TypeId; if (model.MinimumToFound == 0) task.minimum_to_find = null; else task.minimum_to_find = model.MinimumToFound; bundleService.UpdateTask(task); return View(model); }
public ActionResult TaskDetail(int id) { id = Int32.Parse((string)RouteData.Values["id"]); DAL.Task task = bundleService.GetTaskWithId(id); if( task == null) return HttpNotFound("Item Not Found"); TaskDetailViewModel model = new TaskDetailViewModel() { Name = task.task_name, TypeId = task.task_type_id, BundleId = task.bundle_id, Id = task.id, MinimumToFound = (task.minimum_to_find == null) ? 0 : (int)task.minimum_to_find }; return View(model); }