function loadPathInfo
在car.js中
function loadPathInfo(carid, fnClass) { var qureydrive; if (jsonp) qureydrive = remote_http + "drive/qrGisSet.ashx"; else { qureydrive = "../drive/qrGisSet.ashx"; } var my_page = "loadpath" var url = qureydrive + "?page=" + my_page; url += "&station=" + encodeURIComponent(carid); ajaxLoadGenData(url, my_page, _loadPathInfo, fnClass); }
qrGisSet.ashx
public void ProcessRequest(HttpContext context) { string carid = HttpContext.Current.Request.Params["station"]; string page = HttpContext.Current.Request.Params["page"]; string callback = HttpContext.Current.Request.Params["callback"]; // string connectionSrting = System.Configuration.ConfigurationManager.ConnectionStrings["MyConnectionString"].ToString(); string connectionSrting = DBLogin.getConnectionStrings(95); string rt=""; try { if (page == "loadpath")//调度日志 { rt = _loadPathinfo(connectionSrting, carid); if(rt==null){ rt = "{success:false,message:'服务器loadpath错!'}"; } } else { rt = "{success:false,message:'服务器loadpath错!'}"; } } catch (Exception e) { rt = "{success:false,message:'上传失败,可能因为上传文件过大导致!'}"; }//catch
增加 string tableid = HttpContext.Current.Request.Params["tableid"];
选择不同的表
updateGisSet.ashx
同上
TrackStation 表
CREATE TABLE [dbo].[TrackStation]( [StationId] [nchar](20) NOT NULL, [Name] [nvarchar](50) NOT NULL, [StartTime] [datetime] NULL, [EndTime] [datetime] NULL, [Description] [nvarchar](4000) NULL, [curstatus] [int] NULL, [curposx] [real] NULL, [curposy] [real] NULL, [curpath] [varchar](max) NULL, [curtime] [datetime] NULL, [batchid] [int] NULL, CONSTRAINT [PK_TrackStation_1] PRIMARY KEY CLUSTERED ( [StationId] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
主页面
在主页中重设
function getDriver(level) { var qureydrive; if (jsonp) qureydrive = remote_http + "drive/qrGisSet.ashx"; else { qureydrive = "../drive/qrGisSet.ashx"; } return qureydrive; } function getUpdateDriver(level) { if (jsonp) return remote_http + "drive/updateGisSet.ashx"; else { return "../drive/updateGisSet.ashx"; } }