⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getcontacter.ashx

📁 动易SiteFactory&#8482 网上商店系统1.0源代码
💻 ASHX
字号:
<%@ WebHandler Language="C#" Class="PowerEasy.Web.GetContacter" %>

using System;
using System.Text;
using System.Web;
using System.Collections;
using System.Collections.Generic;

using PowerEasy.Model.Crm;
using PowerEasy.Crm;

namespace PowerEasy.Web
{
    public class GetContacter : IHttpHandler
    {


        private string GetContacterHtml(int clientId, string cName, string cId)
        {
            Dictionary<int, string> contacterDictionary = Contacter.GetContacterListByClientId(clientId);

            //Dictionary<int, string> contacterDictionary = new Dictionary<int, string>();

            //contacterDictionary.Add(1, "aaa");
            //contacterDictionary.Add(2, "bbb");
            //contacterDictionary.Add(3, "ccc");
            //contacterDictionary.Add(clientId, "ddd");

            StringBuilder sb = new StringBuilder();

            sb.Append("<select name='" + cName + "' id='" + cId + "'>");

            foreach (KeyValuePair<int, string> element in contacterDictionary)
            {
                sb.Append("<option value='" + element.Key.ToString() + "'>" + element.Value + "</option>");
            }
            sb.Append("</select>");

            return sb.ToString();

        }


        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";

            int clientId = Int32.Parse(context.Request.Params["ClientId"]);
            string cName = context.Request.Params["CName"];
            string cId = context.Request.Params["CId"];

            context.Response.Write(GetContacterHtml(clientId, cName, cId));
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -