コード例 #1
0
        public string dataset_fields1()
        {
            try
            {
                CellNo.Send(this.httpRequest_0);
            }
            catch (Exception)
            {
            }
            string  strsql    = this.xmlDocument_0.DocumentElement.ChildNodes.Item(0).InnerText;
            int     iPageNo   = int.Parse(this.xmlDocument_0.DocumentElement.ChildNodes.Item(1).InnerText);
            int     iPageSize = int.Parse(this.xmlDocument_0.DocumentElement.ChildNodes.Item(2).InnerText);
            XmlNode oFields   = this.xmlDocument_0.DocumentElement.ChildNodes.Item(3);

            return(this.dataset_fields1(strsql, iPageNo, iPageSize, oFields, false, null));
        }
コード例 #2
0
        public XmlNode exportXMLnode()
        {
            XmlDocument   xmlDoc        = new XmlDocument();
            StringWriter  stringWriter  = new StringWriter();
            XmlTextWriter xmlTextWriter = new XmlTextWriter(stringWriter);
            XmlNode       rootNode      = null;

            if (isNodeComment)
            {
                rootNode = xmlDoc.CreateComment(comment);
                xmlDoc.AppendChild(rootNode);
                return(rootNode);
            }
            rootNode = xmlDoc.CreateElement(dimnType.ToString());
            xmlDoc.AppendChild(rootNode);

            #region IEC61850Server
            if (slaveType == SlaveTypes.IEC61850Server)
            {
                foreach (string attr in arrAttributes)
                {
                    XmlAttribute attrName = xmlDoc.CreateAttribute(attr);
                    attrName.Value = (string)this.GetType().GetProperty(attr).GetValue(this);
                    rootNode.Attributes.Append(attrName);
                }
                XmlAttribute attr2 = xmlDoc.CreateAttribute("ReportingIndex");
                attr2.Value = iec61850reportingindex.ToString();
                rootNode.Attributes.Append(attr2);

                XmlAttribute attrDataType = xmlDoc.CreateAttribute("DataType");
                attrDataType.Value = DataType.ToString();
                rootNode.Attributes.Append(attrDataType);

                XmlAttribute attrCommandType = xmlDoc.CreateAttribute("CommandType");
                attrCommandType.Value = CommandType.ToString();
                rootNode.Attributes.Append(attrCommandType);

                XmlAttribute attrDeadband = xmlDoc.CreateAttribute("BitPos");
                attrDeadband.Value = BitPos.ToString();
                rootNode.Attributes.Append(attrDeadband);

                XmlAttribute attrMultiplier = xmlDoc.CreateAttribute("Complement");
                attrMultiplier.Value = Complement.ToString();
                rootNode.Attributes.Append(attrMultiplier);

                XmlAttribute attrConstant = xmlDoc.CreateAttribute("Description");
                attrConstant.Value = Description.ToString();
                rootNode.Attributes.Append(attrConstant);
            }
            #endregion IEC61850Server

            #region SPORTSLAVE,IEC101SLAVE,IEC104,MODBUSSLAVE,UNKNOWN
            if ((slaveType == SlaveTypes.DNP3SLAVE) || (slaveType == SlaveTypes.SPORTSLAVE) || (slaveType == SlaveTypes.IEC101SLAVE) || (slaveType == SlaveTypes.IEC104) || (slaveType == SlaveTypes.MODBUSSLAVE) || (slaveType == SlaveTypes.UNKNOWN) || (slaveType == SlaveTypes.MQTTSLAVE) || (slaveType == SlaveTypes.SMSSLAVE))
            {
                foreach (string attr in arrAttributes)
                {
                    XmlAttribute attrName = xmlDoc.CreateAttribute(attr);
                    attrName.Value = (string)this.GetType().GetProperty(attr).GetValue(this);
                    rootNode.Attributes.Append(attrName);
                }
            }
            #endregion SPORTSLAVE,IEC101SLAVE,IEC104,MODBUSSLAVE,UNKNOWN

            #region GDisplaySlave
            if (slaveType == SlaveTypes.GRAPHICALDISPLAYSLAVE)
            {
                foreach (string attr in arrAttributes)
                {
                    XmlAttribute attrName = xmlDoc.CreateAttribute(attr);
                    attrName.Value = (string)this.GetType().GetProperty(attr).GetValue(this);
                    rootNode.Attributes.Append(attrName);
                }
                XmlAttribute attrCellNo = xmlDoc.CreateAttribute("CellNo");
                attrCellNo.Value = CellNo.ToString();
                rootNode.Attributes.Append(attrCellNo);

                XmlAttribute attrWidget = xmlDoc.CreateAttribute("Widget");
                attrWidget.Value = Widget.ToString();
                rootNode.Attributes.Append(attrWidget);

                //XmlAttribute attrUnit = xmlDoc.CreateAttribute("Unit");
                //attrUnit.Value = UnitID.ToString();
                //rootNode.Attributes.Append(attrUnit);

                XmlAttribute attrComplement = xmlDoc.CreateAttribute("Complement");
                attrComplement.Value = Complement.ToString();
                rootNode.Attributes.Append(attrComplement);

                XmlAttribute attrDescription = xmlDoc.CreateAttribute("Description");
                attrDescription.Value = Description.ToString();
                rootNode.Attributes.Append(attrDescription);
            }
            #endregion GDisplaySlave
            return(rootNode);
        }
コード例 #3
0
ファイル: CrossDomain.cs プロジェクト: ikvm/test
        public static string getRes(ConnectionConfig connConfig, XmlDocument xdoc, HttpRequest Request)
        {
            string     sendData  = xdoc.DocumentElement.OuterXml;
            string     str2      = Request[("userId")];
            string     str3      = "";
            string     str4      = "";
            DBOperator @operator = connConfig.getDBOperator();

            @operator.Open();
            IDbCommand myComm = @operator.Connection.CreateCommand();

            myComm.Connection = (@operator.Connection);
            string      strSql = "SELECT FCQ_ORG.vpath,FCQ_ORG.java_dotnet FROM FCQ_BUG_USER INNER JOIN FCQ_ORG ON FCQ_BUG_USER.org_name = FCQ_ORG.org_name WHERE FCQ_BUG_USER.item_name = FCQ_ORG.item_name and FCQ_BUG_USER.fcbug_user_id = '" + str2 + "'";
            IDataReader reader = @operator.exeSql(strSql);

            if (reader.Read())
            {
                str3 = reader.GetString(0);
                str4 = reader.GetString(1);
            }
            reader.Close();
            string str9 = "/ebsys/eformaspx/webbill.aspx";

            if ((str4 != "") && (str4 != ".net版"))
            {
                str9 = "/servlet/WebBill";
            }
            Logger.debug(str3 + str9 + "?key=readDomainRes xml=" + sendData);
            string str8 = CellNo.domainRun(str3 + str9 + "?key=readDomainRes", sendData);

            Logger.debug("content:" + str8);
            string str6 = "";

            if (str8.Length <= 0)
            {
                return("从数据库中没有取到资源内容!");
            }
            IDbTransaction transaction = null;

            transaction        = @operator.Connection.BeginTransaction();
            myComm.Transaction = (transaction);
            try
            {
                str6 = new MaxNo(connConfig, xdoc).getRecnum1("RES", myComm);
                Logger.debug("resId=" + str6);
                myComm.CommandText = ("insert into fcq_bug_res (res_id,res_text) values ('" + str6 + "','" + str8.Replace("'", "''") + "')");
                myComm.ExecuteNonQuery();
                transaction.Commit();
                myComm.Dispose();
                @operator.Close();
            }
            catch (Exception exception)
            {
                try
                {
                    transaction.Rollback();
                }
                catch (Exception)
                {
                }
                Logger.debug(exception.StackTrace);
                throw exception;
            }
            finally
            {
                try
                {
                    @operator.Close();
                }
                catch (Exception)
                {
                }
            }
            return(str6);
        }