public static BindingList <ChangeObject> GetProjectDetailChanges(Session session, int recordID) { List <ChangeObject> result = new List <ChangeObject>(); foreach (ProjectDetails detail in session.GetObjectByKey <Project>(recordID).ProjectDetails) { result.AddRange(AuditTrailBLL.GetChanges(session, "ProjectDetails", detail.Oid, true).ToList()); } return(new BindingList <ChangeObject>(result)); }
public static BindingList <ChangeObject> GetProjectDetailChanges(Session session, int recordID, bool uniqueProperties) { BindingList <ChangeObject> result = AuditTrailBLL.GetChanges(session, "ProjectDetails", recordID, uniqueProperties); //For Each update As ChangeObject In result // If update.PropertyName = "ProjectItem" Then // If update.PrevValue <> "NULL" Then // update.PrevValue = update. // End If // End If //Next return(result); }
private void UpdateAuditTrail() { //Private Sub UpdateAuditTrail(ByVal ModifiedRecord As SPG.UsersRow, ByVal originalRecord As Object()) StringBuilder builder = new StringBuilder(string.Empty); foreach (Change update in changes) { builder.Append(string.Format("{0}:{1}({2}); ", update.PropertyName, update.PrevValue, update.NewValue)); } if (builder.Length > 2) { builder.Length = (builder.Length - 2); AuditTrailBLL.AddTrailEntry(Properties.Settings.Default.UserName, 0, "Users", builder.ToString()); } changes.Clear(); //Dim builder As New StringBuilder(String.Empty) //Dim i As Integer = 0 //Do While (i <= (ModifiedRecord.Table.Columns.Count - 1)) // Try // If IsDBNull(originalRecord(i)) Then // If Not IsDBNull(ModifiedRecord.Item(i)) Then // builder.Append(String.Format("{0}:{1}({2}); ", ModifiedRecord.Table.Columns.Item(i).ColumnName, "NULL", ModifiedRecord.Item(i))) // End If // ElseIf Information.IsDBNull(ModifiedRecord.Item(i)) Then // If Not Information.IsDBNull(originalRecord(i)) Then // builder.Append(String.Format("{0}:{1}({2}); ", ModifiedRecord.Table.Columns.Item(i).ColumnName, originalRecord(i), "NULL")) // End If // ElseIf CStr(ModifiedRecord.Item(i)) <> CStr(originalRecord(i)) Then // builder.Append(String.Format("{0}:{1}({2}); ", ModifiedRecord.Table.Columns.Item(i).ColumnName, originalRecord(i), ModifiedRecord.Item(i))) // End If // Catch // Continue Do // Finally // i += 1 // End Try //Loop //If builder.Length <= 2 Then // Return //End If //builder.Length = (builder.Length - 2) //AuditTrailBLL.AddTrailEntry(My.Settings.UserName, 0, "Users", builder.ToString) }
private void UpdateAuditTrail() { StringBuilder builder = new StringBuilder(string.Empty); foreach (Change update in changes) { builder.Append(string.Format("{0}:{1}({2}); ", update.PropertyName, update.PrevValue, update.NewValue)); } if (builder.Length > 2) { builder.Length = (builder.Length - 2); AuditTrailBLL.AddTrailEntry(Properties.Settings.Default.UserName, int.Parse(changes[0].NewValue), "CompanySettings", builder.ToString()); } changes.Clear(); }
private void UpdateAuditTrail(SPG.ShippingAddressesRow ModifiedRecord, object[] originalRecord) { StringBuilder builder = new StringBuilder(string.Empty); int recordFields = (ModifiedRecord.ItemArray.Length - 1); int i = 0; while (i <= recordFields) { try { if (Convert.IsDBNull(originalRecord[i])) { if (!Convert.IsDBNull(ModifiedRecord[i])) { builder.Append(string.Format("{0}:{1}({2}); ", ModifiedRecord.Table.Columns[i].ColumnName, "NULL", ModifiedRecord[i])); } } else if (Convert.IsDBNull(ModifiedRecord[i])) { if (!Convert.IsDBNull(originalRecord[i])) { builder.Append(string.Format("{0}:{1}({2}); ", ModifiedRecord.Table.Columns[i].ColumnName, originalRecord[i], "NULL")); } } else if (ModifiedRecord[i] != originalRecord[i]) { builder.Append(string.Format("{0}:{1}({2}); ", ModifiedRecord.Table.Columns[i].ColumnName, originalRecord[i], ModifiedRecord[i])); } } catch { } i += 1; } if (builder.Length > 2) { builder.Length = (builder.Length - 2); AuditTrailBLL.AddTrailEntry(Properties.Settings.Default.UserName, Convert.ToInt32(ModifiedRecord[0]), "ShippingAddress", builder.ToString()); } }