public ActionResult CreateNewList() { ListMainModel model = new ListMainModel(); model.UserList = new UserListDO(); model.UserList.UserID = UserID; return(View(model)); }
public ActionResult CreateNewList(ListMainModel model) { model.UserList.UserID = UserID; UserListDO savedObject = UserListBL.SaveUserList(model.UserList); if (savedObject.ID > 0) { TempData["InfoMessage"] = "List created"; return(RedirectToAction("ViewList", new { id = savedObject.ID })); } else { TempData["ErrorMessage"] = "Error occurred while creating list!"; } return(View(model)); }