wzp
2023-03-02 adee7a71ba7ab1b63cab63381dfe1846437853d6
web/web/GwClient.aspx.cs
@@ -9,12 +9,13 @@
using System.Collections.Generic;
using System.Text;
using System.Configuration;
using System.Linq;
public partial class _GwClient : PageBase<SysUser>, IRequiresSessionState
{
    protected List<SysUser> SysUserList;
    protected List<GwProduct> GwProductList;
    protected List<GwProduct> GwProductList;
    string addressClasses = ConfigurationManager.AppSettings["addressClasses"];
@@ -44,6 +45,13 @@
            this.GwProductList = gwProductDao.getAllList(bean);
        }
    }
    public int IsEnable
    {
        get
        {
            return this.AppContext.GetInt("IsEnable");
        }
    }
    //归属业务员
@@ -60,8 +68,8 @@
            {
                continue;
            }
            //过滤用户类型 1-管理员;2-业务员--全员;3-业务主管;4-业务总监;5-客服人员;6-财务人员;99-其他
            if (bean.UserType == 6 || bean.UserType == 99)
            //过滤用户类型 1-管理员;2-业务员--全员;3-客户经理;4-客服人员;5-财务人员
            if (!checkStrForArrayStr(1, bean.UserType) && !checkStrForArrayStr(2, bean.UserType) )
            {
                continue;
            }
@@ -74,33 +82,33 @@
        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;
            }
    ////归属客户经理
    //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-财务人员
    //        if (!checkStrForArrayStr(1, bean.UserType) && !checkStrForArrayStr(3, bean.UserType))
    //        {
    //            continue;
    //        }
            if (userId == bean.UserID)
                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{1}</option>", (object)bean.UserID, (object)bean.UserName);
            else
                stringBuilder.AppendFormat("<option value=\"{0}\">{1}</option>", (object)bean.UserID, (object)bean.UserName);
        }
        return stringBuilder.ToString();
    }
    //        if (userId == bean.UserID)
    //            stringBuilder.AppendFormat("<option value=\"{0}\" selected>{1}</option>", (object)bean.UserID, (object)bean.UserName);
    //        else
    //            stringBuilder.AppendFormat("<option value=\"{0}\">{1}</option>", (object)bean.UserID, (object)bean.UserName);
    //    }
    //    return stringBuilder.ToString();
    //}
    //归属客服人员
    public string supportStaffOptions(int userId)
@@ -116,8 +124,8 @@
            {
                continue;
            }
            //过滤用户类型 1-管理员;2-业务员--全员;3-业务主管;4-业务总监;5-客服人员;6-财务人员;99-其他
            if (bean.UserType != 1 && bean.UserType != 5 )
            //过滤用户类型 1-管理员;2-业务员--全员;3-客户经理;4-客服人员;5-财务人员
            if (!checkStrForArrayStr(1, bean.UserType) && !checkStrForArrayStr(4, bean.UserType))
            {
                continue;
            }
@@ -130,33 +138,33 @@
        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;
            }
    ////归属财务人员
    //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-财务人员
    //        if (!checkStrForArrayStr(1, bean.UserType) && !checkStrForArrayStr(5, bean.UserType))
    //        {
    //            continue;
    //        }
            if (userId == bean.UserID)
                stringBuilder.AppendFormat("<option value=\"{0}\" selected>{1}</option>", (object)bean.UserID, (object)bean.UserName);
            else
                stringBuilder.AppendFormat("<option value=\"{0}\">{1}</option>", (object)bean.UserID, (object)bean.UserName);
        }
        return stringBuilder.ToString();
    }
    //        if (userId == bean.UserID)
    //            stringBuilder.AppendFormat("<option value=\"{0}\" selected>{1}</option>", (object)bean.UserID, (object)bean.UserName);
    //        else
    //            stringBuilder.AppendFormat("<option value=\"{0}\">{1}</option>", (object)bean.UserID, (object)bean.UserName);
    //    }
    //    return stringBuilder.ToString();
    //}
    //获取产品信息
@@ -221,5 +229,59 @@
        return stringBuilder.ToString();
    }
    //所有个性产品
    protected string ClientProductAll()
    {
        using (GwProductDao gwProductDao = new GwProductDao())
        {
            GwProduct gwProduct = new GwProduct();
            gwProduct.Classes = 1;  //0-产品分类;1-产品
            gwProduct.IsDefault = 0;    //默认值0。0-个性化;1-系统默认。
            gwProduct.IsEnable = 1;    //0-停用;1-启用;默认1
            List<GwProduct> list = gwProductDao.getAllList(gwProduct);
            StringBuilder stringBuilder = new StringBuilder();
            stringBuilder.Append("<table cellpadding='5'>");
            if(list.Count>0)
            {
                for (int i = 0; i < list.Count; i++)
                {
                    GwProduct bean = (GwProduct)list[i];
                    //行开始符
                    if (i%5 == 0)
                    {
                        stringBuilder.Append("<tr>");
                    }
                    //行单元格
                    stringBuilder.AppendFormat("<td><input  type=\"checkbox\" id=\"_ProductId\"  name=\"_ProductId\" value=\"{0}\" /><span  style='padding:5px;'>{1} </span>  \r\n         </td>", (object)bean.Id, (object)bean.Name);
                    //行结束符
                    if (i % 5 == 4 || i == (list.Count - 1))
                    {
                        stringBuilder.Append("</tr>");
                    }
                }
            }
            stringBuilder.Append("</table>");
            return stringBuilder.ToString();
        }
    }
    //检查数组格式字符串中是否包含某元素
    public static bool checkStrForArrayStr(object str, string arrayStr)
    {
        return stringToArray(arrayStr).Contains(str.ToString());
    }
    //字符串转数组
    public static object[] stringToArray(string str)
    {
        object[] array = str.Split(',');
        return array;
    }
}