Ejemplo n.º 1
0
        public ActionResult Edit(TaskModel taskModel)
        {
            if (ModelState.IsValid)
            {
            TaskEntity taskEntity3 = new TaskEntity();
            taskEntity3.Id = taskModel.Id;
            taskEntity3.Title = taskModel.Title;
            taskEntity3.IsDone = (bool)taskModel.IsDone;

            _taskRepository.Add(taskEntity3);

            //_taskRepository.SaveChanges();
            return RedirectToAction("Index");
            }
            return View(taskModel);

            //if (editFinish == "Cancel")
            //{
            //    return RedirectToAction("Index");
            //}

            //return RedirectToAction("Index");
        }
Ejemplo n.º 2
0
        public ActionResult Save(TaskModel taskModel)
        {
            if (ModelState.IsValid)
              {
            //this._taskRepository.Add(
            //_taskRepository.Add(taskModel);

            //_taskRepository.SaveChanges();
            return RedirectToAction("Index", new { id = taskModel.Id });
              }
              return View(taskModel);
        }