Esempio n. 1
0
        public static string saveRunInfo(ConnectionConfig connConfig, string strXml, HttpSessionState session)
        {
            XmlDocument xdoc = new XmlDocument();

            xdoc.LoadXml(Escape.unescape(strXml));
            string        str     = "";
            StringBuilder builder = new StringBuilder();

            builder.Append("insert into fcq_org_log (org_name,item_name,url,ip,start_date,end_date,mac,from_url,other,id,create_date) values ( ");
            for (int i = 0; i < 9; i++)
            {
                builder.Append("'" + xdoc.DocumentElement.ChildNodes.Item(i).InnerText + "',");
            }
            DBOperator @operator = null;
            IDbCommand myComm    = null;

            try
            {
                @operator = connConfig.getDBOperator();
                @operator.Open();
                myComm            = @operator.Connection.CreateCommand();
                myComm.Connection = (@operator.Connection);
                MaxNo no = new MaxNo(connConfig, xdoc, session);
                builder.Append("'" + no.getRecnum1("RUN", myComm) + "',");
                builder.Append("'" + Tools.getServerTime() + "')");
                string str3 = builder.ToString();
                myComm.CommandText = (str3);
                myComm.ExecuteNonQuery();
                myComm.Dispose();
                @operator.Close();
            }
            catch (Exception exception)
            {
                str = exception.Message;
            }
            finally
            {
                try
                {
                    @operator.Close();
                }
                catch (Exception)
                {
                }
            }
            return(str);
        }
Esempio n. 2
0
        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);
        }