public ActionResult Edit([Bind(Include = "RoleID,RoleName")] Roles roles)
 {
     if (ModelState.IsValid)
     {
         db.Entry(roles).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(roles));
 }
示例#2
0
 public ActionResult Edit([Bind(Include = "UserName,Password,Email,CreationTime,EmailConfirmed,IsDelete,DeleteTime,RoleID")] Accounts account)
 {
     if (ModelState.IsValid)
     {
         db.Entry(account).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(account));
 }
示例#3
0
        public ActionResult Edit([Bind(Include = "UserName,Password,ConfirmPassWord,Email,CreationTime,EmailConfirmed,IsDelete,DeleteTime,RoleID")] Accounts accounts)
        {
            string strMD5 = strPro.GetMD5(accounts.Password);

            if (accounts.Password == accounts.ConfirmPassWord)
            {
                accounts.Password        = strMD5;
                accounts.ConfirmPassWord = strMD5;
            }

            if (ModelState.IsValid)
            {
                db.Entry(accounts).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            return(View(accounts));
        }