public ActionResult UserDelete(long id) { UserSvr svr = new UserSvr(); svr.Delete(id); return(RedirectToAction("UserSys")); }
public ActionResult UserEdit(User model) { using (var db = new MbContext()) { var svr = new UserSvr(); if (model.UserId > 0) { var user = db.User.FirstOrDefault(x => x.UserId == model.UserId); model.PassWord = user.PassWord; model.Permission = user.Permission; user.CreateTime = user.CreateTime; svr.Update(model); } else { model.Permission = 0; model.PassWord = "******"; model.CreateTime = DateTime.Now; svr.Save(model); } return(RedirectToAction("UserSys")); } }