Ejemplo n.º 1
0
        private bool SaveNewNotifyInfo(NotifyInfo _info)
        {
            using (OracleConnection cn = OracleHelper.OpenConnection())
            {
                OracleTransaction _txn = cn.BeginTransaction();

                try
                {
                    OracleCommand _cmd = new OracleCommand(SQL_SaveNewNotifyInfo, cn);
                    _cmd.Parameters.Add(":FBDW", SinoUserCtx.CurUser.CurrentPost.PostDWDM);
                    _cmd.Parameters.Add(":FBR", SinoUserCtx.CurUser.UserName);
                    _cmd.Parameters.Add(":LXDH", _info.TelNum);
                    _cmd.Parameters.Add(":DZYJ", _info.Email);
                    _cmd.Parameters.Add(":XXBT", _info.Title);
                    _cmd.Parameters.Add(":XXNR", _info.Context);
                    _cmd.ExecuteNonQuery();
                }
                catch (Exception e)
                {
                    string _errmsg = string.Format("删除ID={1}的通知通告信息时出错,错误信息为:{0}!",
                                                   e.Message, _info.ID);
                    OralceLogWriter.WriteSystemLog(_errmsg, "ERROR");
                    _txn.Rollback();
                    return(false);
                }

                _txn.Commit();
                cn.Close();
            }
            return(true);
        }
Ejemplo n.º 2
0
        public bool DeleteNotifyInfo(NotifyInfo CurrentInfo)
        {
            string _sql = " delete from XT_GGXX where ID=:ID AND FBDW=:FBDWDM ";

            using (OracleConnection cn = OracleHelper.OpenConnection())
            {
                OracleTransaction _txn = cn.BeginTransaction();

                try
                {
                    OracleCommand _cmd = new OracleCommand(_sql, cn);
                    _cmd.Parameters.Add(":ID", decimal.Parse(CurrentInfo.ID));
                    _cmd.Parameters.Add(":FBDWDM", SinoUserCtx.CurUser.CurrentPost.PostDWDM);
                    _cmd.ExecuteNonQuery();
                }
                catch (Exception e)
                {
                    string _errmsg = string.Format("删除ID={1}的通知通告信息时出错,错误信息为:{0}!",
                                                   e.Message, CurrentInfo.ID);
                    OralceLogWriter.WriteSystemLog(_errmsg, "ERROR");
                    _txn.Rollback();
                    return(false);
                }

                _txn.Commit();
                cn.Close();
            }
            return(true);
        }
Ejemplo n.º 3
0
        public static void WriteTaskLog(string _Rwid, int state, string _msg)
        {
            OracleCommand cmd;

            using (OracleConnection cn = OracleHelper.OpenConnection())
            {
                OracleTransaction txn = cn.BeginTransaction();
                try
                {
                    string _newmsg = (_msg.Length > 2000) ? _msg.Substring(0, 2000) : _msg;
                    cmd             = new OracleCommand();
                    cmd.Connection  = cn;
                    cmd.CommandType = CommandType.Text;
                    cmd.CommandText = "insert into gzrw_rz (rzid,rwid,rwmc,runtime,runflag,runresult) values (SEQ_YW.NEXTVAL,:RWID,'',sysdate,:STATE,:RUNRESULT)";
                    cmd.Parameters.Add(new OracleParameter(":RWID", decimal.Parse(_Rwid)));
                    cmd.Parameters.Add(new OracleParameter(":STATE", Convert.ToDecimal(state)));
                    cmd.Parameters.Add(new OracleParameter(":RUNRESULT", _newmsg));
                    cmd.ExecuteScalar();
                    txn.Commit();
                }
                catch (Exception e)
                {
                    string _log = string.Format("写入任务{1}日志表时出现错误:{0}", e.Message, _Rwid);
                    OralceLogWriter.WriteSystemLog(_log, "ERROR");
                    txn.Rollback();
                }


                cn.Close();
            }
        }
Ejemplo n.º 4
0
        private bool Save_ZHTJ_CS(string CSNAME, string CSDATA, string Des)
        {
            using (OracleConnection cn = OracleHelper.OpenConnection())
            {
                OracleTransaction _txn = cn.BeginTransaction();
                try
                {
                    OracleCommand _cmd = new OracleCommand(SQL_DelZHTJ_CS, cn);
                    _cmd.Parameters.Add(":CSNAME", CSNAME);
                    _cmd.ExecuteNonQuery();

                    OracleCommand _cmd2 = new OracleCommand(SQL_InsZHTJ_CS, cn);
                    _cmd2.Parameters.Add(":CSNAME", CSNAME);
                    _cmd2.Parameters.Add(":CSDATA", CSDATA);
                    _cmd2.Parameters.Add(":CSDESC", Des);
                    _cmd2.ExecuteNonQuery();
                    _txn.Commit();
                    return(true);
                }
                catch (Exception ex)
                {
                    string _err = string.Format("写入参数{0}时发生错误:{1}", CSNAME, ex.Message);
                    OralceLogWriter.WriteSystemLog(_err, "ERROR");
                    _txn.Rollback();
                    return(false);
                }
            }
        }
Ejemplo n.º 5
0
 /// <summary>
 /// 验证口令
 /// </summary>
 /// <param name="_name"></param>
 /// <param name="_pass"></param>
 /// <returns></returns>
 override public bool Check(string _name, string _pass, string CheckType)
 {
     //1.通过三统一接口验证密码
     try
     {
         if (CUPPAPassportConfig.DebugMode)
         {
             return(_name == _pass);
         }
         else
         {
             using (OguReaderClient _orc = new OguReaderClient())
             {
                 bool _ret = _orc.CheckPwd(_name, CheckType, _pass);
                 if (CUPPAPassportConfig.CUPPA_Check_WriteLog)
                 {
                     CUPPAPassportConfig.WriteCUPPALog(string.Format("采用三统一平台验证口令返回{0},! name={1}, CUPPA_Check_Type={2}, pass={3}",
                                                                     _ret, _name, CheckType, _pass));
                 }
                 return(true);
             }
         }
     }
     catch (Exception e1)
     {
         string _error = string.Format("采用三统一平台验证口令出错:{0}\n Name={1} Pass={2}", e1.Message, _name, _pass);
         OralceLogWriter.WriteSystemLog(_error, "ERROR");
         if (CUPPAPassportConfig.CUPPA_Check_WriteLog)
         {
             CUPPAPassportConfig.WriteCUPPALog(_error);
         }
         return(false);
     }
 }
Ejemplo n.º 6
0
        public bool SaveDataInfo(WC_DataInfo DataInfo)
        {
            using (OracleConnection cn = OracleHelper.OpenConnection())
            {
                OracleTransaction _txn = cn.BeginTransaction();
                try
                {
                    OracleCommand _cmd = new OracleCommand(SQL_DelDataInfo, cn);
                    _cmd.Parameters.Add(":GZDATE", DataInfo.GZ_Date.ToString("yyyyMMdd"));
                    _cmd.ExecuteNonQuery();

                    OracleCommand _cmd2 = new OracleCommand(SQL_InsDataInfo, cn);
                    _cmd2.Parameters.Add(":GZDATA", DataInfo.GZ_Date.ToString("yyyyMMdd"));
                    _cmd2.Parameters.Add(":GZ_META", DataInfo.Meta);
                    _cmd2.Parameters.Add(":GZ_YEAR", Convert.ToDecimal(DataInfo.GZ_Date.Year));
                    _cmd2.Parameters.Add(":GZ_MONTH", Convert.ToDecimal(DataInfo.GZ_Date.Month));
                    _cmd2.Parameters.Add(":GZ_DAY", Convert.ToDecimal(DataInfo.GZ_Date.Day));
                    _cmd2.Parameters.Add(":GZ_LX", DataInfo.IsTJSBR ? (decimal)1 : (decimal)0);
                    _cmd2.Parameters.Add(":GZ_SFGZR", DataInfo.IsWorkDay ? (decimal)0 : (decimal)1);
                    _cmd2.Parameters.Add(":GZ_FXSB", DataInfo.IsFXSBR ? (decimal)1 : (decimal)0);
                    _cmd2.ExecuteNonQuery();
                    _txn.Commit();
                    return(true);
                }
                catch (Exception ex)
                {
                    string _err = string.Format("写入GZRL日期:{0}时发生错误:{1}", DataInfo.GZ_Date, ex.Message);
                    OralceLogWriter.WriteSystemLog(_err, "ERROR");
                    _txn.Rollback();
                    return(false);
                }
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 取报表定义数据
        /// </summary>
        /// <param name="_reportName"></param>
        /// <param name="_sDate"></param>
        /// <param name="_eDate"></param>
        /// <param name="_dwdm"></param>
        /// <param name="_hmcData"></param>
        /// <returns></returns>
        private static bool GetReportDefine(string _reportName, DateTime _sDate, DateTime _eDate, string _dwdm, out DataSet _ds)
        {
            _ds = new DataSet();
            try
            {
                using (OracleConnection cn = OracleHelper.OpenConnection())
                {
                    //取表定义
                    DataTable     _dt  = new DataTable("REPORT_DEFINE");
                    OracleCommand _cmd = new OracleCommand();
                    _cmd.Connection  = cn;
                    _cmd.CommandText = "select * from TJ_ZDYBBMCB a where a.BBMC =:BBMC";
                    _cmd.CommandType = CommandType.Text;
                    _cmd.Parameters.Add(":BBMC", _reportName);
                    OracleDataAdapter _adapter = new OracleDataAdapter(_cmd);
                    _adapter.Fill(_dt);
                    _ds.Tables.Add(_dt);

                    //取列定义
                    DataTable _coldt = new DataTable("COL_DEFINE");
                    _cmd             = new OracleCommand();
                    _cmd.Connection  = cn;
                    _cmd.CommandText = "select * from TJ_ZDYBBDYB_DTLJL a where a.bbmc =:BBMC and TJDW = :TJDW and KSRQ = :KSRQ and JZRQ = :JZRQ order by LX";
                    _cmd.CommandType = CommandType.Text;
                    _cmd.Parameters.Add(":BBMC", _reportName);
                    _cmd.Parameters.Add(":TJDW", _dwdm);
                    _cmd.Parameters.Add(":KSRQ", _sDate);
                    _cmd.Parameters.Add(":JZRQ", _eDate);

                    _adapter = new OracleDataAdapter(_cmd);
                    _adapter.Fill(_coldt);
                    _ds.Tables.Add(_coldt);

                    //取行定义
                    DataTable _rowdt = new DataTable("ROW_DEFINE");
                    _cmd             = new OracleCommand();
                    _cmd.Connection  = cn;
                    _cmd.CommandText = "select * from TJ_ZDYBBDYB_DTHJL a where a.bbmc =:BBMC and TJDW = :TJDW and KSRQ = :KSRQ and JZRQ = :JZRQ order by HX";
                    _cmd.CommandType = CommandType.Text;
                    _cmd.Parameters.Add(":BBMC", _reportName);
                    _cmd.Parameters.Add(":TJDW", _dwdm);
                    _cmd.Parameters.Add(":KSRQ", _sDate);
                    _cmd.Parameters.Add(":JZRQ", _eDate);

                    _adapter = new OracleDataAdapter(_cmd);
                    _adapter.Fill(_rowdt);
                    _ds.Tables.Add(_rowdt);
                    cn.Close();
                }
                return(true);
            }
            catch (Exception e)
            {
                string _emsg = string.Format("生成统计报表(取报表定义数据)时发生错误!reportName={0} _dwdm={1} DATE={2} - {3} ", _reportName, _dwdm, _sDate, _eDate);
                _emsg += string.Format(" \n 错误信息:{0}", e.Message);
                OralceLogWriter.WriteSystemLog(_emsg, "ERROR");
                return(false);
            }
        }
Ejemplo n.º 8
0
        private byte[] GetRsReport_OLD(MD_ReportItem _reportItem, string Format)
        {
            ReportingService rs = new ReportingService();

            rs.Credentials = new System.Net.NetworkCredential(RsConfig.Name, RsConfig.Pass);
            //rs.Credentials =  new System.Net.NetworkCredential(Config.Rs_UserName, Config.Rs_UserPass);
            // Assign the URL of the Web service
            rs.Url = RsConfig.RsURL;

            string ReportPath = "/海关总署缉私局/" + _reportItem.ReportName.ReportName;
            // Prepare Render arguments
            string historyID  = null;
            string deviceInfo = null;

            ParameterValue[] param = new ParameterValue[3];
            param[0]       = new ParameterValue();
            param[0].Name  = "Report_Parameter_Year";
            param[0].Value = _reportItem.StartDate.Year.ToString();
            param[1]       = new ParameterValue();
            param[1].Name  = "Report_Parameter_month";
            param[1].Value = _reportItem.StartDate.Month.ToString("D2");
            param[2]       = new ParameterValue();
            param[2].Name  = "Report_Parameter_Dw";
            param[2].Value = _reportItem.ReportDWID;

            string showHide = null;

            DataSourceCredentials[] credentials = null;
            Byte[] results;
            string encoding;
            string mimeType;

            Warning[]        warnings = null;
            ParameterValue[] reportHistoryParameters = null;
            string[]         streamIDs = null;
            //Exectute the report and save it into a file.
            try
            {
                results = rs.Render(ReportPath, Format, historyID, deviceInfo, param,
                                    credentials, showHide, out encoding, out mimeType,
                                    out reportHistoryParameters, out warnings, out streamIDs);
                return(results);
            }
            catch (Exception e)
            {
                Exception e1 = e;


                string _eStr = string.Format(" 系统在生成报表时发出错误!\n Report Name:{0} \n Report Date:{1} \n Report Dw:{2} \n Report Error:{3}",
                                             _reportItem.ReportName, _reportItem.StartDate.Year.ToString() + _reportItem.StartDate.Month.ToString("D2"),
                                             string.Format("{0}[{1}]", _reportItem.ReportDWID, _reportItem.ReportDWName), e.Message);
                // Write an informational entry to the event log.
                OralceLogWriter.WriteSystemLog(_eStr, "ERROR");
                return(null);
            }
        }
Ejemplo n.º 9
0
        public static bool WriteErrorResultSetRunFlag(string _Rwid, DateTime _startTime, DateTime _nextTime, string ErrorMsg, int flag)
        {
            //清除执行状态,并写入执行错误结果,设置下次执行时间
            OracleCommand cmd;
            string        _newmsg = (ErrorMsg.Length > 2000) ? ErrorMsg.Substring(0, 2000) : ErrorMsg;

            using (OracleConnection cn = OracleHelper.OpenConnection())
            {
                OracleTransaction _txn = cn.BeginTransaction();
                try
                {
                    cmd             = new OracleCommand();
                    cmd.Connection  = cn;
                    cmd.CommandType = CommandType.Text;
                    cmd.CommandText = "Update GZRW SET NEXTTIME=:NEXTTIME,LASTTIME =:LASTTIME,RUNFLAG=9,RWZT=:FLAG,RUNRESULT=:MSG  where RWID=:RWID";
                    cmd.Parameters.Add(new OracleParameter(":NEXTTIME", _nextTime));
                    cmd.Parameters.Add(new OracleParameter(":LASTTIME", _startTime));
                    cmd.Parameters.Add(new OracleParameter(":FLAG", Convert.ToDecimal(flag)));
                    cmd.Parameters.Add(new OracleParameter(":MSG", "任务执行失败!"));
                    cmd.Parameters.Add(new OracleParameter(":RWID", decimal.Parse(_Rwid)));
                    cmd.ExecuteScalar();
                }
                catch (Exception e)
                {
                    string _log = string.Format("写入任务{1}结果时出现错误:{0}", e.Message, _Rwid);
                    OralceLogWriter.WriteSystemLog(_log, "ERROR");
                    _txn.Rollback();
                    return(false);
                }

                try
                {
                    cmd             = new OracleCommand();
                    cmd.Connection  = cn;
                    cmd.CommandType = CommandType.Text;
                    cmd.CommandText = "insert into gzrw_rz (rzid,rwid,rwmc,runtime,runflag,runresult) values (SEQ_YW.NEXTVAL,:RWID,'',sysdate,9,:RUNRESULT)";
                    cmd.Parameters.Add(new OracleParameter(":RWID", decimal.Parse(_Rwid)));
                    cmd.Parameters.Add(new OracleParameter(":RUNRESULT", _newmsg));
                    cmd.ExecuteScalar();
                }
                catch (Exception e)
                {
                    string _log = string.Format("写入任务{1}日志表时出现错误:{0}", e.Message, _Rwid);
                    OralceLogWriter.WriteSystemLog(_log, "ERROR");
                    _txn.Rollback();
                    return(false);
                }

                _txn.Commit();
                cn.Close();
            }
            return(true);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 将所有任务状态置为空闲
        /// </summary>
        public static void InitAllTaskState()
        {
            string _rwql = string.Format("update GZRW set RWZT = 0 where RWZT =1");

            try
            {
                OracleHelper.ExecuteNonQuery(OracleHelper.ConnectionStringProfile, CommandType.Text, _rwql);
            }
            catch (Exception ex)
            {
                string _log = string.Format("清除未执行完毕任务时出错:{0}", ex.Message);
                OralceLogWriter.WriteSystemLog(_log, "ERROR");
            }
        }
Ejemplo n.º 11
0
        public static bool WriteResultSetRunFlag(string _Rwid, DateTime _startTime, DateTime _nextTime, int flag)
        {
            //清除执行状态,并写入执行结果,设置下次执行时间
            OracleCommand cmd;

            using (OracleConnection cn = OracleHelper.OpenConnection())
            {
                try
                {
                    cmd             = new OracleCommand();
                    cmd.Connection  = cn;
                    cmd.CommandType = CommandType.Text;
                    cmd.CommandText = "Update GZRW SET NEXTTIME=:NEXTTIME,LASTTIME =:LASTTIME,RUNFLAG=0,RWZT=:RWZT,RUNRESULT=:MSG  where RWID=:RWID";
                    cmd.Parameters.Add(new OracleParameter(":NEXTTIME", _nextTime));
                    cmd.Parameters.Add(new OracleParameter(":LASTTIME", _startTime));
                    cmd.Parameters.Add(new OracleParameter(":RWZT", Convert.ToDecimal(flag)));
                    cmd.Parameters.Add(new OracleParameter(":MSG", "任务正常执行完毕!"));
                    cmd.Parameters.Add(new OracleParameter(":RWID", decimal.Parse(_Rwid)));
                    cmd.ExecuteScalar();
                }
                catch (Exception e)
                {
                    string _log = string.Format("写入任务{1}结果时出现错误:{0}", e.Message, _Rwid);
                    OralceLogWriter.WriteSystemLog(_log, "ERROR");
                    return(false);
                }

                try
                {
                    cmd             = new OracleCommand();
                    cmd.Connection  = cn;
                    cmd.CommandType = CommandType.Text;
                    cmd.CommandText = "insert into gzrw_rz (rzid,rwid,rwmc,runtime,runflag,runresult) values (SEQ_YW.NEXTVAL,:RWID,'',sysdate,0,:RUNRESULT)";
                    cmd.Parameters.Add(new OracleParameter(":RWID", decimal.Parse(_Rwid)));
                    cmd.Parameters.Add(new OracleParameter(":RUNRESULT", "任务正常执行完毕!"));
                    cmd.ExecuteScalar();
                }
                catch (Exception e)
                {
                    string _log = string.Format("写入任务{1}日志表时出现错误:{0}", e.Message, _Rwid);
                    OralceLogWriter.WriteSystemLog(_log, "ERROR");
                    return(false);
                }

                cn.Close();
            }
            return(true);
        }
Ejemplo n.º 12
0
        public void WriteClientUserLog(string Message, string LogType)
        {
            using (OracleConnection cn = OracleHelper.OpenConnection())
            {
                try
                {
                    string _ipaddr = WCFClientInfo.IPAddr;

                    OralceLogWriter.WriteUserLog(decimal.Parse(SinoUserCtx.CurUser.UserID), "客户端日志", Message, 1, _ipaddr, _ipaddr, ConfigFile.SystemID);
                }
                catch (Exception ex)
                {
                    OralceLogWriter.WriteSystemLog(string.Format("写入客户端日志失败!日志内容:{0} 类型:{1} 错误信息:{2}", Message, LogType, ex.Message), "ERROR");
                }
            }
        }
Ejemplo n.º 13
0
        public bool WriteLog(string _log, System.Diagnostics.EventLogEntryType _logType)
        {
            string _typeStr = "INFO";

            switch (_logType)
            {
            case System.Diagnostics.EventLogEntryType.Error:
                _typeStr = "ERROR";
                break;

            default:
                _typeStr = "INFO";
                break;
            }
            OralceLogWriter.WriteSystemLog(_log, _typeStr);
            return(true);
        }
Ejemplo n.º 14
0
 private static string GetUserGuidByJS(string _name)
 {
     using (OracleConnection cn = OracleHelper.OpenConnection())
     {
         try
         {
             OracleCommand _cmd = new OracleCommand(SQL_GetUserGuidByJS, cn);
             _cmd.Parameters.Add(":YHM", _name);
             string ret = _cmd.ExecuteScalar().ToString();
             return(ret);
         }
         catch (Exception ex)
         {
             OralceLogWriter.WriteSystemLog(string.Format("通过登录名称从数据库中取用户GUID失败!{0} {1}", ex.Message, _name), "ERROR");
             throw ex;
         }
     }
 }
Ejemplo n.º 15
0
        /// <summary>
        /// 写任务开始状态
        /// </summary>
        /// <param name="_Rwid"></param>
        /// <returns></returns>
        public static bool WriteRWState(string _Rwid)
        {
            string _cmd = "Update GZRW SET RWZT = 1 where RWID=:RWID";

            OracleParameter[] _param = { new OracleParameter(":RWID", OracleDbType.Decimal) };
            _param[0].Value = decimal.Parse(_Rwid);
            try
            {
                OracleHelper.ExecuteNonQuery(OracleHelper.ConnectionStringProfile, CommandType.Text, _cmd, _param);
            }
            catch (Exception e)
            {
                string _log = string.Format("设置任务{1}状态为正在执行时,出现错误:{0}", e.Message, _Rwid);
                OralceLogWriter.WriteSystemLog(_log, "ERROR");
                return(false);
            }
            return(true);
        }
Ejemplo n.º 16
0
        /// <summary>
        /// 通过用户名称和口令取用户ID
        /// </summary>
        /// <param name="_name">用户名称</param>
        /// <param name="_pass">用户口令</param>
        /// <returns></returns>
        public static string GetYHIDByName(string _name, string _pass)
        {
            string _select = string.Format("SELECT a.YHID FROM qx2_yhxx a where a.yhm = '{0}' or a.hggh ='{1}'", _name,
                                           ((_name.Length < 7) ? _name.PadRight(7, '0') : _name));
            DataTable _dt = OracleHelper.Get_Data(_select, "TABLE");

            if (_dt == null || _dt.Rows.Count == 0)
            {
                OralceLogWriter.WriteSystemLog(string.Format("取未注册用户[{0}]的YHID信息", _name), "INFO");
                return("-1");
            }

            if (_dt.Rows.Count != 1)
            {
                throw new Exception(string.Format("系统中存在{1}个相同的用户名:{0},请与管理员联系!", _name, _dt.Rows.Count));
            }
            return(_dt.Rows[0]["YHID"].ToString());
        }
Ejemplo n.º 17
0
        public bool SaveOrgExtList(List <OrgExtInfo> BeSavedDataList, List <OrgExtFieldDefine> PropertieDefines)
        {
            StringBuilder _sb = new StringBuilder();

            _sb.Append(" update QX2_JGFJXX set JGXSMC=:JGXSMC,ISDISPLAY=:ISDISPLAY,DISPLAYORDER=:DISPLAYORDER");
            foreach (OrgExtFieldDefine _field in PropertieDefines)
            {
                _sb.Append(string.Format(",{0}=:{0}", _field.FieldName));
            }
            _sb.Append(" where ZZJGID=:ZZJGID ");

            using (OracleConnection cn = OracleHelper.OpenConnection())
            {
                OracleTransaction _txn = cn.BeginTransaction();
                foreach (OrgExtInfo _item in BeSavedDataList)
                {
                    try
                    {
                        List <OracleParameter> _plist = new List <OracleParameter>();
                        _plist.Add(new OracleParameter(":JGXSMC", _item.GetValue("JGXSMC")));
                        _plist.Add(new OracleParameter(":ISDISPLAY", _item.GetValue("ISDISPLAY")));
                        _plist.Add(new OracleParameter(":DISPLAYORDER", _item.GetValue("DISPLAYORDER")));
                        foreach (OrgExtFieldDefine _field in PropertieDefines)
                        {
                            _plist.Add(new OracleParameter(string.Format(":{0}", _field.FieldName), _item.GetValue(_field.FieldName)));
                        }
                        _plist.Add(new OracleParameter(":ZZJGID", Convert.ToDecimal(_item.GetValue("ZZJGID"))));
                        OracleParameter[] _ps = _plist.ToArray();
                        OracleHelper.ExecuteNonQuery(cn, CommandType.Text, _sb.ToString(), _ps);
                    }
                    catch (Exception e)
                    {
                        string _errmsg = string.Format("写入{1}的组织机构扩展信息时出错,错误信息为:{0}!",
                                                       e.Message, _item.GetValue("ZZJGID"));
                        OralceLogWriter.WriteSystemLog(_errmsg, "ERROR");
                        _txn.Rollback();
                        return(false);
                    }
                }
                _txn.Commit();
                cn.Close();
            }
            return(true);
        }
Ejemplo n.º 18
0
        /// <summary>
        /// 任务管理器
        /// </summary>
        /// <param name="application"></param>
        /// <param name="_rwid">任务ID</param>
        /// <param name="_lb">任务类别</param>
        /// <param name="_ml">任务命令</param>
        public static void RunTask(string _rwid, string _lb, string _ml)
        {
            string      _pluginName = _lb.Trim();
            ITaskPlugin _plugin     = TaskLib.GetService(_pluginName);

            if (_plugin == null)
            {
                throw new Exception(string.Format("任务{0}接口未注册!", _pluginName));
            }
            try
            {
                Task_Base _task = _plugin.GetTaskObject(_rwid, _ml) as Task_Base;
                Thread    t     = new Thread(new ThreadStart(_task.ThreadProc));
                t.Start();
            }
            catch (Exception ex)
            {
                OralceLogWriter.WriteSystemLog(ex.Message, "ERROR");
            }
        }
Ejemplo n.º 19
0
        /// <summary>
        /// 取所有的达到执行时间的任务列表
        /// </summary>
        /// <returns></returns>
        public static DataTable GetTaskList()
        {
            DataTable     detailData = null;
            StringBuilder _sb        = new StringBuilder();

            _sb.Append("select RWID,RZLB,RWML from GZRW where RWZT = 0 and NEXTTIME<sysdate");

            try
            {
                detailData           = OracleHelper.FillDataTable(OracleHelper.ConnectionStringProfile, CommandType.Text, _sb.ToString());
                detailData.TableName = "TASKLIST";
                return(detailData);
            }
            catch (Exception ex)
            {
                string _log = string.Format("取所有的达到执行时间的任务列表出错:{0}", ex.Message);
                OralceLogWriter.WriteSystemLog(_log, "ERROR");
                return(null);
            }
        }
Ejemplo n.º 20
0
        private void CloseReportTemplate()
        {
            int _ret = -1;

            try {
                if (m_oBook != null)
                {
                    m_oBook.Close(true, m_sReportTemplate, m_oMissing);
                }

                if (m_oExcelApp != null)
                {
                    OralceLogWriter.WriteSystemLog(string.Format("执行关闭m_oExcelApp!ret = {0}", _ret), "INFO");
                }
                m_oExcelApp = null;
                m_oBooks    = null;
                m_oBook     = null;
                oSheets     = null;
                m_oSheet    = null;
                oCells      = null;

                OralceLogWriter.WriteSystemLog("完成关闭EXCEL进程!", "INFO");
                GC.Collect();
                isBusy = false;
                //				GC.WaitForPendingFinalizers();
                //				GC.Collect();
                //				GC.WaitForPendingFinalizers();
            }
            catch (Exception e) {
                OralceLogWriter.WriteSystemLog(string.Format("关闭EXCEL进程时出错!{0}", e.Message), "ERROR");
            }
            finally {
                GC.Collect();
                //				GC.WaitForPendingFinalizers();
                //				GC.Collect();
                //				GC.WaitForPendingFinalizers();
            }
        }
Ejemplo n.º 21
0
        public List <MD_ReportGuideLineItem> GetReportGuideLines(MD_ReportName _reportName)
        {
            List <MD_ReportGuideLineItem> _ret = new List <MD_ReportGuideLineItem>();

            using (OracleConnection cn = OracleHelper.OpenConnection())
            {
                try
                {
                    OracleCommand _cmd = new OracleCommand(SQL_GetReportGuideLines, cn);
                    _cmd.Parameters.Add(":ZTMC", _reportName.ReportName);
                    OracleDataReader _dr = _cmd.ExecuteReader();
                    while (_dr.Read())
                    {
                        MD_ReportGuideLineItem _item = new MD_ReportGuideLineItem(
                            "1",
                            "",
                            _dr.IsDBNull(2) ? "" : _dr.GetString(2),
                            _dr.IsDBNull(0) ? "" : _dr.GetString(0),
                            Enum_ReportGuideLineItemType.Report
                            );

                        _item.Children = GetChildGuideLine(_item, cn);
                        _ret.Add(_item);
                    }
                    _dr.Close();
                    cn.Close();
                }
                catch (Exception ex)
                {
                    string _err = string.Format("取报表指标项时出错,错误信息:{0}   SQL语句:{1}", ex.Message, SQL_GetReportGuideLines);
                    OralceLogWriter.WriteSystemLog(_err, "ERROR");
                    throw ex;
                }
            }

            return(_ret);
        }
Ejemplo n.º 22
0
        public SinoTaskInfo GetTaskInfo(string TaskID)
        {
            SinoTaskInfo _ret = null;

            OracleParameter[] _param =
            {
                new OracleParameter(":RWID", OracleDbType.Decimal)
            };
            _param[0].Value = decimal.Parse(TaskID);
            try
            {
                OracleDataReader _dr = OracleHelper.ExecuteReader(OracleHelper.ConnectionStringProfile, CommandType.Text, SQL_GetTaskInfo, _param);
                while (_dr.Read())
                {
                    _ret            = new SinoTaskInfo();
                    _ret.RWID       = _dr.IsDBNull(0) ? "" : _dr.GetDecimal(0).ToString();
                    _ret.RWMC       = _dr.IsDBNull(1) ? "" : _dr.GetString(1);
                    _ret.RWMS       = _dr.IsDBNull(2) ? "" : _dr.GetString(2);
                    _ret.RWLX       = _dr.IsDBNull(3) ? "" : _dr.GetString(3);
                    _ret.RWML       = _dr.IsDBNull(4) ? "" : _dr.GetString(4);
                    _ret.NextTime   = _dr.IsDBNull(5) ? new DateTime(1900, 1, 1) : _dr.GetDateTime(5);
                    _ret.LastTime   = _dr.IsDBNull(6) ? new DateTime(1900, 1, 1) : _dr.GetDateTime(6);
                    _ret.RunFlag    = _dr.IsDBNull(7) ? "" : _dr.GetDecimal(7).ToString();
                    _ret.LastResult = _dr.IsDBNull(8) ? "" : _dr.GetString(8);
                    _ret.RWZT       = _dr.IsDBNull(9) ? "" : _dr.GetDecimal(9).ToString();
                }
                return(_ret);
            }
            catch (Exception ex)
            {
                string _errmsg = string.Format("取RWID={1}的工作任务信息时出错,错误信息为:{0}!",
                                               ex.Message, TaskID);
                OralceLogWriter.WriteSystemLog(_errmsg, "ERROR");
                return(null);
            }
        }
Ejemplo n.º 23
0
        /// <summary>
        /// 生成报表
        /// </summary>
        /// <param name="_reportItem"></param>
        /// <param name="_sDate"></param>
        /// <param name="_eDate"></param>
        /// <returns></returns>
        public static bool CreateReport(MD_ReportName _reportItem, DateTime _sDate, DateTime _eDate, string _dwdm)
        {
            DataTable _rData = null, _mxData = new DataTable(), _cellData = null;
            DataSet   _hmcData;

            #region 生成报表统计数据
            if (!CreateReportData(_reportItem.ReportName, _sDate, _eDate, _dwdm))
            {
                OralceLogWriter.WriteSystemLog(string.Format("生成报表发生错误({0},{1},{2},{3})", _reportItem.ReportName, _dwdm, _sDate, _eDate), "ERROR");
                return(false);
            }
            #endregion

            #region 取报表统计结果数据
            if (!GetReportData(_reportItem.ReportName, _sDate, _eDate, _dwdm, out _rData))
            {
                OralceLogWriter.WriteSystemLog(string.Format("取报表数据时发生错误({0},{1},{2},{3})", _reportItem.ReportName, _dwdm, _sDate, _eDate), "ERROR");
                return(false);
            }
            #endregion

            #region 取报表特殊行/列的结果数据
            if (!GetReportSpecialData(_reportItem.ReportName, _sDate, _eDate, _dwdm, out _cellData))
            {
                OralceLogWriter.WriteSystemLog(string.Format("取报表数据特殊行列数据时发生错误({0},{1},{2},{3})", _reportItem.ReportName, _dwdm, _sDate, _eDate), "ERROR");
                return(false);
            }
            #endregion

            #region 取报表定义
            if (!GetReportDefine(_reportItem.ReportName, _sDate, _eDate, _dwdm, out _hmcData))
            {
                OralceLogWriter.WriteSystemLog(string.Format("取报表定义数据时发生错误({0},{1},{2},{3})", _reportItem.ReportName, _dwdm, _sDate, _eDate), "ERROR");
                return(false);
            }
            #endregion

            #region 取报表明细数据
            if (!GetReportMXData(_reportItem.ReportName, _sDate, _eDate, _dwdm, out _mxData))
            {
                OralceLogWriter.WriteSystemLog(string.Format("取报表明细数据时发生错误({0},{1},{2},{3})", _reportItem.ReportName, _dwdm, _sDate, _eDate), "ERROR");
                return(false);
            }
            #endregion

            using (OracleConnection cn = OracleHelper.OpenConnection())
            {
                OracleTransaction txn = cn.BeginTransaction();
                try
                {
                    //开始生成报表,并存入ORALCE CLOB字段
                    ProcessExcelReport oReport = new ProcessExcelReport();
                    oReport.ReportTemplate = Utils.ExeDir + string.Format(@"ReportTemp\{0}.xls", _reportItem.ReportName);
                    oReport.DataTemplate   = "\\TestData.xml";                   //暂时不用
                    oReport.ReportIndex    = 1;
                    oReport.ExportFormat   = "HTML";
                    oReport.OutputCache    = Utils.ExeDir + @"OutputCache";

                    string excelReportFile, htmReportFile, sMessage;
                    string _bbid = GetReportID(_reportItem.ReportName, _sDate, _eDate, _dwdm);
                    if (!oReport.CreateReportFiles(_bbid, _rData, _cellData, _mxData, _hmcData, out excelReportFile, out htmReportFile, out sMessage))
                    {
                        //ShowError(sMessage,true);
                    }
                    else
                    {
                        //将HTML文件存入CLOB字段
                        //将EXCEL写入BLOG字段
                        StreamReader sr      = new StreamReader(htmReportFile, System.Text.Encoding.Default);
                        string       strHtml = sr.ReadToEnd();
                        sr.Close();

                        FileStream fs   = new FileStream(excelReportFile, FileMode.OpenOrCreate);
                        byte[]     blob = new byte[fs.Length];
                        fs.Read(blob, 0, blob.Length);
                        fs.Close();

                        OracleCommand _cmd = new OracleCommand();
                        _cmd.CommandText = @"update TJ_ZDYBBFJXXB set TBR = :TBR,TBRQ = sysdate,TBDW=:TBDW,BBZT='未审核',BBJG_C=:HTMFILE,BBJG_B=:EXEFILE where 
                                                                        BBMC = :BBMC AND TJDW=:TJDW AND KSRQ=:KSRQ AND JZRQ=:JZRQ";
                        _cmd.CommandType = CommandType.Text;
                        _cmd.Parameters.Add(":TBR", SinoUserCtx.CurUser.UserName);
                        _cmd.Parameters.Add(":TBDW", SinoUserCtx.CurUser.QxszDWMC);
                        _cmd.Parameters.Add(new OracleParameter(":HTMFILE", OracleDbType.Clob, strHtml.Length, ParameterDirection.Input, false, 0, 0, null, DataRowVersion.Current, strHtml));
                        _cmd.Parameters.Add(new OracleParameter(":EXEFILE", OracleDbType.Blob, blob.Length, ParameterDirection.Input, false, 0, 0, null, DataRowVersion.Current, blob));
                        _cmd.Parameters.Add(":BBMC", _reportItem.ReportName);
                        _cmd.Parameters.Add(":TJDW", _dwdm);
                        _cmd.Parameters.Add(":KSRQ", _sDate);
                        _cmd.Parameters.Add(":JZRQ", _eDate);
                        _cmd.Connection = cn;
                        int _updateflag = _cmd.ExecuteNonQuery();
                        txn.Commit();

#if !DEBUG
                        FileInfo oFInfo = new FileInfo(excelReportFile);
                        if (oFInfo.Exists)
                        {
                            File.Delete(excelReportFile);
                        }

                        oFInfo = new FileInfo(htmReportFile);
                        if (oFInfo.Exists)
                        {
                            File.Delete(htmReportFile);
                        }
#endif
                        return(true);
                    }
                }
                catch (Exception e)
                {
                    txn.Rollback();
                    string _eStr = string.Format(" 系统生成报表数据时发生错误!\n  Error Message:{0}", e.Message);
                    OralceLogWriter.WriteSystemLog(_eStr, "ERROR");
                    return(false);
                }
            }
            return(true);
        }
Ejemplo n.º 24
0
        private void FillReportData(System.Data.DataTable _rData, DataSet _hmcData)
        {
            Range m_oRange  = null;
            Range m_oRange2 = null;


            try {
                //	2.行遍历,填写行名称
                int linenum = BaseRow;

                string oldLineType = "";
                System.Data.DataTable _rownameDt = _hmcData.Tables["ROW_DEFINE"];
                foreach (DataRow _dr in _rownameDt.Rows)
                {
                    if (!_dr.IsNull("HBSFZ"))
                    {
                        string _fl     = _dr["HBSFZ"].ToString();
                        int    _thishx = int.Parse(_dr["HX"].ToString()) + BaseRow;
                        if (_thishx > linenum + 1)
                        {
                            linenum = _thishx - 1;
                        }

                        if (oldLineType == _fl)
                        {
                            //复制一行
                            m_oRange = (Range)m_oSheet.Rows[linenum - 1, m_oMissing];
                            m_oRange.Insert(XlDirection.xlDown, m_oMissing);
                            m_oRange2 = (Range)m_oSheet.Rows[linenum - 1, m_oMissing];
                            m_oRange.Copy(m_oRange2);

                            //System.Runtime.InteropServices.Marshal.ReleaseComObject (m_oRange);
                            //System.Runtime.InteropServices.Marshal.ReleaseComObject(m_oRange2);
                        }
                        else
                        {
                            oldLineType = _fl;
                        }

                        PutValueToCell(linenum, BaseCol, _dr["HMC"]);
                    }
                    linenum++;
                }

                // 2.行遍历,填写数据
                linenum = BaseRow;
                System.Data.DataTable _colnameDt = _hmcData.Tables["COL_DEFINE"];
                int _colCount = _colnameDt.Rows.Count;
                foreach (DataRow _rowdr in _rData.Rows)
                {
                    for (int colnum = 0; colnum < _colCount; colnum++)
                    {
                        int    _thishx = int.Parse(_rowdr["HX"].ToString()) + BaseRow;
                        string _lx     = string.Format("L{0}", colnum + 1);
                        PutValueToCell(_thishx - 1, colnum + BaseCol + 1, _rowdr[_lx]);
                    }
                    linenum++;
                }
            }
            finally {
                if (m_oRange != null)
                {
                    int _ret = System.Runtime.InteropServices.Marshal.ReleaseComObject(m_oRange);
                    OralceLogWriter.WriteSystemLog(string.Format("执行关闭m_oRange!ret = {0}", _ret), "INFO");
                }

                if (m_oRange2 != null)
                {
                    int _ret = System.Runtime.InteropServices.Marshal.ReleaseComObject(m_oRange2);
                    OralceLogWriter.WriteSystemLog(string.Format("执行关闭m_oRange2!ret = {0}", _ret), "INFO");
                }

                GC.Collect();
                //				GC.WaitForPendingFinalizers();
                //				GC.Collect();
                //				GC.WaitForPendingFinalizers();
            }
        }
Ejemplo n.º 25
0
        public bool CreateReportFiles(string _bbid, System.Data.DataTable _rData, System.Data.DataTable _cellData, System.Data.DataTable _mxData, DataSet _hmcData, out string execelFile, out string htmFile, out string sMessage)
        {
            execelFile = "";
            htmFile    = "";
            sMessage   = "";
            string sDeleteFile = null;

            try {
                DataRow _dr     = _hmcData.Tables["REPORT_DEFINE"].Rows[0];
                string  _rdMeta = _dr["BBMETA"].ToString();
                string  _brow   = StrUtils.GetMetaByName("基准行", _rdMeta);
                string  _bcol   = StrUtils.GetMetaByName("基准列", _rdMeta);

                if (_brow != "")
                {
                    BaseRow = int.Parse(_brow);
                }
                if (_bcol != "")
                {
                    BaseCol = int.Parse(_bcol);
                }

                // Get temporary file name
                execelFile = Utils.ExeDir + string.Format(@"OutputCache\{0}_{1}.xls", DateTime.Now.ToString("yyyyMMddhhmmss"), tempIndex++);


                File.Copy(m_sReportTemplate, execelFile, true);
                m_sReportTemplate = execelFile;

                // Get valid report tempate
                OpenReportTempalte();

                //填数据
                FillReportData(_rData, _hmcData);

                //填CELL数据
                FillSpecialCessData(_cellData);

                //保存EXCEL文件
                m_oBook.Save();

                FillHyperLinks(_bbid, _mxData, _cellData, _hmcData);

                //保存为HTML文件
                // get file name with out path
                FileInfo oFInfo = new FileInfo(execelFile);
                htmFile = oFInfo.Name.Replace(".xls", ".mht");
                string sReportFileLocal = m_sOutputCache + Path.DirectorySeparatorChar.ToString() + htmFile;
                htmFile = sReportFileLocal;
                // Delete if html file already exists
                oFInfo = new FileInfo(sReportFileLocal);
                if (oFInfo.Exists)
                {
                    File.Delete(sReportFileLocal);
                }

                // Export to HTML format
                m_oBook.SaveAs(sReportFileLocal, XlFileFormat.xlWebArchive, m_oMissing, m_oMissing, m_oMissing, m_oMissing,
                               XlSaveAsAccessMode.xlNoChange, m_oMissing, m_oMissing, m_oMissing, m_oMissing, m_oMissing);


                // Done
                m_oBook.Save();
                return(true);
            }
            catch (Exception exp) {
                sMessage = exp.Message;
                string _eStr = string.Format(" 系统在依据报表模板生成报表时发生错误!\n  Error Message:{0}", exp.Message);
                OralceLogWriter.WriteSystemLog(_eStr, "ERROR");
                return(false);
            }
            finally {
                CloseReportTemplate();
                if (sDeleteFile != null)
                {
                    File.Delete(sDeleteFile);
                }
            }
        }
Ejemplo n.º 26
0
        private byte[] GetRsReport_New(MD_ReportItem _reportItem, string Format)
        {
            byte[] results;

            ReportExecutionService rs = new ReportExecutionService();

            rs.Credentials = new System.Net.NetworkCredential(RsConfig.Name, RsConfig.Pass);
            rs.Url         = RsConfig.RsURL;

            // Render arguments
            byte[] result     = null;
            string reportPath = "/海关总署缉私局/" + _reportItem.ReportName.ReportName;
            string historyID  = null;
            string devInfo    = @"<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>";

            // Prepare report parameter.
            ReportService2008.ParameterValue[] param = new ReportService2008.ParameterValue[3];
            param[0]       = new ReportService2008.ParameterValue();
            param[0].Name  = "Report_Parameter_Year";
            param[0].Value = _reportItem.StartDate.Year.ToString();
            param[1]       = new ReportService2008.ParameterValue();
            param[1].Name  = "Report_Parameter_month";
            param[1].Value = _reportItem.StartDate.Month.ToString("D2");
            param[2]       = new ReportService2008.ParameterValue();
            param[2].Name  = "Report_Parameter_Dw";
            param[2].Value = _reportItem.ReportDWID;

            ReportService2008.DataSourceCredentials[] credentials = null;
            string showHideToggle = null;
            string encoding;
            string mimeType;
            string extension;

            ReportService2008.Warning[]        warnings = null;
            ReportService2008.ParameterValue[] reportHistoryParameters = null;
            string[] streamIDs = null;

            ExecutionInfo   execInfo   = new ExecutionInfo();
            ExecutionHeader execHeader = new ExecutionHeader();

            rs.ExecutionHeaderValue = execHeader;

            execInfo = rs.LoadReport(reportPath, historyID);

            rs.SetExecutionParameters(param, "en-us");
            String SessionId = rs.ExecutionHeaderValue.ExecutionID;

            try
            {
                result = rs.Render(Format, devInfo, out extension, out encoding, out mimeType, out warnings, out streamIDs);

                execInfo = rs.GetExecutionInfo();

                //Console.WriteLine("Execution date and time: {0}", execInfo.ExecutionDateTime);
            }
            catch (SoapException e)
            {
                OralceLogWriter.WriteSystemLog(e.Detail.OuterXml, "ERROR");
            }
            return(result);
        }
Ejemplo n.º 27
0
        public static string GetYHIDByName(string _name, string CheckType)
        {
            XmlElement result;
            string     User_Guid = "";
            string     objValues = "";

            if (CUPPAPassportConfig.DebugMode)
            {
                //User_Guid = GetUserGuidByJS(_name);
                #region 测试XML文本取GUID
                string FilePath = CUPPAPassportConfig.CUPPA_Check_DebugDataPath;
                string filename = FilePath + string.Format("\\GetYHIDByName_{0}.XML", _name);;

                System.IO.StreamReader sr = new System.IO.StreamReader(filename, System.Text.Encoding.UTF8);
                string _xmldata           = sr.ReadToEnd();

                XmlDocument doc = new XmlDocument();
                doc.LoadXml(_xmldata);
                result = doc.DocumentElement;
                #endregion
            }
            else
            {
                try
                {
                    #region 通过三统一接口取用户的GUID信息

                    OguReaderClient _orc = new OguReaderClient();
                    objValues = string.Format(CultureInfo.InvariantCulture, "{0}&{1}", _name, CheckType);

                    result = _orc.GetObjectsDetail(CUPPAPassportConfig.CheckViewName, ViewCategory.ViewCode, objValues, ObjectCategory.UserIdentity, "", OrganizationCategory.None, "");

                    if (CUPPAPassportConfig.CUPPA_Check_WriteLog)
                    {
                        string _error = string.Format("通过三统一接口取用户的GUID信息成功, CheckViewName={1}  objectValues={2}  返回:{0}", result.OuterXml, CUPPAPassportConfig.CheckViewName, objValues);
                        CUPPAPassportConfig.WriteCUPPALog(_error);
                    }
                    #endregion
                }
                catch (Exception ex)
                {
                    string _error = string.Format("通过三统一接口取用户的GUID信息失败!{0}  CheckViewName={2}  objectValues={3}  {1}", ex.Message, ex.StackTrace, CUPPAPassportConfig.CheckViewName, objValues);
                    if (CUPPAPassportConfig.CUPPA_Check_WriteLog)
                    {
                        CUPPAPassportConfig.WriteCUPPALog(_error);
                    }
                    throw ex;
                }
            }

            try
            {
                if (result.ChildNodes.Count > 0)
                {
                    XmlNode node_diffgram        = result.ChildNodes[1];
                    XmlNode node_DocumentElement = node_diffgram.ChildNodes[0];
                    XmlNode node_OBJECTSDETAIL   = node_DocumentElement.ChildNodes[0];
                    foreach (XmlNode _node in node_OBJECTSDETAIL.ChildNodes)
                    {
                        if (_node.Name == "USER_GUID")
                        {
                            User_Guid = _node.InnerText;
                            if (CUPPAPassportConfig.CUPPA_Check_WriteLog)
                            {
                                string _error = string.Format("用户的GUID={0}", User_Guid);
                                CUPPAPassportConfig.WriteCUPPALog(_error);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                string _error = string.Format("解析XML数据取用户GUID失败!{0} {1}", ex.Message, (result == null) ? "" : result.OuterXml);
                OralceLogWriter.WriteSystemLog(_error, "ERROR");
                if (CUPPAPassportConfig.CUPPA_Check_WriteLog)
                {
                    CUPPAPassportConfig.WriteCUPPALog(_error);
                }
                throw ex;
            }


            #region 通过USER_GUID取YHID
            using (OracleConnection cn = OracleHelper.OpenConnection())
            {
                try
                {
                    OracleCommand _cmd = new OracleCommand(CUPPAPassportConfig.SQL_GetYHIDByGUID, cn);
                    _cmd.CommandType = CommandType.Text;
                    _cmd.Parameters.Add("GUID", User_Guid);
                    decimal _ret = (decimal)_cmd.ExecuteScalar();
                    if (CUPPAPassportConfig.CUPPA_Check_WriteLog)
                    {
                        CUPPAPassportConfig.WriteCUPPALog(string.Format("取得的YHID={0}", _ret));
                    }
                    return(_ret.ToString());
                }
                catch (Exception ex)
                {
                    string _error = string.Format("通过USER_GUID({1})取YHID失败!{0}", ex.Message, User_Guid);
                    OralceLogWriter.WriteSystemLog(_error, "ERROR");
                    if (CUPPAPassportConfig.CUPPA_Check_WriteLog)
                    {
                        CUPPAPassportConfig.WriteCUPPALog(_error);
                    }
                    throw ex;
                }
            }
            #endregion
        }