/// <summary> /// 从中读取物理图信息 /// </summary> /// <returns> List</returns> public List <PhysicalDiagramInfo> GetPDInfo() { try { List <PhysicalDiagramInfo> PDList = new List <PhysicalDiagramInfo>(); IWorkbook hssfworkbook = InitHSSFWorkbook(); if (mTables == null) { mTables = GetTableInfo(); } PhysicalDiagramInfo pdInfo = new PhysicalDiagramInfo(); string pid = System.Guid.NewGuid().ToString(); pdInfo.Id = pid; pdInfo.Name = "所有数据"; PDList.Add(pdInfo); int iSheetNum = hssfworkbook.NumberOfSheets; for (int m = 0; m < iSheetNum; m++) { if (hssfworkbook.IsSheetHidden(m)) { continue; } PhysicalDiagramInfo pd = new PhysicalDiagramInfo(); string pid1 = System.Guid.NewGuid().ToString(); pd.Id = pid1; pd.Name = hssfworkbook.GetSheetAt(m).SheetName.Trim(); pd.PhyParentId = pid; List <TableInfo> query = (from a in mTables where a.PDName == pd.Name select a).ToList <TableInfo>(); //杜冬军2014-10-11优化,标签页没有数据表则不显示 if (query != null && query.Count > 0) { PDList.Add(pd); foreach (TableInfo t in query) { pd = new PhysicalDiagramInfo(); pd.Id = System.Guid.NewGuid().ToString(); pd.Name = t.Code; pd.IfEnd = true; pd.PhyParentId = pid1; PDList.Add(pd); } } } return(PDList); } catch (Exception ex) { throw ex; } }
/// <summary> /// 从中XML读取物理图信息 /// </summary> /// <returns> List</returns> public List <PhysicalDiagramInfo> GetPDInfo() { try { XmlDocument xmlDoc = GetXmlDom(); XmlNamespaceManager xmlnsManager = GetXmlNamespace(); XmlNodeList xnPDs = xmlDoc.SelectNodes("//c:PhysicalDiagrams/o:PhysicalDiagram", xmlnsManager); XmlNodeList xnTables = null; List <PhysicalDiagramInfo> PDList = new List <PhysicalDiagramInfo>(); PhysicalDiagramInfo pdInfo = new PhysicalDiagramInfo(); string pid = System.Guid.NewGuid().ToString(); string pid1 = ""; pdInfo.Id = pid; pdInfo.Name = "所有数据"; PDList.Add(pdInfo); foreach (XmlNode xnPD in xnPDs) { XmlNode tempNode = xnPD.Clone(); pdInfo = new PhysicalDiagramInfo(); pid1 = tempNode.SelectSingleNode("//a:ObjectID", xmlnsManager).InnerText; pdInfo.Id = pid1; pdInfo.PhyParentId = pid; pdInfo.Name = tempNode.SelectSingleNode("//a:Name", xmlnsManager).InnerText; xnTables = tempNode.SelectNodes("//c:Symbols/o:TableSymbol/c:Object/o:Table", xmlnsManager); if (xnTables != null && xnTables.Count > 0) { PDList.Add(pdInfo); foreach (XmlNode node in xnTables) { pdInfo = new PhysicalDiagramInfo(); pdInfo.PhyParentId = pid1; pdInfo.IfEnd = true; XmlNode tempTableNode = xnPD.SelectSingleNode("//c:Tables/o:Table[@Id='" + node.Attributes["Ref"].Value + "']", xmlnsManager); if (tempTableNode != null) { tempTableNode = tempTableNode.Clone(); pdInfo.Name = tempTableNode.SelectSingleNode("//a:Code", xmlnsManager).InnerText; pdInfo.Id = tempTableNode.SelectSingleNode("//a:ObjectID", xmlnsManager).InnerText; PDList.Add(pdInfo); } } } } return(PDList); } catch (Exception ex) { throw ex; } }
/// <summary> /// 从中读取物理图信息 /// </summary> /// <returns> List</returns> public List<PhysicalDiagramInfo> GetPDInfo() { try { List<PhysicalDiagramInfo> PDList = new List<PhysicalDiagramInfo>(); IWorkbook hssfworkbook = InitHSSFWorkbook(); if (mTables == null) { mTables = GetTableInfo(); } PhysicalDiagramInfo pdInfo = new PhysicalDiagramInfo(); string pid = System.Guid.NewGuid().ToString(); pdInfo.Id = pid; pdInfo.Name = "所有数据"; PDList.Add(pdInfo); int iSheetNum=hssfworkbook.NumberOfSheets; for (int m = 0; m < iSheetNum; m++) { if (hssfworkbook.IsSheetHidden(m)) { continue; } PhysicalDiagramInfo pd = new PhysicalDiagramInfo(); string pid1 = System.Guid.NewGuid().ToString(); pd.Id = pid1; pd.Name = hssfworkbook.GetSheetAt(m).SheetName.Trim(); pd.PhyParentId = pid; PDList.Add(pd); List<TableInfo> query = (from a in mTables where a.PDName == pd.Name select a).ToList<TableInfo>(); foreach (TableInfo t in query) { pd = new PhysicalDiagramInfo(); pd.Id = System.Guid.NewGuid().ToString(); pd.Name = t.Code; pd.IfEnd = true; pd.PhyParentId = pid1; PDList.Add(pd); } } return PDList; } catch (Exception ex) { throw ex; } }
/// <summary> /// 从中XML读取物理图信息 /// </summary> /// <returns> List</returns> public List<PhysicalDiagramInfo> GetPDInfo() { try { XmlDocument xmlDoc = GetXmlDom(); XmlNamespaceManager xmlnsManager = GetXmlNamespace(); XmlNodeList xnPDs = xmlDoc.SelectNodes("//c:PhysicalDiagrams/o:PhysicalDiagram", xmlnsManager); XmlNodeList xnTables = null; List<PhysicalDiagramInfo> PDList = new List<PhysicalDiagramInfo>(); PhysicalDiagramInfo pdInfo = new PhysicalDiagramInfo(); string pid = System.Guid.NewGuid().ToString(); string pid1 = ""; pdInfo.Id = pid; pdInfo.Name = "所有数据"; PDList.Add(pdInfo); foreach (XmlNode xnPD in xnPDs) { XmlNode tempNode = xnPD.Clone(); pdInfo = new PhysicalDiagramInfo(); pid1 = tempNode.SelectSingleNode("//a:ObjectID", xmlnsManager).InnerText; pdInfo.Id = pid1; pdInfo.PhyParentId = pid; pdInfo.Name = tempNode.SelectSingleNode("//a:Name", xmlnsManager).InnerText; PDList.Add(pdInfo); xnTables = tempNode.SelectNodes("//c:Symbols/o:TableSymbol/c:Object/o:Table", xmlnsManager); if (xnTables != null && xnTables.Count > 0) { foreach (XmlNode node in xnTables) { pdInfo = new PhysicalDiagramInfo(); pdInfo.PhyParentId = pid1; pdInfo.IfEnd = true; XmlNode tempTableNode = xnPD.SelectSingleNode("//c:Tables/o:Table[@Id='" + node.Attributes["Ref"].Value + "']", xmlnsManager); if (tempTableNode != null) { tempTableNode = tempTableNode.Clone(); pdInfo.Name = tempTableNode.SelectSingleNode("//a:Code", xmlnsManager).InnerText; pdInfo.Id = tempTableNode.SelectSingleNode("//a:ObjectID", xmlnsManager).InnerText; PDList.Add(pdInfo); } } } } return PDList; } catch (Exception ex) { throw ex; } }
/// <summary> /// 从中XML读取物理图信息 /// </summary> /// <returns> List</returns> public List <PhysicalDiagramInfo> GetPDInfo() { try { List <PhysicalDiagramInfo> PDList = new List <PhysicalDiagramInfo>(); DocX doc = InitDocX(); if (mTables == null) { mTables = GetTableInfo(); } PhysicalDiagramInfo pdInfo = new PhysicalDiagramInfo(); string pid = System.Guid.NewGuid().ToString(); pdInfo.Id = pid; pdInfo.Name = "所有数据"; PDList.Add(pdInfo); PhysicalDiagramInfo pd = new PhysicalDiagramInfo(); string pid1 = System.Guid.NewGuid().ToString(); pd.Id = pid1; pd.Name = "数据表"; pd.PhyParentId = pid; //杜冬军2014-10-11优化,标签页没有数据表则不显示 if (mTables != null && mTables.Count > 0) { PDList.Add(pd); foreach (TableInfo t in mTables) { pd = new PhysicalDiagramInfo(); pd.Id = System.Guid.NewGuid().ToString(); pd.Name = t.Code; pd.IfEnd = true; pd.PhyParentId = pid1; PDList.Add(pd); } } return(PDList); } catch (Exception ex) { throw ex; } }
/// <summary> /// 从中XML读取物理图信息 /// </summary> /// <returns> List</returns> public List<PhysicalDiagramInfo> GetPDInfo() { try { List<PhysicalDiagramInfo> PDList = new List<PhysicalDiagramInfo>(); DocX doc = InitDocX(); if (mTables == null) { mTables = GetTableInfo(); } PhysicalDiagramInfo pdInfo = new PhysicalDiagramInfo(); string pid = System.Guid.NewGuid().ToString(); pdInfo.Id = pid; pdInfo.Name = "所有数据"; PDList.Add(pdInfo); PhysicalDiagramInfo pd = new PhysicalDiagramInfo(); string pid1 = System.Guid.NewGuid().ToString(); pd.Id = pid1; pd.Name = "数据表"; pd.PhyParentId = pid; PDList.Add(pd); foreach (TableInfo t in mTables) { pd = new PhysicalDiagramInfo(); pd.Id = System.Guid.NewGuid().ToString(); pd.Name = t.Code; pd.IfEnd = true; pd.PhyParentId = pid1; PDList.Add(pd); } return PDList; } catch (Exception ex) { throw ex; } }
/// <summary> /// 从中XML读取物理图信息 /// </summary> /// <returns> List</returns> public List <PhysicalDiagramInfo> GetPDInfo() { try { List <PhysicalDiagramInfo> PDList = new List <PhysicalDiagramInfo>(); XWPFDocument doc = InitXWPFDocument(); if (mTables == null) { mTables = GetTableInfo(); } PhysicalDiagramInfo pdInfo = new PhysicalDiagramInfo(); string pid = System.Guid.NewGuid().ToString(); pdInfo.Id = pid; pdInfo.Name = "所有数据"; PDList.Add(pdInfo); PhysicalDiagramInfo pd = new PhysicalDiagramInfo(); string pid1 = System.Guid.NewGuid().ToString(); pd.Id = pid1; pd.Name = "数据表"; pd.PhyParentId = pid; PDList.Add(pd); foreach (TableInfo t in mTables) { pd = new PhysicalDiagramInfo(); pd.Id = System.Guid.NewGuid().ToString(); pd.Name = t.Code; pd.IfEnd = true; pd.PhyParentId = pid1; PDList.Add(pd); } return(PDList); } catch (Exception ex) { throw ex; } }