예제 #1
0
 public RSPrincipal(RSUser user)
 {
     User = user;
 }
예제 #2
0
        public async Task<ActionResult> Create(RSUser user, string newpassword, string confirmpassword)
        {
            if (ModelState.IsValid)
            {
                db.Users.Add(user);

                if (newpassword == confirmpassword)
                {
                    user.DependencyInjection();
                    user.CreatePassword(newpassword);
                }
                else
                {
                    ViewBag.ShowMessage = true;
                    ViewBag.MessageColor = "red";
                    ViewBag.Message = Resources.Resources.PasswordsDontMatch;
                    return View(user);
                }
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }

            return View(user);
        }
예제 #3
0
 public RSPrincipal(RSUser user)
 {
     User = user;
 }
예제 #4
0
        public async Task<ActionResult> Edit(RSUser user, string newpassword, string confirmpassword)
        {
            if (ModelState.IsValid)
            {
                db.Entry(user).State = EntityState.Modified;
                if (!string.IsNullOrWhiteSpace(newpassword) & newpassword == confirmpassword)
                {
                    user.DependencyInjection();
                    user.CreatePassword(newpassword);
                }

                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }
            return View(user);
        }