Ejemplo n.º 1
0
        /// <summary>
        /// 现状地物对象
        /// </summary>
        /// <param name="SourceXm"></param>
        /// <returns></returns>
        private XZDW ConversionXzdw(Gis_Xzdw SourceXm)
        {
            XZDW result = new XZDW();

            foreach (PropertyInfo pi in typeof(XZDW).GetProperties())
            {
                pi.SetValue(result, SourceXm.GetType().GetProperty(pi.Name.ToString()).GetValue(SourceXm, null), null);
            }
            return(result);
        }
Ejemplo n.º 2
0
        private Gis_Data <Gis_Dk> getGisdata(string strSql, string conStr, bool allData)
        {
            Gis_Data <Gis_Dk> dataList = null;
            OracleDbOperation oracleDb = new OracleDbOperation(conStr);
            DataTable         dt       = oracleDb.ExecuteDataTable(strSql);

            if (dt.Rows.Count == 1)
            {
                dataList = (Gis_Data <Gis_Dk>) new DataTableOperation().ConvertFromDataRowToEntity(dt.Rows[0], typeof(Gis_Data <Gis_Dk>));

                strSql = "select * from gis_dk where gisId = " + dataList.GisId;

                dt = oracleDb.ExecuteDataTable(strSql);

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    Gis_Dk dk = (Gis_Dk) new DataTableOperation().ConvertFromDataRowToEntity(dt.Rows[i], typeof(Gis_Dk));
                    dk.GeoID = i;

                    ////界址点
                    strSql = "select * from gis_jzd where gisid = '{0}' and dkid = '{1}' order by dkqh,xh ";
                    strSql = string.Format(strSql, dataList.GisId, dk.DkId);
                    DataTable dtJzd = oracleDb.ExecuteDataTable(strSql);

                    string   dkqh = string.Empty;
                    Gis_Jzqy jzqy = null;
                    for (int j = 0; j < dtJzd.Rows.Count; j++)
                    {
                        if ((dtJzd.Rows[j]["dkqh"].ToString() != dkqh && jzqy != null) || j == dtJzd.Rows.Count - 1)
                        {
                            dk.RingList.Add(jzqy);
                        }
                        if (dtJzd.Rows[j]["dkqh"].ToString() != dkqh)
                        {
                            jzqy       = new Gis_Jzqy();
                            jzqy.GeoID = int.Parse(dtJzd.Rows[j]["dkqh"].ToString());
                        }
                        Gis_Jzd jzd = (Gis_Jzd) new DataTableOperation().ConvertFromDataRowToEntity(dtJzd.Rows[j], typeof(Gis_Jzd));
                        jzd.GeoID = jzd.XH;
                        jzqy.PointList.Add(jzd);

                        dkqh = dtJzd.Rows[j]["dkqh"].ToString();
                    }
                    if (allData)
                    {
                        ////地类图斑
                        strSql = "select * from gis_dltb where gisId = {0} and dkId = '{1}'";
                        strSql = string.Format(strSql, dataList.GisId, dk.DkId);
                        DataTable dtDltb = oracleDb.ExecuteDataTable(strSql);
                        for (int j = 0; j < dtDltb.Rows.Count; j++)
                        {
                            Gis_Dltb dltb = (Gis_Dltb) new DataTableOperation().ConvertFromDataRowToEntity(dtDltb.Rows[j], typeof(Gis_Dltb));
                            dk.DLTBList.Add(dltb);
                        }

                        ////线状地物
                        strSql = "select * from gis_xzdw where gisId = {0} and dkId = '{1}'";
                        strSql = string.Format(strSql, dataList.GisId, dk.DkId);
                        DataTable dtXzdw = oracleDb.ExecuteDataTable(strSql);
                        for (int j = 0; j < dtXzdw.Rows.Count; j++)
                        {
                            Gis_Xzdw xzdw = (Gis_Xzdw) new DataTableOperation().ConvertFromDataRowToEntity(dtXzdw.Rows[j], typeof(Gis_Xzdw));
                            dk.XZDWList.Add(xzdw);
                        }
                    }
                    dataList.DkList.Add(dk);
                }
            }
            return(dataList);
        }