| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <%@ WebHandler Language="C#" Class="GetDataDictionary_WCF" %>
- using System.Web;
- using System.Web.SessionState;
- using System.Web.Configuration;
- using Newtonsoft.Json.Linq;
- using Curtain.DataAccess;
- using System.Data;
- using DK.XuWei.WebMes;
- /// <summary>
- /// 从WCF接口获取 数据字典
- /// </summary>
- public class GetDataDictionary_WCF : IHttpHandler, IReadOnlySessionState
- {
- public void ProcessRequest(HttpContext context)
- {
- using (IDataAccess conn = DataAccess.Create())
- {
- DataTable dt = null;
- dt = conn.ExecuteDatatable(@"
- SELECT distinct D.Remarks
- FROM TP_MST_DATADICTIONARY D
- WHERE VALUEFLAG = '1'
- AND D.DICTIONARYTYPE = @DICTIONARYTYPE@ ",
- new CDAParameter("DICTIONARYTYPE", "TPC019"));
- context.Response.Write(new JsonResult(dt).ToJson());
- }
- //context.Response.ContentType = "text/plain";
- //WCF wcf = new WCF();
- //wcf.Para = wcf.LoadParaBySession();
- //wcf.Para.Add(new JProperty("dicType", context.Request["type"]));
- //string jsonStr = wcf.Post("/DKService/PDAModuleService/GetDataDictionaryByType");
- //jsonStr = ("{'success':true,'message':'操作成功!','rows':" + jsonStr + "}").Replace("'","\"");
- //context.Response.Write(jsonStr);
- }
- public bool IsReusable
- {
- get
- {
- return false;
- }
- }
- }
|