/// <summary> /// 根据列表类样式展现HTML 有分页 /// </summary> /// <returns></returns> public static StringWriter ShowListLabel81890(out Int32 reacordCount, params string[] strString) { StringWriter output = new StringWriter(); try { string LableName = ""; XsltArgumentList argsList = new XsltArgumentList(); argsList.AddExtensionObject("WP:BaseClass", new BaseClass()); LableName = strString[0].Split('=')[1]; string XMLPath = BaseClass.GetListLabel() + LableName + ".config"; string LableSqlString = XMLExplainer.GetXMLValue("root", "LabelSqlString", XMLPath); string LabelSqlCount = XMLExplainer.GetXMLValue("root", "LabelSqlCount", XMLPath); string XsltString = XMLExplainer.GetXMLValue("root", "LabelTemplate", XMLPath); for (int i = 1; i < strString.Length; i++) { string strObject = strString[i]; string[] strObjects = strObject.Split('='); LableSqlString = LableSqlString.Replace("@" + strObjects[0], strObjects[1]); LabelSqlCount = LabelSqlCount.Replace("@" + strObjects[0], strObjects[1]); argsList.AddParam(strObjects[0], "", strObjects[1]); } DataTable DT = XMLExplainer.GetXMLValues("attributes", XMLPath); for (int i = 0; i < DT.Rows.Count; i++) { LableSqlString = LableSqlString.Replace("@" + DT.Rows[i]["name"].ToString(), DT.Rows[i]["default"].ToString()); LabelSqlCount = LabelSqlCount.Replace("@" + DT.Rows[i]["name"].ToString(), DT.Rows[i]["default"].ToString()); string tempstring = (string)argsList.GetParam(DT.Rows[i]["name"].ToString(), ""); try { argsList.AddParam(DT.Rows[i]["name"].ToString(), "", DT.Rows[i]["default"].ToString()); } catch { continue; } } XDocument source = new XDocument(); XDocument newTree = new XDocument(); using (XmlWriter writer = newTree.CreateWriter()) { XslCompiledTransform xslt = new XslCompiledTransform(); xslt.Load(XmlReader.Create(new StringReader(XsltString))); DataTable DTT = PersistenceLayer.Query.ProcessSql(LableSqlString, Names.DBName); DataSet DS = new DataSet(); DS.Tables.Add(DTT); string XmlStr = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>"; XmlStr = XmlStr + DS.GetXml().ToString(); XmlDocument XmlDoc = new XmlDocument(); XmlDoc.LoadXml(XmlStr); XPathNavigator navgator = XmlDoc.CreateNavigator(); xslt.Transform(navgator, argsList, output); reacordCount = 0; if (!"".Equals(LabelSqlCount)) { DataTable DTCount = PersistenceLayer.Query.ProcessSql(LabelSqlCount, Names.DBName); reacordCount = Convert.ToInt32(DTCount.Rows[0][0].ToString()); } return(output); } } catch (Exception ex) { output.Write(ex.Message.ToString()); reacordCount = 0; return(output); } }