Пример #1
0
 /// <summary>
 /// 修改用户
 /// </summary>
 /// <param name="userName"></param>
 /// <param name="userPwdOld"></param>
 /// <param name="userPwdNew"></param>
 public void EditUser(string userName, string userPwdOld, string userPwdNew, out string errorMsg)
 {
     errorMsg = string.Empty;
     try
     {
         userPwdOld = EncryUserPwd.EncryPwd(userPwdOld);
         userPwdNew = EncryUserPwd.EncryPwd(userPwdNew);
         SqlModelHelp.EditUserPwd(userName, userPwdOld, userPwdNew, out errorMsg);
     }
     catch (Exception ex)
     {
         errorMsg = ex.ToString();
     }
 }
Пример #2
0
 /// <summary>
 /// 添加用户
 /// </summary>
 /// <param name="userName"></param>
 /// <param name="userPwd"></param>
 /// <param name="userRole"></param>
 /// <param name="errorMsg"></param>
 public void AddUser(string userName, string userPwd, string userRole, out string errorMsg)
 {
     errorMsg = string.Empty;
     try
     {
         string pwd = EncryUserPwd.EncryPwd(userPwd);
         SqlModelHelp.AddUser(userName, pwd, userRole, out errorMsg);
         if (errorMsg == "")
         {
             errorMsg = "操作成功";
         }
     }
     catch (Exception ex)
     {
         errorMsg = ex.ToString();
     }
 }