public BusinessLog AppendLog(BusinessLog businessLog) { SqlParameterCollection spc = DB.CreateSqlParameterCollection(); spc.Add("@SystemName", businessLog.SystemName); spc.Add("@ModuleName", businessLog.ModuleName); spc.Add("@CategoryName", businessLog.CategoryName); spc.Add("@Operation", businessLog.Operation); spc.Add("@KeyString", businessLog.KeyString); spc.Add("@PriorStatus", businessLog.PriorStatus); spc.Add("@PostStatus", businessLog.PostStatus); spc.Add("@MessageInfo", businessLog.MessageInfo); spc.Add("@OperatorID", businessLog.OperatorID); spc.Add("@OperatorName", businessLog.OperatorName); businessLog.OperateDateTime = DateTime.Now; spc.Add("@OperateDateTime", businessLog.OperateDateTime); string sql = "insert into g_BusinessLog(SystemName, ModuleName, CategoryName, KeyString, Operation, PriorStatus, PostStatus, MessageInfo, OperatorID, OperatorName, OperateDateTime)" + "values(@SystemName, @ModuleName, @CategoryName, @KeyString, @Operation, @PriorStatus, @PostStatus, @MessageInfo, @OperatorID, @OperatorName, @OperateDateTime)"; DB.ExecuteNonQuerySql(sql, spc); businessLog.LogID = DB.ExeSqlForObject("select max(LogID) from g_BusinessLog", null).ToInt64(); return(businessLog); }
private List <BusinessLog> DataTable2BusinessLogs(DataTable dt) { List <BusinessLog> list = new List <BusinessLog>(); foreach (DataRow dr in dt.Rows) { BusinessLog log = DataRow2BusinessLog(dr); list.Add(log); } return(list); }
private BusinessLog DataRow2BusinessLog(DataRow dr) { BusinessLog log = new BusinessLog(); log.LogID = dr["LogId"].ToInt64(); log.SystemName = dr["SystemName"].ToString(); log.ModuleName = dr["ModuleName"].ToString(); log.CategoryName = dr["CategoryName"].ToString(); log.Operation = dr["Operation"].ToString(); log.KeyString = dr["KeyString"].ToString(); log.PriorStatus = dr["PriorStatus"].ToString(); log.PostStatus = dr["PostStatus"].ToString(); log.MessageInfo = dr["MessageInfo"].ToString(); log.OperatorID = dr["OperatorId"].ToString(); log.OperatorName = dr["OperatorName"].ToString(); log.OperateDateTime = dr["OperateDateTime"].ToDateTime(); return(log); }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { long logID = this.Request.QueryString["ID"].ToInt64(); ILogManager logger = LogManagerFactory.CreateLogManager(""); BusinessLog log = logger.GetLog(logID); if (log == null) { this.ResponseRedirect("访问的数据不存在!错误代码:001"); return; } List <IDataItem> list = log.ToDataItem(); this.SetControlValue(list); } }