示例#1
0
        public ActionResult RegisterUserEdit(User user, int id)
        {
            var model = AuthenticationDB.GetUserByEmail(user.Email);

            if (model != null)
            {
                if (model.UserId != user.UserId)
                {
                    ModelState.AddModelError("Warning Email", "Sorry: Email already Exists");
                    return(View(user));
                }
            }
            else
            {
                model = AuthenticationDB.GetUserById(user.UserId);
            }
            model.FullName             = user.FullName;
            model.Email                = user.Email;
            model.IsActive             = user.IsActive;
            model.Phone                = user.Phone;
            model.CommunicationAddress = user.CommunicationAddress;
            AuthenticationDB.Save(model);

            return(RedirectToAction("RegisterUser"));
        }
示例#2
0
        public ActionResult RegisterUserEdit(int id)
        {
            var model = AuthenticationDB.GetUserById(id);

            // View Model Conversation here....
            return(View(model));
        }
示例#3
0
        public ActionResult ChangeStatus(int id)
        {
            var model = AuthenticationDB.GetUserById(id);

            model.IsActive = !model.IsActive;
            AuthenticationDB.Save(model);
            return(RedirectToAction("RegisterUser"));
        }