| | |
| | | |
| | | 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"); |
| | |
| | | private JsonPageResult LoadGwClientPageList(PageContext<Model.SysUser> context) |
| | | { |
| | | string ClientID = context.GetString("ClientID"); |
| | | string Company = context.GetString("Company"); |
| | | string ClientName = context.GetString("ClientName"); |
| | | string Telephone = context.GetString("Telephone"); |
| | | string Salesman = context.GetString("Salesman"); |
| | | string ProductId = context.GetString("ProductId"); |
| | | int pageIndex = context.GetInt("pageIndex", 1); |
| | | |
| | | string Agent = context.GetString("Agent"); |
| | |
| | | string str = ""; |
| | | using (GwClientDao dao = new GwClientDao()) |
| | | { |
| | | var list = dao.LoadInfoList(out recordCount, pageIndex, pageSize, ClientID, ClientName, Telephone, Agent); |
| | | var list = dao.LoadInfoList(out recordCount, pageIndex, pageSize, ClientID, ClientName, Telephone, Agent, Company, Salesman, ProductId); |
| | | |
| | | if (list != null && list.Count > 0) |
| | | { |
| | |
| | | } |
| | | //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.Salesman)? 0: int.Parse(item.Salesman) ) + "</td><td>" + Certification_StatusResult + "</td>"; |
| | | |
| | | |
| | | str += @"<td>"; |
| | | string loginStr = "http://" + serverIp + ":" + clientPort + "/Attachedlogin.aspx?action=Attachedlogin&account=" + item.Account + "&password=" + item.Password; |
| | |
| | | } |
| | | else |
| | | { |
| | | str += @"<tr><td colspan=""8"">暂无信息</td></tr>"; |
| | | str += @"<tr><td colspan=""9"">暂无信息</td></tr>"; |
| | | } |
| | | |
| | | } |
| | |
| | | string telephone = context.GetString("telephone"); |
| | | string remark = context.GetString("remark"); |
| | | string agent = context.GetString("agent"); |
| | | string salesman = context.GetString("salesman"); |
| | | string customerManager = context.GetString("customerManager"); |
| | | string supportStaff = context.GetString("supportStaff"); |
| | | string financialStaff = context.GetString("financialStaff"); |
| | | string chargeType = context.GetString("chargeType"); |
| | | string smsStatusReport = context.GetString("smsStatusReport"); |
| | | string mmsStatusReport = context.GetString("mmsStatusReport"); |
| | | string data = context.GetString("permissionData"); |
| | | if(data.Contains("1")) |
| | | { |
| | |
| | | throw new ArgumentException("联系人/联系电话,不能为空!"); |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(customerManager)) |
| | | { |
| | | throw new ArgumentException("归属客户经理不能为空,请选择!"); |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(salesman)) |
| | | { |
| | | throw new ArgumentException("归属业务员不能为空,请选择!"); |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(supportStaff)) |
| | | { |
| | | throw new ArgumentException("归属客服人员不能为空,请选择!"); |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(financialStaff)) |
| | | { |
| | | throw new ArgumentException("归属财务人员不能为空,请选择!"); |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(chargeType)) |
| | | { |
| | | throw new ArgumentException("计费方式不能为空,请选择!"); |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(smsStatusReport)) |
| | | { |
| | | throw new ArgumentException("短信是否支持显示状态报告不能为空,请选择!"); |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(mmsStatusReport)) |
| | | { |
| | | 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; |
| | | client.Telephone = telephone; |
| | | client.Agent = agent; |
| | | |
| | | client.CustomerManager = customerManager; |
| | | client.Salesman = salesman; |
| | | client.SupportStaff = supportStaff; |
| | | client.FinancialStaff = financialStaff; |
| | | client.ChargeType = string.IsNullOrEmpty(chargeType) ? 0 : int.Parse(chargeType); |
| | | client.SmsStatusReport = string.IsNullOrEmpty(smsStatusReport) ? 0 : int.Parse(smsStatusReport); |
| | | client.MmsStatusReport = string.IsNullOrEmpty(mmsStatusReport) ? 0 : int.Parse(mmsStatusReport); |
| | | client.PermissionData = permissionData; |
| | | |
| | | _Dao.Update(client); |
| | |
| | | string remark = context.GetString("remark"); |
| | | string agent = context.GetString("agent"); |
| | | string company = context.GetString("company"); |
| | | string salesman = context.GetString("salesman"); |
| | | string customerManager = context.GetString("customerManager"); |
| | | string supportStaff = context.GetString("supportStaff"); |
| | | string financialStaff = context.GetString("financialStaff"); |
| | | string chargeType = context.GetString("chargeType"); |
| | | string smsStatusReport = context.GetString("smsStatusReport"); |
| | | string mmsStatusReport = context.GetString("mmsStatusReport"); |
| | | string data = context.GetString("permissionData"); |
| | | if(data.Contains("1")) |
| | | { |
| | |
| | | throw new ArgumentException("客户密码不能为空,且必须为4-10位英文或数字字符组合!"); |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(clientName) || string.IsNullOrEmpty(telephone)) |
| | | { |
| | | throw new ArgumentException("联系人/联系电话,不能为空!"); |
| | | } |
| | | |
| | | //if (string.IsNullOrEmpty(clientName)) |
| | | //{ |
| | | // throw new ArgumentException("客户名称不能为空!"); |
| | |
| | | if (_Dao.IsIDExists(clientID)) |
| | | { |
| | | throw new ArgumentException("客户账号已经存在!"); |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(customerManager)) |
| | | { |
| | | throw new ArgumentException("归属客户经理不能为空,请选择!"); |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(salesman)) |
| | | { |
| | | throw new ArgumentException("归属业务员不能为空,请选择!"); |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(supportStaff)) |
| | | { |
| | | throw new ArgumentException("归属客服人员不能为空,请选择!"); |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(financialStaff)) |
| | | { |
| | | throw new ArgumentException("归属财务人员不能为空,请选择!"); |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(chargeType)) |
| | | { |
| | | throw new ArgumentException("计费方式不能为空,请选择!"); |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(smsStatusReport)) |
| | | { |
| | | throw new ArgumentException("短信是否支持显示状态报告不能为空,请选择!"); |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(mmsStatusReport)) |
| | | { |
| | | throw new ArgumentException("彩信是否支持显示状态报告不能为空,请选择!"); |
| | | } |
| | | |
| | | HttpFileCollection _file = HttpContext.Current.Request.Files; |
| | |
| | | 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; |
| | |
| | | client.ParentId = context.OperatorID; |
| | | client.Certification_Status = 1; |
| | | client.Company = company; |
| | | client.CustomerManager = customerManager; |
| | | client.Salesman = salesman; |
| | | client.SupportStaff = supportStaff; |
| | | client.FinancialStaff = financialStaff; |
| | | client.ChargeType = string.IsNullOrEmpty(chargeType) ? 0 : int.Parse(chargeType); |
| | | client.SmsStatusReport = string.IsNullOrEmpty(smsStatusReport) ? 0 : int.Parse(smsStatusReport); |
| | | client.MmsStatusReport = string.IsNullOrEmpty(mmsStatusReport) ? 0 : int.Parse(mmsStatusReport); |
| | | |
| | | _Dao.Add(client);//插入数据库。创建账户 |
| | | |
| | | //保存产品记录 |
| | |
| | | |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | |