|
using Common;
|
using Model;
|
using System;
|
using System.Web;
|
using System.Web.Profile;
|
using System.Web.SessionState;
|
using Dao;
|
using System.Collections.Generic;
|
using System.Text;
|
|
public partial class _GwClient : PageBase<SysUser>, IRequiresSessionState
|
{
|
|
protected List<SysUser> SysUserList;
|
protected List<GwProduct> GwProductList;
|
|
protected void Page_Load(object sender, EventArgs e)
|
{
|
//权限校验
|
this.CheckRight("301", FailedOperation.ErrorMsgOnly);
|
|
//获取启用的产品分类
|
using (UserDao userDao = new UserDao())
|
{
|
|
int recordCount = 0;
|
int int1 = 999999999;
|
int int2 = 1;
|
this.SysUserList = userDao.LoadInfoList(out recordCount, int1, int2);
|
|
}
|
|
//获取启用的产品
|
using (GwProductDao gwProductDao = new GwProductDao())
|
{
|
GwProduct bean = new GwProduct();
|
bean.Classes = 1;
|
bean.IsDefault = -1;
|
bean.IsEnable = -1;
|
this.GwProductList = gwProductDao.getAllList(bean);
|
}
|
}
|
|
|
//归属业务员
|
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)"", (object)"无");
|
foreach (SysUser bean in this.SysUserList)
|
{
|
//停用的用户不再显示
|
if (bean.Status == 0)
|
{
|
continue;
|
}
|
//过滤用户类型 1-管理员;2-业务员--全员;3-业务主管;4-业务总监;5-客服人员;6-财务人员;99-其他
|
if (bean.UserType == 6 || bean.UserType == 99)
|
{
|
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 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=''>无</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();
|
}
|
|
|
//获取个性产品信息
|
public string GetPersonalityProductOptions(string productId)
|
{
|
StringBuilder stringBuilder = new StringBuilder();
|
if (this.GwProductList.Count == 0)
|
return "<option value=''>无</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 (bean.IsDefault == 1)
|
{
|
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();
|
}
|
|
|
}
|