using System; using System.Collections.Generic; using System.Data; using System.Web; using BP.DA; using BP.En; using BP.Port; namespace CCFlow.App { /// /// Handler 的摘要说明 /// public class Handler : IHttpHandler { #region 基本属性. public HttpContext context = null; public string DoType { get { return context.Request.QueryString["DoType"]; } } public string Key { get { return context.Request.QueryString["Key"]; } } #endregion 基本属性. public void ProcessRequest(HttpContext c) { context = c; context.Response.ContentType = "text/plain"; string sql = ""; if (this.DoType.Equals("Emps") == true) { DataTable dt = DBAccess.RunSQLReturnTable("SELECT top 10 No,Name FROM Port_Emp WHERE No LIKE '" + this.Key + "%' "); string str = BP.Tools.Json.ToJson(dt); context.Response.Write(str); return; } if (this.DoType.Equals("EmpFull") == true) { DataTable dt = DBAccess.RunSQLReturnTable("SELECT * FROM Port_Emp WHERE No='" + this.Key + "' "); string str = BP.Tools.Json.ToJson(dt); context.Response.Write(str); return; } context.Response.Write("err@没有判断的标记:"+this.DoType); } public bool IsReusable { get { return false; } } } }