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(); } }
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); } }
protected void Page_Load(object sender, EventArgs e) { string oid = Request["ID"]; string type = Request["Type"]; string msgBody = ""; AuditServcie auditService = new AuditServcie(); AuditBusiness auditBusiness = auditService.GetAuditBusinessByOID(new Guid(oid)); if (type == "Req") { if (!(String.IsNullOrEmpty(auditBusiness.MessageBody))) { msgBody = auditBusiness.MessageBody; } else { msgBody = "请求消息体为空!"; } } else if (!(String.IsNullOrEmpty(auditBusiness.ReturnMessageBody))) { msgBody = auditBusiness.ReturnMessageBody; } else { msgBody = "响应消息体为空!"; } string fileName = type + auditBusiness.HostName + "-" + auditBusiness.ServiceName + auditBusiness.ReqBeginTime + ".txt"; Response.Clear(); Response.Buffer = true; Response.Expires = 0; Response.ContentType = "application/octet-stream"; Response.AddHeader("content-disposition", "attachment; filename=" + fileName); Response.Write(msgBody); Response.End(); }
protected void Page_Load(object sender, EventArgs e) { string oid = Request["ID"]; string type = Request["Type"]; string msgBody = ""; AuditServcie auditService = new AuditServcie(); AuditBusiness auditBusiness = auditService.GetAuditBusinessByOID(new Guid(oid)); if(type == "Req") if (!(String.IsNullOrEmpty(auditBusiness.MessageBody))) { msgBody = auditBusiness.MessageBody; } else { msgBody = "请求消息体为空!"; } else if (!(String.IsNullOrEmpty(auditBusiness.ReturnMessageBody))) { msgBody = auditBusiness.ReturnMessageBody; } else { msgBody = "响应消息体为空!"; } string fileName = type + auditBusiness.HostName + "-" + auditBusiness.ServiceName + auditBusiness.ReqBeginTime + ".txt"; Response.Clear(); Response.Buffer = true; Response.Expires = 0; Response.ContentType = "application/octet-stream"; Response.AddHeader("content-disposition", "attachment; filename=" + fileName); Response.Write(msgBody); Response.End(); }
protected void grid_OnHtmlEditFormCreated(object sender, ASPxGridViewEditFormEventArgs e) { Control pc = grid.FindEditFormTemplateControl("pageControl"); Control tbl = grid.FindEditFormTemplateControl("tblDownload"); Control cMB = pc.FindControl("txtMessageBody"); Control cRMB = pc.FindControl("txtReturnMessageBody"); ASPxHyperLink hlReq = tbl.FindControl("lnkReq") as ASPxHyperLink; ASPxHyperLink hlRes = tbl.FindControl("lnkRes") as ASPxHyperLink; if (cMB != null && cRMB != null) { ASPxMemo txtMB = cMB as ASPxMemo; ASPxMemo txtRMB = cRMB as ASPxMemo; string msgBody = "无法寻找请求消息体!"; string retMsgBody = "无法寻找响应消息体!"; string oid = txtMB.Text; try { Guid g = new Guid(oid); } catch { return; } hlReq.NavigateUrl += oid; hlRes.NavigateUrl += oid; AuditServcie auditService = new AuditServcie(); AuditBusiness auditBusiness = auditService.GetAuditBusinessByOID(new Guid(oid)); if (!(String.IsNullOrEmpty(auditBusiness.MessageBody))) { String msgContent = auditBusiness.MessageBody; if (msgContent.Length > 102400) { msgBody = msgContent.Substring(0, 102400) + "(只显示100K数据,剩余数据隐藏)"; } else { msgBody = msgContent; } } else { msgBody = "请求消息体为空!"; } if (!(String.IsNullOrEmpty(auditBusiness.ReturnMessageBody))) { String msgContent = auditBusiness.ReturnMessageBody; if (msgContent.Length > 102400) { retMsgBody = msgContent.Substring(0, 102400) + "(只显示100K数据,剩余数据隐藏)"; } else { retMsgBody = msgContent; } } else { retMsgBody = "响应消息体为空!"; } txtMB.Text = msgBody; txtRMB.Text = retMsgBody; } }
protected void grid_OnHtmlEditFormCreated(object sender, ASPxGridViewEditFormEventArgs e) { Control pc = grid.FindEditFormTemplateControl("pageControl"); Control tbl = grid.FindEditFormTemplateControl("tblDownload"); Control cMB = pc.FindControl("txtMessageBody"); Control cRMB = pc.FindControl("txtReturnMessageBody"); ASPxHyperLink hlReq = tbl.FindControl("lnkReq") as ASPxHyperLink; ASPxHyperLink hlRes = tbl.FindControl("lnkRes") as ASPxHyperLink; if (cMB != null && cRMB != null) { ASPxMemo txtMB = cMB as ASPxMemo; ASPxMemo txtRMB = cRMB as ASPxMemo; string msgBody = "无法寻找请求消息体!"; string retMsgBody = "无法寻找响应消息体!"; string oid = txtMB.Text; try { Guid g = new Guid(oid); } catch { return; } hlReq.NavigateUrl += oid; hlRes.NavigateUrl += oid; AuditServcie auditService = new AuditServcie(); AuditBusiness auditBusiness = auditService.GetAuditBusinessByOID(new Guid(oid)); if (!(String.IsNullOrEmpty(auditBusiness.MessageBody))) { String msgContent = auditBusiness.MessageBody; if (msgContent.Length > 102400) msgBody = msgContent.Substring(0, 102400) + "(只显示100K数据,剩余数据隐藏)"; else msgBody = msgContent; } else { msgBody = "请求消息体为空!"; } if (!(String.IsNullOrEmpty(auditBusiness.ReturnMessageBody))) { String msgContent = auditBusiness.ReturnMessageBody; if (msgContent.Length > 102400) retMsgBody = msgContent.Substring(0, 102400) + "(只显示100K数据,剩余数据隐藏)"; else retMsgBody = msgContent; } else { retMsgBody = "响应消息体为空!"; } txtMB.Text = msgBody; txtRMB.Text = retMsgBody; } }
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); } }