| | |
| | | { |
| | | |
| | | protected List<SysUser> SysUserList; |
| | | protected List<GwProduct> GwProductList; |
| | | |
| | | protected void Page_Load(object sender, EventArgs e) |
| | | { |
| | |
| | | this.SysUserList = userDao.LoadInfoList(out recordCount, int1, int2); |
| | | |
| | | } |
| | | |
| | | //获取启用的产品 |
| | | using (GwProductDao gwProductDao = new GwProductDao()) |
| | | { |
| | | GwProduct bean = new GwProduct(); |
| | | bean.Classes = 1; |
| | | bean.IsEnable = -1; |
| | | this.GwProductList = gwProductDao.getAllList(bean); |
| | | } |
| | | } |
| | | |
| | | |
| | | //获取产品分类信息 |
| | | public string SysUserOptions(int userId) |
| | | //归属业务员 |
| | | public string salesmanOptions(int userId) |
| | | { |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | if (this.SysUserList.Count == 0) |
| | | return "<option value=''>无</option>"; |
| | | stringBuilder.AppendFormat("<option value=\"{0}\" >{1}</option>", (object)0, (object)"无"); |
| | | stringBuilder.AppendFormat("<option value=\"{0}\" >{1}</option>", (object)"", (object)"无"); |
| | | foreach (SysUser bean in this.SysUserList) |
| | | { |
| | | //停用的用户不再显示 |
| | |
| | | { |
| | | continue; |
| | | } |
| | | //过滤超级管理员 |
| | | if (bean.UserID == 1) |
| | | //过滤用户类型 1-管理员;2-业务员--全员;3-业务主管;4-业务总监;5-客服人员;6-财务人员;99-其他 |
| | | if (bean.UserType == 6 || bean.UserType == 99) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | return stringBuilder.ToString(); |
| | | } |
| | | |
| | | //归属客户经理 |
| | | public string customerManagerOptions(int userId) |
| | | { |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | if (this.SysUserList.Count == 0) |
| | | return "<option value=''>无</option>"; |
| | | stringBuilder.AppendFormat("<option value=\"{0}\" >{1}</option>", (object)"", (object)"无"); |
| | | foreach (SysUser bean in this.SysUserList) |
| | | { |
| | | //停用的用户不再显示 |
| | | if (bean.Status == 0) |
| | | { |
| | | continue; |
| | | } |
| | | //过滤用户类型 1-管理员;2-业务员--全员;3-业务主管;4-业务总监;5-客服人员;6-财务人员;99-其他 |
| | | if (bean.UserType == 2) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | if (userId == bean.UserID) |
| | | stringBuilder.AppendFormat("<option value=\"{0}\" selected>{0}-{1}</option>", (object)bean.UserID, (object)bean.UserName); |
| | | else |
| | | stringBuilder.AppendFormat("<option value=\"{0}\">{0}-{1}</option>", (object)bean.UserID, (object)bean.UserName); |
| | | } |
| | | return stringBuilder.ToString(); |
| | | } |
| | | |
| | | //归属客服人员 |
| | | public string supportStaffOptions(int userId) |
| | | { |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | if (this.SysUserList.Count == 0) |
| | | return "<option value=''>无</option>"; |
| | | stringBuilder.AppendFormat("<option value=\"{0}\" >{1}</option>", (object)"", (object)"无"); |
| | | foreach (SysUser bean in this.SysUserList) |
| | | { |
| | | //停用的用户不再显示 |
| | | if (bean.Status == 0) |
| | | { |
| | | continue; |
| | | } |
| | | //过滤用户类型 1-管理员;2-业务员--全员;3-业务主管;4-业务总监;5-客服人员;6-财务人员;99-其他 |
| | | if (bean.UserType != 1 && bean.UserType != 5 ) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | if (userId == bean.UserID) |
| | | stringBuilder.AppendFormat("<option value=\"{0}\" selected>{0}-{1}</option>", (object)bean.UserID, (object)bean.UserName); |
| | | else |
| | | stringBuilder.AppendFormat("<option value=\"{0}\">{0}-{1}</option>", (object)bean.UserID, (object)bean.UserName); |
| | | } |
| | | return stringBuilder.ToString(); |
| | | } |
| | | |
| | | //归属财务人员 |
| | | public string financialStaffOptions(int userId) |
| | | { |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | if (this.SysUserList.Count == 0) |
| | | return "<option value=''>无</option>"; |
| | | stringBuilder.AppendFormat("<option value=\"{0}\" >{1}</option>", (object)"", (object)"无"); |
| | | foreach (SysUser bean in this.SysUserList) |
| | | { |
| | | //停用的用户不再显示 |
| | | if (bean.Status == 0) |
| | | { |
| | | continue; |
| | | } |
| | | //过滤用户类型 1-管理员;2-业务员--全员;3-业务主管;4-业务总监;5-客服人员;6-财务人员;99-其他 |
| | | if (bean.UserType != 1 && bean.UserType != 6) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | if (userId == bean.UserID) |
| | | stringBuilder.AppendFormat("<option value=\"{0}\" selected>{0}-{1}</option>", (object)bean.UserID, (object)bean.UserName); |
| | | else |
| | | stringBuilder.AppendFormat("<option value=\"{0}\">{0}-{1}</option>", (object)bean.UserID, (object)bean.UserName); |
| | | } |
| | | return stringBuilder.ToString(); |
| | | } |
| | | |
| | | |
| | | //获取产品信息 |
| | | public string GetProductOptions(string productId) |
| | | { |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | if (this.GwProductList.Count == 0) |
| | | return "<option value='0'>无</option>"; |
| | | stringBuilder.AppendFormat("<option value=\"{0}\" >{1}</option>", (object)"", (object)"无"); |
| | | foreach (GwProduct bean in this.GwProductList) |
| | | { |
| | | //停用的产品分类不再显示 |
| | | if (bean.IsEnable == 0) |
| | | { |
| | | continue; |
| | | } |
| | | //过滤产品类别 |
| | | if (bean.Classes == 0) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | if (productId.Equals(bean.Id)) |
| | | stringBuilder.AppendFormat("<option value=\"{0}\" selected>{0}-{1}</option>", (object)bean.Id, (object)bean.Name); |
| | | else |
| | | stringBuilder.AppendFormat("<option value=\"{0}\">{0}-{1}</option>", (object)bean.Id, (object)bean.Name); |
| | | } |
| | | return stringBuilder.ToString(); |
| | | } |
| | | |
| | | |
| | | } |