| | |
| | | using Npgsql; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Data.Common; |
| | | using System.Linq; |
| | | using System.Reflection; |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取发布ID |
| | | /// </summary> |
| | | public static int GetPushlishId(string dirid, string type = "DOM") |
| | | { |
| | | string sql = string.Format("select b.id from lf.sys_publish b where b.type = '{0}' and b.dirid = '{1}' limit 1", type, dirid); |
| | | object obj = Tools.DBHelper.GetScalar(sql); |
| | | |
| | | return null == obj ? 0 : Convert.ToInt32(obj); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取已经发布的元数据ID |
| | | /// </summary> |
| | | public static List<int> GetPublishMetaId(int pubid) |
| | | { |
| | | string sql = string.Format("select metaid from lf.sys_meta_pub where pubid = {0}", pubid); |
| | | DataTable dt = Tools.DBHelper.GetDataTable(sql); |
| | | |
| | | List<int> list = new List<int>(); |
| | | if (null == dt || 0 == dt.Rows.Count) return list; |
| | | |
| | | for (int i = 0, c = dt.Rows.Count; i < c; i++) |
| | | { |
| | | object obj = dt.Rows[i][0]; |
| | | if (null != obj) |
| | | { |
| | | int id = 0; |
| | | if (int.TryParse(obj.ToString(), out id)) |
| | | { |
| | | list.Add(id); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新发布数据的坐标 |
| | | /// </summary> |
| | | public static int UpdatePublishCoord(int pid, string json) |
| | | { |
| | | string sql = string.Format("update lf.sys_publish set json = '{0}' where id = {1}", json, pid); |
| | | |
| | | return Tools.DBHelper.ExecuteNonQuery(sql); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 插入元数据-数据发布表记录 |
| | | /// </summary> |
| | | public static int InsertMetaPub(int metaid, int pubid, int userId) |