| | |
| | | |
| | | public class GwClientHandler : PageHandler<Model.SysUser> |
| | | { |
| | | |
| | | private UserDao _SysUserDao = new UserDao(); |
| | | private List<SysUser> _SysUserList; |
| | | |
| | | public override JsonPageResult ProcessRequestInternal(PageContext<Model.SysUser> context) |
| | | { |
| | | string action = context.GetString("action"); |
| | |
| | | } |
| | | //edit:yangzh by 20220511 |
| | | //str += @"<tr ><td>" + item.ClientID + "</td><td>" + item.Company + "</td><td>" + item.ClientName + "</td><td>" + item.Telephone + "</td><td>" + item.Top_up_Amount_Total + "元</td><td>" + item.Agent + "</td><td>" + Certification_StatusResult + "</td>"; |
| | | str += @"<tr ><td>" + item.ClientID + "</td><td>" + item.Company + "</td><td>" + item.ClientName + "</td><td>" + item.Telephone + "</td><td>" + item.Balance/1000 + "元</td><td>" + item.Top_up_Amount_Total/1000 + "元</td><td>" + item.Agent + "</td><td>" + Certification_StatusResult + "</td>"; |
| | | //str += @"<tr ><td>" + item.ClientID + "</td><td>" + item.Company + "</td><td>" + item.ClientName + "</td><td>" + item.Telephone + "</td><td>" + item.Balance/1000 + "元</td><td>" + item.Top_up_Amount_Total/1000 + "元</td><td>" + item.Agent + "</td><td>" + Certification_StatusResult + "</td>"; |
| | | str += @"<tr ><td>" + item.ClientID + "</td><td>" + item.Company + "</td><td>" + item.ClientName + "</td><td>" + item.Telephone + "</td><td>" + item.Balance/1000 + "元</td><td>" + item.Top_up_Amount_Total/1000 + "元</td><td>" + SysUserName(string.IsNullOrEmpty(item.Agent)? 0: int.Parse(item.Agent) ) + "</td><td>" + Certification_StatusResult + "</td>"; |
| | | |
| | | |
| | | str += @"<td>"; |
| | | string loginStr = "http://" + serverIp + ":" + clientPort + "/Attachedlogin.aspx?action=Attachedlogin&account=" + item.Account + "&password=" + item.Password; |
| | |
| | | throw new ArgumentException("联系人/联系电话,不能为空!"); |
| | | } |
| | | |
| | | string savePassword = ""; |
| | | if (!string.IsNullOrEmpty(clientID)) |
| | | { |
| | | GwClient gwClient = this._Dao.Get(clientID); |
| | | savePassword = (gwClient.Password == password ? gwClient.Password : DataHelper.MD5Hex(password) ); |
| | | } |
| | | else |
| | | { |
| | | savePassword = DataHelper.MD5Hex(password); |
| | | } |
| | | |
| | | |
| | | var client = new Model.GwClient(); |
| | | |
| | | client.Id = id; |
| | | client.ClientID = clientID; |
| | | client.Company = company; |
| | | client.Password = password; |
| | | //client.Password = password; |
| | | client.Password = savePassword; |
| | | |
| | | client.ClientName = clientName; |
| | | client.Address = address; |
| | | client.Remark = remark; |
| | |
| | | if (string.IsNullOrEmpty(password) || !System.Text.RegularExpressions.Regex.IsMatch(password, @"[a-zA-Z0-9]{4,10}")) |
| | | { |
| | | throw new ArgumentException("客户密码不能为空,且必须为4-10位英文或数字字符组合!"); |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(clientName) || string.IsNullOrEmpty(telephone)) |
| | | { |
| | | throw new ArgumentException("联系人/联系电话,不能为空!"); |
| | | } |
| | | |
| | | //if (string.IsNullOrEmpty(clientName)) |
| | |
| | | return new JsonPageResult(false, "上传图片处理异常:" + ex.Message); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | throw new ArgumentException("文件格式错误,请确认是否为jpg|jpeg|gif|png。"); |
| | | } |
| | | } |
| | | |
| | | //密码加密 |
| | | password = DataHelper.MD5Hex(password); |
| | | |
| | | var client = new Model.GwClient(); |
| | | client.ClientID = clientID; |
| | |
| | | |
| | | return new JsonPageResult(true, "创建账户成功!"); |
| | | } |
| | | |
| | | |
| | | |
| | | //获取管理端账户列表 |
| | | private List<SysUser> SysUserList |
| | | { |
| | | get |
| | | { |
| | | if (this._SysUserList == null) |
| | | { |
| | | |
| | | using (UserDao sysUserDao = new UserDao()) |
| | | { |
| | | int recordCount = 0; |
| | | int int1 = 999999999; |
| | | int int2 = 1; |
| | | this._SysUserList = sysUserDao.LoadInfoList(out recordCount, int1, int2); |
| | | } |
| | | } |
| | | return this._SysUserList; |
| | | } |
| | | } |
| | | |
| | | //管理端账户名称 |
| | | private string SysUserName(int userId) |
| | | { |
| | | if (this.SysUserList == null) |
| | | return string.Empty; |
| | | SysUser sysUser = this._SysUserList.Find((Predicate<SysUser>)(bean => bean.UserID == userId)); |
| | | if (sysUser != null) |
| | | return string.Format("{0}-{1}", (object)sysUser.UserID, (object)sysUser.UserName); |
| | | return string.Empty; |
| | | } |
| | | } |
| | | |
| | | |