Exemple #1
0
 public RSPrincipal(RSUser user)
 {
     User = user;
 }
Exemple #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);
        }
Exemple #3
0
 public RSPrincipal(RSUser user)
 {
     User = user;
 }
Exemple #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);
        }