Beispiel #1
0
        public ActionResult Edit(int id)
        {
            UserWeb userWeb = new UserWeb();

            Library.User user = userWeb.Users.Single(g => g.Id == id);
            return(View(user));
        }
Beispiel #2
0
        public ActionResult Create(Library.User user)
        {
            if (!ModelState.IsValid)
            {
                return(View("Create"));
            }

            UserWeb userWeb = new UserWeb();

            userWeb.AddUser(user);
            return(RedirectToAction("Index"));
        }
Beispiel #3
0
        public ActionResult Edit([Bind(Include = "UserAccount, UserClass, Email, Password, UserName")] Library.User user)
        {
            UserWeb userWeb = new UserWeb();

            user.Id = userWeb.Users.Single(g => g.Id == user.Id).Id;

            if (!ModelState.IsValid)
            {
                return(View("Edit", user));
            }

            userWeb.SaveUser(user);

            return(RedirectToAction("Index"));
        }