public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; ht = WebUtil.Request(context); DAO = IBatisUitls.GetDao(ht); var json = ""; //生成对应表的增删改查语句 var tcid = IsNull(ht["TCID"]); if (tcid != "") { crud = new BLL.SYS_SQLCore(tcid); //解析服务端的数据称前端需要的格式 var proxy = new BLL.ConfigProxy.ConfigProxy_V1(crud); var config = proxy.Proxy2Web(); var action = IsNull(ht["ACTION"]).ToLower(); action = action == "" ? "config" : action; //默认获取配置信息 switch (action) { case "config": json = JsonHelper.Encode(config); break; case "insert": json = Insert(context); break; case "delete": json = Delete(context); break; case "update": json = Update(context); break; case "select": json = Select(context); break; default: json = "请设置TCID值...."; break; } } context.Response.Write(json); }
/// <summary> /// 批量添加预警 /// </summary> /// <param name="dt"></param> /// <param name="ht"></param> /// <returns></returns> public override string DataHandler(IIBatisDAO DAO, System.Collections.Hashtable ht) { DataTable dt = null; dt = DAO.GetDataTable(ht["action"].ToString(), ht); foreach (DataRow row in dt.Rows) { if (row["daleln"] != null) { row["daleln"].ToString(); } if (row["dalelt"] != null) { } } return JsonHelper.Encode(dt); }