예제 #1
0
파일: ExportData.cs 프로젝트: ikvm/test
        public string genData()
        {
            StringBuilder builder = new StringBuilder(3000);

            builder.Append("<root>");
            for (int i = 0; i < this.xmlDocument_0.DocumentElement.ChildNodes.Count; i++)
            {
                XmlNode node = this.xmlDocument_0.DocumentElement.ChildNodes.Item(i);
                builder.Append("<" + node.Name + ">");
                XmlNode node3 = node.ChildNodes.Item(0).ChildNodes.Item(0).SelectSingleNode("export");
                if (node3 != null)
                {
                    string  dsName = null;
                    XmlNode node4  = node3.SelectSingleNode("dsn");
                    if (node4 != null)
                    {
                        dsName = node4.InnerText;
                    }
                    this.connectionConfig_0 = new ConnectionConfig(dsName);
                    XmlNode node2 = node3.SelectSingleNode("sql");
                    if (node2 != null)
                    {
                        string   strsql = node2.InnerText;
                        QuerySql sql    = new QuerySql(this.connectionConfig_0, this.xmlDocument_0, this.httpRequest_0, this.httpSessionState_0);
                        builder.Append(sql.dataset_fields1(strsql, 1, -1, node3.SelectSingleNode("fields"), true, node.ChildNodes.Item(0).ChildNodes.Item(1)));
                    }
                    builder.Append(node.ChildNodes.Item(0).OuterXml);
                    builder.Append("</" + node.Name + ">");
                }
            }
            builder.Append("</root>");
            return(builder.ToString());
        }
예제 #2
0
파일: CrossDomain.cs 프로젝트: ikvm/test
        public static string readDomainRes(ConnectionConfig connConfig, string strXml, HttpRequest req, HttpSessionState session)
        {
            XmlDocument xdoc = new XmlDocument();

            xdoc.LoadXml(Escape.unescape(strXml));
            string str  = "";
            string str2 = xdoc.DocumentElement.ChildNodes.Item(0).InnerText;
            string str3 = xdoc.DocumentElement.ChildNodes.Item(1).InnerText;
            string str4 = xdoc.DocumentElement.ChildNodes.Item(2).InnerText;

            if ((str2 == "表单") && (str4 == "sqlserver"))
            {
                str = new QuerySql(connConfig, xdoc, req, session).SqlToField("select designtext from FC_BILLZL where djsn='" + str3 + "'");
            }
            return(str);
        }
예제 #3
0
파일: ImportData.cs 프로젝트: ikvm/test
        public void sqlTrans()
        {
            QuerySql sql = new QuerySql(this.connectionConfig_0, null, this.httpRequest_0, this.httpSessionState_0);

            for (int i = 0; i < this.xmlDocument_0.DocumentElement.ChildNodes.Count; i++)
            {
                XmlNode node  = this.xmlDocument_0.DocumentElement.ChildNodes.Item(i);
                XmlNode node4 = node.ChildNodes.Item(node.ChildNodes.Count - 1).ChildNodes.Item(0).SelectSingleNode("import");
                if (node4 != null)
                {
                    XmlNode node3 = node4.SelectSingleNode("fields");
                    if (node3 != null)
                    {
                        int[]    numArray = new int[node3.ChildNodes.Count];
                        object[] objArray = new object[node3.ChildNodes.Count];
                        int      index    = 0;
                        index = 0;
                        while (index < node3.ChildNodes.Count)
                        {
                            string strsql = node3.ChildNodes.Item(index).ChildNodes.Item(1).InnerText;
                            if ((strsql != null) && (strsql.Length != 0))
                            {
                                numArray[index] = Convert.ToInt32(node3.ChildNodes.Item(index).ChildNodes.Item(0).InnerText);
                                objArray[index] = sql.sqlToHashtable(strsql);
                            }
                            index++;
                        }
                        for (index = 0; index < (node.ChildNodes.Count - 1); index++)
                        {
                            if (objArray[index] != null)
                            {
                                XmlNode   node2     = node.ChildNodes.Item(index);
                                string    str       = node2.ChildNodes.Item(numArray[index]).InnerText;
                                Hashtable hashtable = (Hashtable)objArray[index];
                                if (((str != null) && (str.Length > 0)) && hashtable.ContainsKey(str.Trim()))
                                {
                                    str = (string)hashtable[str.Trim()];
                                    node2.ChildNodes.Item(numArray[index]).InnerText = (str);
                                }
                            }
                        }
                    }
                }
            }
        }