Example #1
0
    protected void grid_OnCustomButtonCallback(object sender, ASPxGridViewCustomButtonCallbackEventArgs e)
    {
        if (e.ButtonID != "btnPigeonhole")
        {
            return;
        }

        if (!AuthUser.IsSystemAdmin)
        {
            throw new Exception("您不是系统管理员,不能进行归档操作!");
        }
        else
        {
            错误消息服务 异常服务对象 = new 错误消息服务();
            异常信息对象 异常消息   = 异常服务对象.获得错误消息_异常编码(new Guid(grid.GetRowValues(e.VisibleIndex, "异常编码").ToString()));
            try
            {
                AuditServcie auditService = new AuditServcie();
                auditService.ExceptionPigeonhole(new Guid(异常消息.消息编码.ToString()));
            }
            catch (Exception)
            {
                throw new Exception("归档操作失败!");
            }

            异常服务对象.除错误消息_异常编码(异常消息.异常编码);
            grid.DataBind();
        }
    }
Example #2
0
    public string GetBindingReqBody(string exceptionID)
    {
        string retBody = "ExceptionID为空,无法寻找请求消息体!";

        if (!(String.IsNullOrEmpty(exceptionID)))
        {
            错误消息服务 异常服务对象 = new 错误消息服务();
            异常信息对象 异常消息   = 异常服务对象.获得错误消息_异常编码(new Guid(exceptionID));
            //String msgBody = 异常服务对象.获得错误消息内容(new Guid(exceptionID));

            XmlDocument doc = new XmlDocument();
            if (!(String.IsNullOrEmpty(异常消息.请求消息体)))
            {
                try
                {
                    doc.LoadXml(异常消息.请求消息体);
                    XmlNodeList list = doc.GetElementsByTagName("消息内容");
                    if (list.Count > 0)
                    {
                        String msgContent = list[0].InnerText;
                        if (msgContent.Length > 1024000)
                        {
                            retBody = msgContent.Substring(0, 1024000) + "(剩余数据隐藏)";
                        }
                        else
                        {
                            retBody = msgContent;
                        }
                    }
                    else
                    {
                        retBody = 异常消息.请求消息体;
                    }
                }
                catch
                {
                    retBody = 异常消息.请求消息体;
                }
            }
            else
            {
                retBody = "请求消息体为空!";
            }
        }

        return(retBody);
    }
Example #3
0
    protected void OdsException_OnUpdating(object sender, ObjectDataSourceMethodEventArgs e)
    {
        Guid ExceptionID = (Guid)e.InputParameters["异常编码"];

        错误消息服务 异常服务对象 = new 错误消息服务();
        异常信息对象 异常消息   = 异常服务对象.获得错误消息_异常编码(ExceptionID);

        注册服务目录服务 目录服务           = new 注册服务目录服务();
        务地址      serviceAddress = 目录服务.获得绑定信息_服务地址编码(new Guid(异常消息.绑定地址编码.Value.ToString()));

        务请求 req = new  务请求();

        req.主机名称 = this.Server.MachineName;
        req.务名称  = 目录服务.获得具体服务_绑定信息(serviceAddress).务名称.Trim();
        req.方法名称 = 异常消息.方法名称.Trim();
        req.消息内容 = GetRequestMessage(异常服务对象.获得错误消息内容(ExceptionID));
        req.请求时间 = System.DateTime.Now;
        req.密码   = 异常消息.请求密码;

        //if ( string.IsNullOrEmpty(req.消息内容) )
        //{
        //    throw new Exception("重发没有成功:消息内容为空!");
        //}

        //req.错误消息编码 = ExceptionID.ToString();

        try
        {
            //Core_Service_Bus_ReProcessBus_ReProcessPort 重发端口 = new Core_Service_Bus_ReProcessBus_ReProcessPort();
            //重发端口.ReceiveRequest(req);
            Core_Service_Bus_OnewayMainBus_OneWayReceive port = new Core_Service_Bus_OnewayMainBus_OneWayReceive();
            port.ReceiveRequest(req);
        }
        catch {}

        try
        {
            AuditServcie auditService = new AuditServcie();
            auditService.ExceptionResend(new Guid(异常消息.消息编码.ToString()), new Guid(异常消息.绑定地址编码.ToString()));
        }
        catch (Exception ex) {
            throw new Exception("将审计库中的异常日志标记为重发时发生错误:" + ex.Message);
        }
    }
Example #4
0
    protected void OdsException_OnUpdating(object sender, ObjectDataSourceMethodEventArgs e)
    {
        Guid ExceptionID = (Guid)e.InputParameters["异常编码"];

        错误消息服务 异常服务对象 = new 错误消息服务();
        异常信息对象 异常消息 = 异常服务对象.获得错误消息_异常编码(ExceptionID);

        注册服务目录服务 目录服务 = new 注册服务目录服务();
        服务地址 serviceAddress = 目录服务.获得绑定信息_服务地址编码(new Guid(异常消息.绑定地址编码.Value.ToString()));

        服务请求 req = new 服务请求();

        req.主机名称 = this.Server.MachineName;
        req.服务名称 = 目录服务.获得具体服务_绑定信息(serviceAddress).服务名称.Trim();
        req.方法名称 = 异常消息.方法名称.Trim();
        req.消息内容 = GetRequestMessage(异常服务对象.获得错误消息内容(ExceptionID));
        req.请求时间 = System.DateTime.Now;
        req.密码 = 异常消息.请求密码;

        //if ( string.IsNullOrEmpty(req.消息内容) )
        //{
        //    throw new Exception("重发没有成功:消息内容为空!");
        //}

        //req.错误消息编码 = ExceptionID.ToString();

        try
        {
            //Core_Service_Bus_ReProcessBus_ReProcessPort 重发端口 = new Core_Service_Bus_ReProcessBus_ReProcessPort();
            //重发端口.ReceiveRequest(req);
            Core_Service_Bus_OnewayMainBus_OneWayReceive port = new Core_Service_Bus_OnewayMainBus_OneWayReceive();
            port.ReceiveRequest(req);

        }
        catch {}

        try
        {
            AuditServcie auditService = new AuditServcie();
            auditService.ExceptionResend(new Guid(异常消息.消息编码.ToString()), new Guid(异常消息.绑定地址编码.ToString()));
        }
        catch(Exception ex) {

            throw new Exception("将审计库中的异常日志标记为重发时发生错误:" + ex.Message);
        }

    }