lixiaojun
2025-03-31 b0a694ccba71736f9092f30e45be94689ce92416
Service/HStation.Service.PhartRelation.Core/04-dal/02-postgresql/01-relation/PhartDiagramRelation.cs
@@ -5,16 +5,16 @@
    /// <summary>
    /// 图表关联
    ///</summary> 
    public class PhartDiagramRelation :BaseDAL_Sorter<Entity.PhartDiagramRelation> ,IPhartDiagramRelation
    public class PhartDiagramRelation : BaseDAL_Sorter<Entity.PhartDiagramRelation>, IPhartDiagramRelation
    {
        /// <summary>
      ///
      /// </summary>
      public override ConnectionConfig ConnectionConfig
      {
         get { return PhartRelation.ConfigHelper.PostgreSqlConnectionConfig; }
      }
        {
            get { return PhartRelation.ConfigHelper.PostgreSqlConnectionConfig; }
        }
        /// <summary>
        /// 插入拓展
@@ -165,7 +165,7 @@
                }
            }
        }
        /// <summary>
        /// 更新 OtherName
        /// </summary>
@@ -259,8 +259,51 @@
        }
        //public override bool DeleteByID(long ID)
        //{
        //    using (var db = new SqlSugarClient(ConnectionConfig))
        //    {
        //        try
        //        {
        //            var entity = db.Queryable<Entity.PhartDiagramRelation>().Single(x => x.ID == ID);
        //            if (entity == null)
        //                return false;
        //            var list = db.Queryable<Entity.PhartDiagramRelation>().Where(x => x.DiagramID == entity.DiagramID);
        //            if (list != null && list.Count() > 1)
        //            {
        //                return base.DeleteByID(ID);
        //            }
        //            else
        //            {
        //                db.BeginTran();
        //                var bol = db.Deleteable<Entity.PhartDiagramRelation>().Where(x => x.DiagramID == entity.DiagramID).ExecuteCommandHasChange();
        //                if (!bol)
        //                {
        //                    db.RollbackTran();
        //                    return false;
        //                }
        //                bol = db.Deleteable<Yw.Entity.PhartDiagram>().Where(x => x.ID == entity.DiagramID).ExecuteCommandHasChange();
        //                if (!bol)
        //                {
        //                    db.RollbackTran();
        //                    return false;
        //                }
        //                bol = db.Deleteable<Yw.Entity.PhartGraph>().Where(x => x.DiagramID == entity.DiagramID).ExecuteCommandHasChange();
        //                db.CommitTran();
        //                return true;
        //            }
        //        }
        //        catch
        //        {
        //            db.RollbackTran();
        //            throw;
        //        }
        //    }
        //}
    }
}