Example #1
0
        public override void Ashx_Load()
        {
            string actionType = "";
            string type       = "";
            string text       = "";

            CheckRequery.checkNotNull("actionType", "类型不能为空!", out actionType);
            string strSql = "";

            switch (actionType)
            {
            case "POI":
                CheckRequery.check("text", out text);
                strSql = string.Format("SELECT 经度,纬度,geom,st_asgeojson(geom) geometry from leakage.poi where 名称='{0}'", text);
                DataSet ContentList = APP.PGSQL_Helper.Query(strSql);
                Context.Response.Write(EasyUI_Pagination.ExportSuccess(ContentList.Tables[0], ContentList.Tables[0].Rows.Count));
                break;

            case "Road":
                CheckRequery.check("text", out text);
                strSql      = string.Format("SELECT 道路名称,geom,st_asgeojson(geom) geometry from leakage.dlzxx where 道路名称='{0}'", text);
                ContentList = APP.PGSQL_Helper.Query(strSql);
                Context.Response.Write(EasyUI_Pagination.ExportSuccess(ContentList.Tables[0], ContentList.Tables[0].Rows.Count));
                break;
            }
        }
Example #2
0
        public override void Ashx_Load()
        {
            //string strConn = "Server=localhost;Port=5432;User Id=postgres;Password=admin;Database=dmaluzhou;";
            //string strConn = "Server=192.168.0.237;Port=5432;User Id=postgres;Password=sa@123;Database=postgis;";
            string iddma = "all";

            CheckRequery.check("iddma", out iddma);
            //string strcmd = "select \"gid\",\"sid\",\"dn\",ST_AsGeoJson(\"pip\".\"geom\") as Geom,ST_Length(pip.geom) as len from dmapipenet.t_pipenet_list_pipe pip group by \"pipe\".\"dn\";";

            //分页必备设置
            int    pageIndex = 1, dataCount = 2000;
            string biaoming = "";

            //变量赋值
            CheckRequery.checkNotNull("pageIndex", "", out pageIndex);
            CheckRequery.checkNotNull("dataCount", "", out dataCount);

            CheckRequery.checkNotNull("biaoming", "", out biaoming);

            string sql = "select \"gid\",ST_AsGeoJson(\"pip\".\"geom\") as Geom,ST_Length(pip.geom) as len from " + biaoming + " pip limit " + dataCount + " offset " + (pageIndex * dataCount) + " ;";


            string strjsonbeg     = "{\"type\": \"FeatureCollection\",\"crs\":{\"type\":\"name\",\"properties\": {\"name\": \"EPSG:4326\"}},\"features\": [";
            string strjsonend     = "]}";
            string strjsonitembeg = "{\"type\":\"Feature\",\"geometry\": ";
            string strjsonitemmid = ",\"properties\": {\"name\": ";
            string strjsonitemend = "}},";

            string ErrInfo = string.Empty;
            //APP.PGSQL_Helper.ConnectString = strConn;


            DataTable dt = APP.PGSQL_Helper.SelectDataTable(sql, out ErrInfo);

            string geoitem = "";

            StringBuilder sb = new StringBuilder();

            sb.Append(strjsonbeg);

            if (string.IsNullOrEmpty(ErrInfo))
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    //geoitem = "";
                    string x = dt.Rows[i]["Geom"].ToString();
                    //string y = dt.Rows[i]["gid"].ToString();
                    sb.Append(strjsonitembeg + dt.Rows[i]["Geom"].ToString() + strjsonitemmid + '"' + biaoming + ":" + dt.Rows[i]["gid"].ToString() + '"' + strjsonitemend);
                }
                sb.Remove(sb.Length - 1, 1);
                sb.Append(strjsonend);
            }
            else
            {
                sb.Clear();
                sb.Append(strjsonbeg + strjsonend);
            }
            Context.Response.Write(sb.ToString());
        }
Example #3
0
        public override void Ashx_Load()
        {
            var sql = "";

            //变量赋值
            CheckRequery.checkNotNull("strSql", "", out sql);

            string  strSql      = sql;
            string  ErrInfo     = string.Empty;
            DataSet ContentList = APP.PGSQL_Helper.Query(strSql);

            Context.Response.Write(EasyUI_Pagination.ExportSuccess(ContentList.Tables[0], ContentList.Tables[0].Rows.Count));
        }
Example #4
0
        public override void Ashx_Load()
        {
            string actionType = "";
            string hdId       = "";

            CheckRequery.checkNotNull("actionType", "类型不能为空!", out actionType);
            switch (actionType)
            {
            case "getHiddenById":
                //获取隐患Id
                CheckRequery.check("hdId", out hdId);
                getHiddenById(hdId);
                break;
            }
        }
Example #5
0
        public override void Ashx_Load()
        {
            string actionType = "";
            string lpId       = "";

            CheckRequery.checkNotNull("actionType", "类型不能为空!", out actionType);
            switch (actionType)
            {
            case "getTaskStatus":
                //获取任务Id
                CheckRequery.check("lpId", out lpId);
                getTaskStatus(lpId);
                break;
            }
        }
Example #6
0
        public override void Ashx_Load()
        {
            string Oper; //操作类型

            CheckRequery.checkNotNull("actionType", "类型不能为空!", out Oper);


            switch (Oper)
            {
            case "ForSmID":
                ForSmID();

                break;

            case "POI":
                GetPOI();
                break;
            }
        }
Example #7
0
        public override void Ashx_Load()
        {
            string ErrInfo_ = string.Empty;
            string pageIndex = "1", dataCount = "10", dataSort = "EventID desc", PersonId;
            string retStr = "{\"rows\":" + "/*Rows*/" + ",\"total\":/*Total*/" + ",\"ErrCode\":0}";

            CheckRequery.check("PersonId", out PersonId);
            CheckRequery.checkNotNull("page", out pageIndex);
            CheckRequery.checkNotNull("rows", out dataCount);
            string    sql    = string.Format(@"Select a.EventID,a.UpTime,a.EventAddress,a.EventX,a.EventY,a.EventPictures,a.EventDesc,a.PersonId, b.PersonName,c.EventFromName,d.DeptName,ET1.EventTypeName as EventType,ET2.EventTypeName as EventContent,f.UrgencyName,g.HandlerLevelName,wo.OperName 
              From M_Event as a 
              left join L_Person as b ON a.PersonId = b.PersonId 
              left join M_EventFrom as c ON a.EventFromId = c.EventFromId 
              left join L_Department as d ON a.DeptId = d.DeptId 
              left join (select EventTypeId, EventTypeName from M_EventType where ParentTypeId = 0) ET1 on a.EventTypeId = ET1.EventTypeId 
              left join (select EventTypeId, EventTypeName from M_EventType where ParentTypeId <> 0) ET2 on a.EventTypeId2 = ET2.EventTypeId 
              left join M_Urgency as f ON a.UrgencyId = f.UrgencyId 
              left join M_HandlerLevel as g ON a.HandlerLevelId = g.HandlerLevelId 
              left join L_Person p on a.DispatchPerson = p.PersonId 
              left join M_WorkOrder mw on mw.EventID = a.EventID and mw.OrderStatus = 0 
              left join (select MAX(OperId) OperId, OrderId from M_WorkOrder_Oper_History Group by OrderId) h ON mw.OrderId = h.OrderId 
              left join M_WorkOrder_Oper as wo on h.OperId = wo.OperId 
              Where a.DeleteStatus = 0 and a.PersonId = {0}", PersonId);
            DataTable dt     = APP.SQLServer_Helper.SelectDataTable(sql, out ErrInfo_);
            string    sqlStr = APP.MakeSqlByPage(sql, dataSort, Convert.ToInt16(pageIndex), Convert.ToInt16(dataCount));
            DataSet   ds     = APP.SQLServer_Helper.Query(sqlStr);

            if (string.IsNullOrEmpty(ErrInfo_))
            {
                Newtonsoft.Json.Converters.IsoDateTimeConverter timeConverter = new Newtonsoft.Json.Converters.IsoDateTimeConverter();
                timeConverter.DateTimeFormat = "yyyy'-'MM'-'dd' 'HH':'mm':'ss";
                retStr = retStr.Replace("/*Total*/", ds.Tables[1].Rows[0][0].ToString()).Replace("/*Rows*/", JsonConvert.SerializeObject(ds.Tables[0], timeConverter));
                Context.Response.Write(retStr);
            }
            else
            {
                Context.Response.Write(EasyUI_Pagination.ExportErrMsg(ErrInfo_));
            }
        }
        public override void Ashx_Load()
        {
            string biaoming = "";

            CheckRequery.checkNotNull("biaoming", "", out biaoming);

            //string sql = "select count(0) from leakage.ptjsgx;";
            string sql = "select count(0) from " + biaoming;

            string    ErrInfo = string.Empty;
            DataTable dt      = new DataTable();


            dt = APP.PGSQL_Helper.SelectDataTable(sql.ToString(), out ErrInfo);

            if (string.IsNullOrEmpty(ErrInfo))
            {
                Context.Response.Write(EasyUI_Pagination.ExportSuccess(dt));
            }
            else
            {
                Context.Response.Write(EasyUI_Pagination.ExportErrMsg(ErrInfo));
            }
        }
Example #9
0
        public override void Ashx_Load()
        {
            Context.Response.ContentType = "text/plain";
            Context.Response.AddHeader("Access-Control-Allow-Origin", "*");
            Context.Response.AddHeader("Access-Control-Allow-Methods", "POST");
            Context.Response.AddHeader("Access-Control-Max-Ag", "1000");

            string actionType = "";
            //string retStr = "";//返回值
            string ErrInfo = string.Empty;
            string sqlStr  = "";

            CheckRequery.checkNotNull("actionType", "类型不能为空!", out actionType);
            string id             = "";
            string personName     = "";
            string personTelphone = "";
            string deptID         = "";
            string personPassword = "";
            string deptName       = "";
            string roleId         = "";

            CheckRequery.check("deptID", out deptID);
            CheckRequery.checkNotNull("id", "不能为空!", out id);
            CheckRequery.check("personName", out personName);
            CheckRequery.check("personTelphone", out personTelphone);
            CheckRequery.check("roleId", out roleId);

            switch (actionType)
            {
            //添加一个人员
            case "ADD":
                CheckRequery.check("personPassword", out personPassword);
                CheckRequery.check("deptName", out deptName);

                sqlStr = "INSERT INTO L_Person( PersonName, Telephone, DepartmentId, PersonId, PassWord,iRoleID,DeleteStatus )VALUES ( '" + personName + "','" + personTelphone + "','" + deptID + "','" + id + "','" + personPassword + "','" + roleId + "','0')";
                int m = APP.SQLServer_Helper.UpDate(sqlStr, out ErrInfo);
                if (!string.IsNullOrEmpty(ErrInfo))
                {
                    Context.Response.Write(WebExport.ExportErrMsg("添加失败,请检查数据!"));
                }
                if (m > 0)
                {
                    Context.Response.Write(WebExport.ExportSuccess("添加成功!"));
                }
                break;

            //删除一个人员
            case "DEL":
                //sqlStr = "delete from L_Person where PersonId = " + id + "";
                sqlStr = " UPDATE dbo.L_Person SET DeleteStatus='1' WHERE PersonId='" + id + "'";
                int d = APP.SQLServer_Helper.UpDate(sqlStr, out ErrInfo);
                if (!string.IsNullOrEmpty(ErrInfo))
                {
                    Context.Response.Write(WebExport.ExportErrMsg("删除失败,请检查数据!"));
                }

                if (d > 0)
                {
                    Context.Response.Write(WebExport.ExportSuccess("删除成功!"));
                }
                break;

            //更新人员
            case "MODIFY":

                sqlStr = "update L_Person set PersonName = '" + personName + "',Telephone='" + personTelphone + "',DepartmentId='" + deptID + "',iRoleID = '" + roleId + "'  where PersonId=" + id + "";
                int update1 = APP.SQLServer_Helper.UpDate(sqlStr, out ErrInfo);
                if (!string.IsNullOrEmpty(ErrInfo))
                {
                    Context.Response.Write(WebExport.ExportErrMsg("修改失败,请检查数据!"));
                }

                if (update1 > 0)
                {
                    Context.Response.Write(WebExport.ExportSuccess("修改成功!"));
                }
                break;

            default:
                break;
            }
            //Context.Response.Write(retStr);
        }
Example #10
0
        private void ForSmID()
        {
            string SmID, LayerName;

            //检查 and 数据赋值
            CheckRequery.checkNotNull("LayerName", "设施不能为空!", out LayerName);
            CheckRequery.checkNotNull("SmID", "SmID不能为空!", out SmID);

            LayerName = LayerName.Split('@')[0];
            string SQL = "";

            switch (LayerName)
            {
            case "普通给水管线":

                SQL = @"Select  SmID,
                                    管线编号,
                                    道路名称,
                                    管径,
                                    管长,
                                    管道材质,
                                    接口方式,
                                    起点点号,
                                    终止点号,
                                    敷设年代,
                                    竣工日期,
                                    施工单位,
                                    施工单位,
                                    起点埋深,
                                    终点埋深,
                                    平均埋深,
                                    起点高程,
                                    终点高程 From " + LayerName + " where  SmID=" + SmID;
                break;

            case "阀门":
                SQL = @"Select  SmID
                                    物探点号
                                    阀门编号
                                    口径,
                                    井盖形状,
                                    井盖尺寸,
                                    井盖材质,
                                    井壁结构,
                                    施工单位联系方式,
                                    施工单位,
                                    埋深,
                                    高程,
                                    开关状态,
                                    开关类型,
                                    材质,
                                    埋设方式,
                                    所在道路,
                                    道路名称,
                                    安装日期,
                                    竣工日期 From " + LayerName + " where  SmID=" + SmID;
                break;

            case "消防栓":
                SQL = @"Select  SmID,
                                    管径,
                                    管件口径,
                                    井盖形状,
                                    井盖尺寸,
                                    井盖材质,
                                    井壁结构,
                                    施工单位联系方式,
                                    施工单位,
                                    安装日期,
                                    竣工日期 From " + LayerName + " where  SmID=" + SmID;
                break;

            case "阀门井":
                SQL = @"Select  SmID,
                                    编号,
                                    井盖形状,
                                    井盖尺寸,
                                    井盖材质,
                                    井壁结构,
                                    施工单位,
                                    施工单位联系方式 From " + LayerName + " where  SmID=" + SmID;
                break;

            case "排气阀":
                SQL = @"Select  SmID,
                            编号,
                            施工单位,
                            道路名称 From " + LayerName + " where  SmID=" + SmID;
                break;

            case "直通井":
                SQL = @"Select  SmID,
                                    编号,
                                    井盖形状,
                                    井盖尺寸,
                                    井盖材质,
                                    井壁结构,
                                    施工单位,
                                    施工单位联系方式 From " + LayerName + " where  SmID=" + SmID;
                break;

            case "四通井":
                SQL = @"Select  SmID,
                                    编号,
                                    井盖形状,
                                    井盖尺寸,
                                    井盖材质,
                                    井壁结构,
                                    施工单位,
                                    施工单位联系方式 From " + LayerName + " where  SmID=" + SmID;
                break;

            default:
                SQL = @"Select  SmID,
                                    编号,
                                    井盖形状,
                                    井盖尺寸,
                                    井盖材质,
                                    井壁结构,
                                    施工单位,
                                    施工单位联系方式 From " + LayerName + " where  SmID=" + SmID;
                break;
            }

            DataTable DT;
            string    ErrInfo = "";
            bool      IsOk    = APP.SQLServer_BaseGisDB_Helper.GetDataTable(SQL, out DT, out ErrInfo);

            //执行完成返回
            if (IsOk)
            {
                Context.Response.Write(WebExport.ExportSuccess("查询成功!"));
                return;
            }
            else
            {
                Context.Response.Write(WebExport.ExportSuccess("查询失败!"));
                return;
            }
        }