using System; using System.Collections; using System.Collections.Generic; using System.Data; using System.Diagnostics; using System.IO; using System.Linq; using System.Net.Security; using System.Security.Cryptography.X509Certificates; using System.Text; using System.Web; using System.Web.Script.Serialization; using SuperMap.RealEstate.CoreFrameWork; using SuperMap.RealEstate.CoreFrameWork.Dictionary.Business; using SuperMap.RealEstate.FrameWork.Business; using SuperMap.RealEstate.Utility; using ServiceModel = SuperMap.RealEstate.ServiceModel; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using HZQR.Common; using Coop.Merchant.Handler.CommonInterface; namespace SuperMap.RealEstate.MainTenance.Handler { /// /// handler_ajax 的摘要说明 /// public class handler_ajax : IHttpHandler { public void ProcessRequest(HttpContext context) { DataTable _DataTable = null; string action_type = HttpContext.Current.Request.Form["action_type"]; string action_data = HttpContext.Current.Request.Form["action_data"]; string action_record = HttpContext.Current.Request.Form["action_record"]; string token = HttpContext.Current.Request.Form["token"]; string reString = string.Empty, StrSql = string.Empty; int pageSize = 10;//每页显示多少条 int pageIndex = 1;//页码 int count = 0; //总记录数 ServiceModel.Transaction _Transaction = new ServiceModel.Transaction(); if (string.IsNullOrEmpty(action_type)) { action_type = HttpContext.Current.Request.Params["action_type"]; action_data = HttpContext.Current.Request.Params["action_data"]; action_record = HttpContext.Current.Request.Params["action_record"]; token = HttpContext.Current.Request.Params["token"]; } //耗时监听 Stopwatch sw = new Stopwatch(); sw.Start(); try { switch (action_type) { //获取图库列表 case "GetPictureList": reString = BaseInformation.GetPictureList(_Transaction); break; default: break; } if (_Transaction.IsOpen) { _Transaction.AutoCommit(); } } catch (Exception ex) { _Transaction.Rollback(); SuperMap.RealEstate.Utility.ErrorLogHelper.Write(ex); } finally { _Transaction.Release(); //if (_Transaction.IsOpen) //{ _Transaction.Dispose(); //} } //if (action_type == "UpLoadEndaccount") //{ // SuperMap.RealEstate.Utility.ErrorLogHelper.Write(new Exception(reString)); //} sw.Stop(); HZQR.Common.LogUtil.WriteLog(null, action_type + "接口耗时:" + sw.Elapsed.TotalSeconds.ToString(), DateTime.Now.ToString("yyyyMMdd") + "_Ex"); context.Response.ContentType = "text/plain"; context.Response.Write(reString); context.Response.End(); } public bool IsReusable { get { return false; } } public static bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors) { return true; } } }