You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWeb/Handler/CompanyCodeName.ashx.cs

58 lines
1.5 KiB
C#

3 years ago
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
{
/// <summary>
/// CompanyCodeName 的摘要说明
/// </summary>
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;
}
}
}
}