Ejemplo n.º 1
0
        public ActionResult Edits([Bind(Include = "UserID,StaffID,StaffName,LastName,Email,Password,ConfirmPassword")] Models.UserAccountModel user)
        {
            var dept = new CYBInfracstructure.DataStructure.Entities.UserAccount

            {
                UserID = user.UserID,

                StaffID         = user.StaffID,
                StaffName       = user.StaffName,
                Email           = user.Email,
                Password        = user.Password,
                ConfirmPassword = user.ConfirmPassword
            };

            //if (TryUpdateModel(dept))
            //{
            //    UserManager.Edit(dept);
            //    UserManager.SaveChanges();
            //    TempData["Success"] = "Edited Successfully!";
            //    return RedirectToAction("Index");
            //}
            UserManager.Edit(dept);
            UserManager.SaveChanges();
            TempData["Success"] = "Edited Successfully!";
            return(RedirectToAction("Index"));

            return(View());
        }
Ejemplo n.º 2
0
        public ActionResult Edits(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CYBInfracstructure.DataStructure.Entities.UserAccount host = UserManager.Find(x => x.UserID == id).FirstOrDefault();
            //ViewBag.role = _roleManager.GetAll();

            if (host == null)
            {
                return(HttpNotFound());
            }
            return(View(host));
        }