| | |
| | | using ExportMap.Models; |
| | | using ExportMap.db; |
| | | using ExportMap.Models; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Configuration; |
| | | using System.Data; |
| | | using System.Linq; |
| | | using System.Web; |
| | | |
| | |
| | | /// <returns>行数</returns> |
| | | public static int Release(XYZArgs args) |
| | | { |
| | | List<SysMeta> list = XYZUtils.selectMetas(args.ids, "and type in ('mpt', '3dml')"); |
| | | if (null == list || list.Count == 0) return 0; |
| | | |
| | | int maxId = GetMaxId(); |
| | | List<SpatialItem> items = SelectItems(maxId); |
| | | if (null == items || items.Count == 0) return 0; |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取最大ID值 |
| | | /// </summary> |
| | | public static int GetMaxId() |
| | | { |
| | | Object obj = SQLiteHelper.ExecuteScalar("select max(id) from SpatialItems"); |
| | | |
| | | return null == obj ? 0 : Convert.ToInt32(obj); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 查询SG数据项 |
| | | /// </summary> |
| | | /// <param name="maxId">最大ID值</param> |
| | | /// <returns>SG数据项</returns> |
| | | public static List<SpatialItem> SelectItems(int maxId) |
| | | { |
| | | string sql = string.Format("select id, Name, RelativePath, LayerName, DataSourceId, Description from SpatialItems where id > {0} order by id desc", maxId); |
| | | |
| | | DataTable dt = SQLiteHelper.GetDataTable(sql); |
| | | List<SpatialItem> list = ModelHandler.FillModel<SpatialItem>(dt); |
| | | |
| | | |
| | | return list; |
| | | } |
| | | } |
| | | } |