Esempio n. 1
0
        public ActionResult CreateNewList()
        {
            ListMainModel model = new ListMainModel();

            model.UserList        = new UserListDO();
            model.UserList.UserID = UserID;

            return(View(model));
        }
Esempio n. 2
0
        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));
        }