Exemple #1
0
        public ActionResult UserEdit(string username, UserEditModel model)
        {
            try
            {
                User user = new User
                {
                    UserName = model.UserName,
                    DisplayName = model.DisplayName,
                    Email = model.Email,
                };

                AccountManager.UpdateUser(username, user);

                return RedirectToAction("Users");
            }
            catch
            {
                return View();
            }
        }
Exemple #2
0
        public ActionResult UserCreate(UserEditModel model)
        {
            try
            {
                // this will be replaced
                var info = new
                {
                    Email = model.Email,
                    AccountStatus = "1",
                    DisplayName = model.DisplayName,
                    Language = "0",
                    TZone = "Pacific Standard Time",
                    Bio = "",
                    DateLastActivity = DateTime.UtcNow,
                    //Contact = "",
                };

                WebSecurity.CreateUserAndAccount(model.UserName, model.Password, info);

                return RedirectToAction("Users");
            }
            catch
            {
                return View("UserEdit", model);
            }
        }