| | |
| | | private static string selectLayerSql = "select id from lf.sys_layer where pid = @pid and en_name = @en_name"; |
| | | |
| | | /// <summary> |
| | | /// 是/否发布过 |
| | | /// 是/否发布过 * |
| | | /// </summary> |
| | | public static bool IsPublish(int metaid) |
| | | { |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 是/否发布过 |
| | | /// 是/否发布过 * |
| | | /// </summary> |
| | | public static bool IsPublish(string dirid, string type = "DOM") |
| | | { |
| | |
| | | int count = obj == null ? 0 : Convert.ToInt32(obj); |
| | | |
| | | return count > 0; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取发布ID |
| | | /// </summary> |
| | | public static int GetPushlishId(int metaid) |
| | | { |
| | | string sql = string.Format("select pubid from lf.sys_meta_pub where metaid={0} order by id desc limit 1", metaid); |
| | | object obj = Tools.DBHelper.GetScalar(sql); |
| | | |
| | | return null == obj ? 0 : Convert.ToInt32(obj); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <summary> |
| | | /// 更新发布数据 |
| | | /// </summary> |
| | | public static int UpdatePublish(int pubid, string name, int userId, string geom) |
| | | public static int UpdatePublish(int pubid, string name, int userId, string geom, string url = null) |
| | | { |
| | | string str = null == geom ? "" : string.Format(", geom={0}", geom); |
| | | string sql = string.Format("update lf.sys_publish set name=@name, update_user=@userId, create_time=now(), update_time=now(){0} where id=@id", str); |
| | | str += null == url ? "" : string.Format(", url='{0}'", url); |
| | | string sql = string.Format("update lf.sys_publish set name=@name, update_user=@userId, update_time=now(){0} where id=@id;update lf.sys_layer set cn_name=@name where pubid=@id;", str); |
| | | |
| | | DbParameter dp1 = new NpgsqlParameter("@name", name); |
| | | DbParameter dp2 = new NpgsqlParameter("@userId", userId); |