public ActionResult EditUser(UserProfile userprofile)
        {
            if (IsAdmin() != true)
            {
                return RedirectToAction("Index", "Dashboard");
            }

            try
            {
                if (ModelState.IsValid)
                {
                    _usrService.SaveUserProfil(userprofile);
                    return RedirectToAction("Index");
                }

                return RedirectToAction("UserList");
            }
            catch
            {
                return View();
            }
        }
Beispiel #2
0
 public void CreateUserProfil(UserProfile userprofile)
 {
     db.UserProfile.Add(userprofile);
     db.SaveChanges();
 }
Beispiel #3
0
 public void SaveUserProfil(UserProfile userprofile)
 {
     db.Entry(userprofile).State = EntityState.Modified;
     db.SaveChanges();
 }
        public ActionResult Settings(UserProfile userprofile)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    _usrService.SaveUserProfil(userprofile);
                }
                return RedirectToAction("Dashboard/Index");

            }
            catch
            {
                return View();
            }
            return View();
        }