Пример #1
0
 public JsonResult Update(T_User model)
 {
     bool Success = false;
     string Message = "修改失败请联系管理员!";
     model.Password = EncryptionMD5.GetMd5Hash(model.Password);
     int result = iUser.Edit(model);
     if (result > 0)
     {
         Success = true;
         Message = "成功";
     }
     return Json(new { Success = Success, Message = Message }, JsonRequestBehavior.AllowGet);
 }
Пример #2
0
 public JsonResult Add(T_User model)
 {
     bool Success = false;
     string Message = "添加失败请联系管理员!";
     model.Password = EncryptionMD5.GetMd5Hash(model.Password);
     int State = iUser.Add(model);
     if ( State > 0 )
     {
         Success = true;
         Message = "成功";
     }
     else if ( (CRUDState) State == CRUDState.UniqueErro )
     {
         Message = "用户名已存在,不能重复添加!";
     }
     return Json(new { Success = Success, Message = Message }, JsonRequestBehavior.AllowGet);
 }