public ActionResult EditedSubTodoSave(SubTodoListVM subTodoListVM) { if (ModelState.IsValid) { SubTodoList subTodoList = new SubTodoList(); subTodoList.Id = subTodoListVM.Id; subTodoList.SubTodoName = subTodoListVM.SubTodoName; subTodoList.SubTodoDate = subTodoListVM.SubTodoDate; subTodoList.SubTodoStatus = subTodoListVM.SubTodoStatus; bool isSubTodoEdited = todoListService.EditSubTodoList(subTodoList); if (isSubTodoEdited) { return(RedirectToAction("Index", new { Message = "Data Updated Successfully" })); } else { return(RedirectToAction("Error")); } } else { return(RedirectToAction("Error")); } }
public ActionResult EditSubTodo(int id) { var subTodoItem = todoListService.GetSubTodoItemById(id); SubTodoListVM subTodoInstance = new SubTodoListVM(); subTodoInstance.Id = subTodoItem.Id; subTodoInstance.SubTodoName = subTodoItem.SubTodoName; subTodoInstance.SubTodoDate = subTodoItem.SubTodoDate; subTodoInstance.SubTodoStatus = subTodoItem.SubTodoStatus; return(View(subTodoInstance)); }