using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Text; using System.Data.SqlClient; using System.Collections.Generic; using System.Xml; using DSWeb.Models; using DSWeb.EntityDA; using JsonHelper; namespace DSWeb.Handler { /// /// CompanyCodeName 的摘要说明 /// public class CompanyCodeName : IHttpHandler { public void ProcessRequest(HttpContext context) { string inquireStr = "and CODENAME='" + context.Request.Form["ce"].ToString().Trim() + "'"; CompanyDA companyDA = new CompanyDA(); DataSet ds = companyDA.GetCompanySQL(inquireStr); DataTable dt = new DataTable();//ds.Tables[0]; if (ds != null) { dt = ds.Tables[0]; } StringBuilder sb = new StringBuilder(); if (dt.Rows.Count == 0) { sb.Append("[{\"id\":\"\"}]"); } else { sb.Append(JsonClass.DataTable2Json(dt)); } context.Response.ContentType = "text/plain"; context.Response.Write(sb.ToString()); context.Response.End(); } public bool IsReusable { get { return false; } } } }