Ejemplo n.º 1
0
        public ActionResult UserDelete(long id)
        {
            UserSvr svr = new UserSvr();

            svr.Delete(id);
            return(RedirectToAction("UserSys"));
        }
Ejemplo n.º 2
0
 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"));
     }
 }