Esempio n. 1
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                LoginAgentUser loginAgentUser = new LoginAgentUser(context, "Client");
                ClientBLL      bll            = new ClientBLL(context, loginAgentUser);
                AgentRoleBLL   agentRoleBLL   = new AgentRoleBLL(context, loginAgentUser);
                StaffBLL       staffBll       = new StaffBLL(context, loginAgentUser);
                if (!loginAgentUser.Pass)//权限验证
                {
                    return;
                }
                //获取用户登录的角色类型 0为 代理商 1 为员工
                string roleType = agentRoleBLL.GetRoleType(loginAgentUser.RoleIds);
                string agentId  = "";
                string siteId   = context.Request["siteId"];
                if (roleType == "0")
                {
                    agentId = loginAgentUser.UserId;
                }
                if (roleType != "0")
                {
                    siteId = staffBll.Get(loginAgentUser.UserId).siteId;
                }
                if (context.Request["action"] == "siteListLoad")
                {
                    bll.SiteCombobox(loginAgentUser.UserId, roleType);
                }
                //加载DataGrid
                if (context.Request["action"] == "gridLoad")
                {
                    int    page       = int.Parse(context.Request["page"]);
                    int    rows       = int.Parse(context.Request["rows"]);
                    string clientId   = context.Request["clientId"];
                    string cardId     = context.Request["cardId"];
                    string clientName = context.Request["clientName"];
                    bll.LoadGrid(page, rows, clientId, agentId, siteId, cardId, clientName);
                    return;
                }

                //加载信息
                if (context.Request["action"] == "load")
                {
                    string clientId = context.Request["clientId"];//客户编号
                    bll.Load(clientId);
                    return;
                }
            }
            catch (Exception e)
            {
                Message.error(context, e.Message);
            }
        }
Esempio n. 2
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                LoginUser loginUser = new LoginUser(context, "Client");
                ClientBLL bll       = new ClientBLL(context, loginUser);
                if (!loginUser.Pass)//权限验证
                {
                    return;
                }
                if (context.Request["action"] == "agentListLoad")
                {
                    bll.AgentCombobox();
                }
                if (context.Request["action"] == "siteListLoad")
                {
                    string agentId = context.Request["agentId"];
                    bll.SiteCombobox(agentId);
                }
                //加载DataGrid
                if (context.Request["action"] == "gridLoad")
                {
                    int    page       = int.Parse(context.Request["page"]);
                    int    rows       = int.Parse(context.Request["rows"]);
                    string clientId   = context.Request["clientId"];
                    string agentId    = context.Request["agentId"];
                    string siteId     = context.Request["siteId"];
                    string cardId     = context.Request["cardId"];
                    string clientName = context.Request["clientName"];
                    bll.LoadGrid(page, rows, clientId, agentId, siteId, cardId, clientName);
                    return;
                }

                //加载信息
                if (context.Request["action"] == "load")
                {
                    string clientId = context.Request["clientId"];//客户编号
                    bll.Load(clientId);
                    return;
                }
            }
            catch (Exception e)
            {
                Message.error(context, e.Message);
            }
        }
Esempio n. 3
0
 public void ProcessRequest(HttpContext context)
 {
     try
     {
         LoginUser loginUser = new LoginUser(context, "Client");
         ClientBLL bll       = new ClientBLL(context, loginUser);
         if (!loginUser.Pass)//权限验证
         {
             return;
         }
         if (context.Request["action"] == "agentListLoad")
         {
             Combobox com = new Combobox(context, loginUser);
             com.AgentCombobox();
         }
         //用户查找分类
         if (context.Request["action"] == "clientQueryListLoad")
         {
             Combobox com = new Combobox(context, loginUser);
             com.ClientQueryCombobox();
         }
         if (context.Request["action"] == "siteListLoad")
         {
             string   agentId = context.Request["agentId"];
             Combobox com     = new Combobox(context, loginUser);
             com.SiteByAgentCombobox(agentId);
         }
         //加载DataGrid
         if (context.Request["action"] == "gridLoad")
         {
             int    page            = int.Parse(context.Request["page"]);
             int    rows            = int.Parse(context.Request["rows"]);
             string agentId         = context.Request["agentId"];
             string siteId          = context.Request["siteId"];
             string clientQuery     = context.Request["clientQuery"];
             string clientQueryText = context.Request["clientQueryText"];
             string status          = context.Request["status"];
             string startDate       = context.Request["startDate"];
             string endDate         = context.Request["endDate"];
             bll.LoadGrid(page, rows, agentId, siteId, clientQuery, clientQueryText, status, startDate, endDate);
             return;
         }
         //获取账户余额积分总计
         if (context.Request["action"] == "totalBalanceAndPoints")
         {
             string agentId         = context.Request["agentId"];
             string siteId          = context.Request["siteId"];
             string clientQuery     = context.Request["clientQuery"];
             string clientQueryText = context.Request["clientQueryText"];
             string status          = context.Request["status"];
             string startDate       = context.Request["startDate"];
             string endDate         = context.Request["endDate"];
             var    totalBalance    = bll.GetTotalBalanceOrPoints(1, agentId, siteId, clientQuery, clientQueryText, status, startDate, endDate);
             var    totalPoints     = bll.GetTotalBalanceOrPoints(2, agentId, siteId, clientQuery, clientQueryText, status, startDate, endDate);
             context.Response.Write("{\"totalBalance\":" + totalBalance + ",\"totalPoints\":" + totalPoints + "}");
         }
         //加载信息
         if (context.Request["action"] == "load")
         {
             long clientId = long.Parse(context.Request["clientId"]);//客户编号
             bll.Load(clientId);
             return;
         }
     }
     catch (Exception e)
     {
         Message.error(context, e.Message);
     }
 }