public override void ProcessRequest(HttpContext context) { base.CurrentContext = context; context.Response.ContentType = "text/plain"; InvokeResult data = this.CheckHandlerPower(); if (data.ResultCode != "0") { context.Response.Write(data.JsonJsSerialize()); } else { try { data = this.Process(context); context.Response.Write(data.JsonJsSerialize()); } catch (Exception exception) { LogModuleInfo logModuleInfo = this.GetLogModuleInfo(); if (!logModuleInfo.IsDispose) { throw exception; } LogHelper.Write(logModuleInfo.ModuleTypeCode, exception, ""); data.ResultCode = "Error"; data.ResultMessage = "访问出错"; context.Response.Write(data.JsonJsSerialize()); } } }
private void LinkButtonClick(object sender, EventArgs e) { LinkButton button = (LinkButton)sender; try { this.OnItemCommand(button.CommandName, button.CommandArgument); } catch (Exception exception) { Type type = exception.GetType(); LogModuleInfo logModuleInfo = ((ModulePage)this.Page).GetLogModuleInfo(); if (((type != typeof(ThreadAbortException)) && (type != typeof(InfoHintException))) && !(type == typeof(ArgumentInputNullException))) { if (!logModuleInfo.IsDispose) { throw exception; } LogHelper.DisposeException(logModuleInfo.ModuleTypeCode, exception); } else { LogHelper.DisposeException(logModuleInfo.ModuleTypeCode, exception); } } }
protected override void OnRowCommand(GridViewCommandEventArgs e) { if (e.CommandName != "Sort") { try { base.OnRowCommand(e); } catch (Exception exception) { Type type = exception.GetType(); LogModuleInfo logModuleInfo = ((ModulePage)this.Page).GetLogModuleInfo(); if (((type != typeof(ThreadAbortException)) && (type != typeof(InfoHintException))) && !(type == typeof(ArgumentInputNullException))) { if (!logModuleInfo.IsDispose) { throw exception; } LogHelper.DisposeException(logModuleInfo.ModuleTypeCode, exception); } else { LogHelper.DisposeException(logModuleInfo.ModuleTypeCode, exception); } } } }
public virtual LogModuleInfo GetLogModuleInfo() { if (this.LogModuleType.IsNoNull()) { return(new LogModuleInfo(LogSectionHelper.IsDispose, this.LogModuleType)); } return(LogModuleInfo.CreateApplicationModuleInfo()); }
public virtual void LogExpDispose(Exception objExp) { LogModuleInfo logModuleInfo = this.GetLogModuleInfo(); if (!logModuleInfo.IsDispose) { throw objExp; } LogHelper.DisposeException(logModuleInfo.ModuleTypeCode, objExp); }
protected override void OnError(EventArgs e) { Exception lastError = base.Server.GetLastError(); if ((lastError.GetType() == typeof(HttpException)) && lastError.Message.IsMatch("超过了最大请求长度")) { base.Response.Write("请求出错,请检查上传的文件的大小是否超过" + ((int)(ConfigHelper.GetIntValue("MaxFileSize", 0x2800) * 0x400)).RenderFileSize() + "或提交的请求超过" + ((int)(ConfigHelper.GetIntValue("MaxFileSize", 0x2800) * 0x400)).RenderFileSize()); base.Response.End(); base.OnError(e); } else { LogModuleInfo logModuleInfo = this.GetLogModuleInfo(); if (logModuleInfo.IsDispose) { base.Server.ClearError(); LogHelper.Write(logModuleInfo.ModuleTypeCode, LogCategory.ExceptionError.ToString(), "访问界面出错", lastError, ""); this.PageErrorProcess(); } base.OnError(e); } }
public override void ProcessRequest(HttpContext context) { base.CurrentContext = context; context.Response.ContentType = "text/plain"; InvokeResult checkPowerResult = this.CheckHandlerPower(); try { this.Process(context, checkPowerResult); } catch (Exception exception) { LogModuleInfo logModuleInfo = this.GetLogModuleInfo(); if (!logModuleInfo.IsDispose) { throw exception; } LogHelper.Write(logModuleInfo.ModuleTypeCode, exception, ""); checkPowerResult.ResultCode = "-2"; checkPowerResult.ResultMessage = "访问出错"; this.Process(context, checkPowerResult); } }
protected override void CreateChildControls() { LogModuleInfo info = new LogModuleInfo(false, ""); IList <OperateModuleInfo> list = null; if (list == null) { if (this.CoteID.IsNoNull() && this.CoteModuleID.IsNoNull()) { list = ((ModulePage)this.Page).GetPowerOperateModule(this.ModuleTypeID, this.ModuleCode, this.CoteModuleID, this.CoteID, this.OperatePlaceTypeValue); } else { list = ((ModulePage)this.Page).GetPowerOperateModule(this.ModuleTypeID, this.ModuleCode, this.OperatePlaceTypeValue); } List <OperateModuleInfo> buttonsModule = this.Buttons.GetButtonsModule(); if (buttonsModule != null) { foreach (OperateModuleInfo info2 in buttonsModule) { list.Add(info2); } } } if (list.Count != 0) { this.Controls.Clear(); int num = 0; bool flag = true; foreach (OperateModuleInfo info3 in from s in list orderby s.SortIndex select s) { if (this.CommandHidden.IsNoNull() && this.CommandHidden.Split(new char[] { ',' }).Contains <string>(info3.CommandName)) { continue; } bool flag2 = true; if (this.CommandDisabled.IsNoNull() && this.CommandDisabled.Split(new char[] { ',' }).Contains <string>(info3.CommandName)) { flag2 = false; } if ((flag2 && info3.MenuField.IsNoNull()) && (this.DataSource != null)) { string[] strArray = info3.MenuField.Split(new char[] { '|' }); string[] strArray2 = info3.MenuValue.Split(new char[] { '|' }); string[] strArray3 = info3.MenuCal.Split(new char[] { '|' }); int length = strArray.Length; if ((strArray2.Length == length) && (strArray3.Length == length)) { for (int i = 0; i < length; i++) { string item = Reflector.GetPropertyValue(this.DataSource, strArray[i]).DataConvertString(); List <string> list3 = strArray2[i].ConvertListString(); string str3 = strArray3[i]; if (str3 != null) { if (!(str3 == "in")) { if (str3 == "not") { goto Label_0305; } } else { flag2 = list3.IndexOf(item) >= 0; } } goto Label_0315; Label_0305: flag2 = list3.IndexOf(item) == -1; Label_0315: if (!flag2) { break; } } } } if (flag) { this.Controls.Add(new LiteralControl("<div class=\"" + this.ClassName + "\" ><div class=\"operator-left-menu\">")); flag = false; } ToolbarLinkButton child = new ToolbarLinkButton { Enabled = flag2 }; if (!flag2) { child.Attributes.Add("disabled ", "disabled"); } else { child.ClickScriptFun = info3.ClickScriptFun; } if (!string.IsNullOrEmpty(info3.ImageUrl)) { child.CssClass = "btn-ico"; child.Style.Value = string.Format("background-image: url({0}) !important;", info3.ImageUrl); } else { child.CssClass = "btn-text "; } if (!string.IsNullOrEmpty(info3.ImageCss)) { child.CssClass = "btn-ico " + info3.ImageCss; } child.Text = info3.ModuleName; child.ID = info3.CommandName; child.ToolTip = info3.ToolTip; child.CommandName = info3.CommandName; child.UserValidationGroup = info3.ValGroupName; child.CommandArgument = info3.CommandArgument; child.Click += new EventHandler(this.LinkButtonClick); Literal literal = new Literal { Text = "<span>|</span>" }; if (num > 0) { this.Controls.Add(literal); } num++; this.Controls.Add(child); } if (this.Controls.Count > 0) { this.Controls.Add(new LiteralControl("</div>")); string str2 = ""; if (this.IsAddOperatorLog && this.MenuPowerID.IsNoNullOrWhiteSpace()) { str2 = "<a class=\"btn-ico moduleButton\" onclick=\"javascript:showopen('" + ("../../ServiceLayer/Loging/OperatorHistoryList.aspx?HistoryID=" + this.MenuPowerID).EncryptModuleQuery() + "',1200,500);\">操作日志</a>"; } if (this.IsAddRefresh) { str2 = str2 + (str2.IsNoNullOrWhiteSpace() ? "<span>|</span>" : "") + "<a class=\"btn-ico refreshButton\" href=\"javascript: window.location=window.location;\"> </a>"; } if (str2.IsNoNullOrWhiteSpace()) { this.Controls.Add(new LiteralControl("<div class=\"operator-right-menu\"> " + str2 + "</div>")); } this.Controls.Add(new LiteralControl("</div>")); } } }