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; } }