public override void WriteLog(DataSet original, DataSet changes) { //单独处理,即使错误,不向外抛出异常 try { string logID = Guid.NewGuid().ToString().Replace("-", ""); //本次日志ID IBridge_EditLogHistory logBridge = bllBusinessLog.CreateEditLogHistoryBridge(); logBridge.WriteLog(logID, original.Tables[0], changes.Tables[0], tb_IC.__TableName, tb_IC.__KeyName, true); //主表 logBridge.WriteLog(logID, original.Tables[1], changes.Tables[1], tb_ICs.__TableName, tb_ICs.__KeyName, false); //明细 } catch { Msg.Warning("写入日志发生错误!"); } }
/// <summary> /// 记录单表日志 /// </summary> /// <param name="changes">修改后的数据</param> /// <param name="tableName">表名</param> /// <param name="keyFieldName">记录的主键,比较新旧数据时用于定位</param> public void WriteLog(DataTable original, DataTable changes) { string GUID = Guid.NewGuid().ToString().Replace("-", ""); IBridge_EditLogHistory bridge = bllBusinessLog.CreateEditLogHistoryBridge(); bridge.WriteLog(GUID, original, changes, _SummaryTableName, _KeyFieldName, true); }