Esempio n. 1
0
 public JsonResult Mange_Add(ManageUsersDto model)
 {
     var isExist = _manageUsersBll.IsExist(model.UName);
     if (isExist)
         return ReturnJson(false, JsonMsg.Error_Exist);
     var result = _manageUsersBll.Add(model);
     return ReturnJson(result > 0, JsonMsg.Error_Add);
 }
Esempio n. 2
0
 public JsonResult Mange_Edit(ManageUsersDto model)
 {
     var oldModel = _manageUsersBll.GetModel(model.ID);
     if (oldModel == null ||
         (oldModel.UName != model.UName && _manageUsersBll.IsExist(model.UName)))
         return ReturnJson(false, JsonMsg.Error_Exist);
     var result = _manageUsersBll.Update(model);
     return ReturnJson(result, JsonMsg.Error_Edit);
 }
Esempio n. 3
0
 public int Add(ManageUsersDto model)
 {
     var entity = Mapper.Map<ManageUsers>(model);
     entity.IsDel = false;
     entity.CreateTime = DateTime.Now;
     entity.LastLoginTime = DateTime.Now;
     entity.Password = entity.Password.Encrypt();
     return _manageUsersDal.Insert(entity);
 }
Esempio n. 4
0
 public JsonResult AddR(ManageUsersDto model)
 {
     var result = _manageUsersBll.Add(model);
     return Json(new JsonDto
     {
         Error = "添加失败",
         Result = result > 0
     });
 }
Esempio n. 5
0
 public bool Update(ManageUsersDto model)
 {
     var entity = Mapper.Map<ManageUsers>(model);
     var oldModel = GetModel(entity.ID);
     entity.CreateTime = oldModel.CreateTime;
     entity.LastLoginTime = oldModel.LastLoginTime;
     if (!string.IsNullOrEmpty(entity.Password))
         entity.Password = entity.Password.Encrypt();
     else
         entity.Password = oldModel.Password;
     return _manageUsersDal.Update(entity);
 }
Esempio n. 6
0
 public JsonResult Edit(ManageUsersDto model)
 {
     var result = _manageUsersBll.Update(model);
     return Json(new JsonDto
     {
         Error = "修改失败",
         Result = result
     });
 }