/// <summary> /// 绑定日志列表 /// </summary> /// <param name="pageIndex"></param> private void BindLogList(int pageIndex) { string sourceID = rblSource.SelectedValue; string typeName = (rblType.SelectedItem == null) ? "" : rblType.SelectedItem.Text; int size = pGrid.PageSize; IList<LogInfo> list = new List<LogInfo>(); if (typeName != "" && null != typeName) { EventLogEntryType type = (EventLogEntryType)Enum.Parse(typeof(EventLogEntryType), typeName); list = new SystemLog().GetLogInfoList(DateTime.MinValue, DateTime.MaxValue, type, sourceID, size, pageIndex); } else { list = new SystemLog().GetLogInfoList(DateTime.MinValue, DateTime.MaxValue, sourceID, size, pageIndex); } gvLogInfoList.DataSource = list; gvLogInfoList.DataBind(); CustomList<LogInfo> cList = list as CustomList<LogInfo>; if (null != cList) { pGrid.PageSize = size; pGrid.TotalAmout = cList.TotalAmout; } }
protected void ExcelGenButton1_Click(object sender, EventArgs e) { try { IList<LogInfo> list = new List<LogInfo>(); list = new SystemLog().GetLogInfoList(5000, 0, true); gvLogInfoList.DataSource = list; gvLogInfoList.DataBind(); gvLogInfoList.Columns[0].Visible = false; } catch (ArgumentNullException ane) { this.ShowMsg(ane.Message); } catch (Exception ex) { ShowMsg(ex.Message); this.Log(ex); } }
protected void rbSel_CheckedChanged(object sender, EventArgs e) { string id = lbID.Value; LogInfo lInfo = new SystemLog().GetLogInfoByID(id); // 使用全角替换 tbDetail.Text = lInfo.Message.Replace("<", "<").Replace(">", ">"); }