public void UpdateModifyRecord(HRCheckInEntity oldShow, HRCheckInEntity newShow, string tableName = null) { if (string.IsNullOrEmpty(tableName)) { tableName = this.CurrentTableName + "_LOG"; } BaseModifyRecordManager manager = new BaseModifyRecordManager(DbHelper, this.UserInfo, tableName); foreach (var property in typeof(HRCheckInEntity).GetProperties()) { var fieldDescription = property.GetCustomAttributes(typeof(FieldDescription), false).FirstOrDefault() as FieldDescription; var oldValue = Convert.ToString(property.GetValue(oldShow, null)); var newValue = Convert.ToString(property.GetValue(newShow, null)); if (!fieldDescription.NeedLog || oldValue == newValue) { continue; } var record = new BaseModifyRecordEntity(); record.ColumnCode = property.Name.ToUpper(); record.ColumnDescription = fieldDescription.Text; record.NewValue = newValue; record.OldValue = oldValue; record.TableCode = HRCheckInEntity.TableName.ToUpper(); record.TableDescription = FieldExtensions.ToDescription(typeof(HRCheckInEntity), "TableName"); record.RecordKey = oldShow.Id.ToString(); record.IPAddress = Utilities.GetIPAddress(true); record.CreateBy = UserInfo.RealName; record.CreateOn = DateTime.Now; BaseSequenceManager sequenceManager = new BaseSequenceManager(UserInfo); // 序列产生的ID 添加到TAB_EMPLOYEE表 record.Id = int.Parse(sequenceManager.GetOracleSequence("ZTOA")); manager.Add(record, false, false); } }