Beispiel #1
0
        // 列出查重方案信息
        // parameters:
        //      strOriginBiblioDbName  发起的书目库名
        public LibraryServerResult ListDupProjectInfos(
            string strOriginBiblioDbName,
            out DupProjectInfo[] results)
        {
            // string strError = "";
            results = null;

            LibraryServerResult result = new LibraryServerResult();

            XmlNodeList nodes = null;

            if (String.IsNullOrEmpty(strOriginBiblioDbName) == true)
            {
                // 所有<project>元素
                nodes = this.LibraryCfgDom.DocumentElement.SelectNodes("//dup/project");
            }
            else
            {
                // 所有包含指定数据库名的<project>元素
                nodes = this.LibraryCfgDom.DocumentElement.SelectNodes("//dup/project[./database[@name='" + strOriginBiblioDbName + "']]");
            }

            results = new DupProjectInfo[nodes.Count];
            for (int i = 0; i < results.Length; i++)
            {
                DupProjectInfo dpi = new DupProjectInfo();
                dpi.Name    = DomUtil.GetAttr(nodes[i], "name");
                dpi.Comment = DomUtil.GetAttr(nodes[i], "comment");

                results[i] = dpi;
            }

            result.Value = results.Length;
            return(result);

            /*
             * ERROR1:
             * result.Value = -1;
             * result.ErrorCode = ErrorCode.SystemError;
             * result.ErrorInfo = strError;
             * return result;
             * */
        }
Beispiel #2
0
        // 列出查重方案信息
        // parameters:
        //      strOriginBiblioDbName  发起的书目库名
        public LibraryServerResult ListDupProjectInfos(
            string strOriginBiblioDbName,
            out DupProjectInfo[] results)
        {
            // string strError = "";
            results = null;

            LibraryServerResult result = new LibraryServerResult();

            XmlNodeList nodes = null;

            if (String.IsNullOrEmpty(strOriginBiblioDbName) == true)
            {
                // 所有<project>元素
                nodes = this.LibraryCfgDom.DocumentElement.SelectNodes("//dup/project");
            }
            else
            {
                // 所有包含指定数据库名的<project>元素
                nodes = this.LibraryCfgDom.DocumentElement.SelectNodes("//dup/project[./database[@name='" + strOriginBiblioDbName + "']]");
            }

            results = new DupProjectInfo[nodes.Count];
            for (int i = 0; i < results.Length; i++)
            {
                DupProjectInfo dpi = new DupProjectInfo();
                dpi.Name = DomUtil.GetAttr(nodes[i], "name");
                dpi.Comment = DomUtil.GetAttr(nodes[i], "comment");

                results[i] = dpi;
            }

            result.Value = results.Length;
            return result;
            /*
        ERROR1:
            result.Value = -1;
            result.ErrorCode = ErrorCode.SystemError;
            result.ErrorInfo = strError;
            return result;
             * */
        }