Пример #1
0
 /// <summary>
 ///  新增用户信息
 /// </summary>
 /// <param name="user">The user.</param>
 /// Author  : Napoleon
 /// Created : 2015-01-19 10:43:24
 public int SaveAddUser(SystemUser user)
 {
     return _userDao.SaveAddUser(user);
 }
Пример #2
0
 /// <summary>
 ///  更新用户信息
 /// </summary>
 /// Author  : Napoleon
 /// Created : 2015-01-19 15:53:14
 public ActionResult UpdateUser(string id, string projectId, string userName, string realName, string mobilePhone, string isUse, string userAddress, decimal sort, string remark)
 {
     SystemUser user = new SystemUser();
     user.Id = id;
     user.UserName = userName;
     user.RealName = realName;
     user.MobilePhone = mobilePhone;
     user.IsUse = isUse;
     user.UserAddress = userAddress;
     user.Sort = sort;
     user.Remark = remark;
     user.Operator = PublicFields.UserCookie.ReadCookie<SystemUser>().UserName;
     user.ProjectId = projectId;
     int count = _userService.UpdateUser(user);
     string status = "failue", msg, json;
     switch (count)
     {
         case -1:
             msg = "更新失败,该账号已存在!";
             break;
         case 1:
             status = "success";
             msg = "更新成功!";
             break;
         default:
             msg = "更新失败!";
             break;
     }
     json = PublicFunc.ModelToJson(status, msg);
     return Content(json);
 }
Пример #3
0
 /// <summary>
 ///  更新用户信息
 /// </summary>
 /// <param name="user">The user.</param>
 /// Author  : Napoleon
 /// Created : 2015-01-19 16:24:22
 public int UpdateUser(SystemUser user)
 {
     return _userDao.UpdateUser(user);
 }
Пример #4
0
 /// <summary>
 ///  保存新增的用户信息
 /// </summary>
 /// Author  : Napoleon
 /// Created : 2015-01-19 10:46:59
 public ActionResult SaveAdd(string projectId, string userName, string realName, string mobilePhone, string isUse, string userAddress, decimal sort, string remark)
 {
     SystemUser user = new SystemUser();
     user.Id = CustomId.GetCustomId();
     user.UserName = userName;
     user.PassWords = PublicFields.DefaultPw.EncrypteRc2(PublicFields.Rc2Key);
     user.RealName = realName;
     user.MobilePhone = mobilePhone;
     user.IsUse = isUse;
     user.UserAddress = userAddress;
     user.Sort = sort;
     user.Remark = remark;
     user.Operator = PublicFields.UserCookie.ReadCookie<SystemUser>().UserName;
     user.ProjectId = projectId;
     int count = _userService.SaveAddUser(user);
     string status = "failue", msg, json;
     switch (count)
     {
         case -1:
             msg = "保存失败,该账号已存在!";
             break;
         case 1:
             status = "success";
             msg = "保存成功!";
             break;
         default:
             msg = "保存失败!";
             break;
     }
     json = PublicFunc.ModelToJson(status, msg);
     return Content(json);
 }