protected void DrawCaptionDiv(TableCell cell, AuditEntry entry) { PXPanel panel = new PXPanel(); panel.ContentLayout.Layout = LayoutType.Stack; panel.ContentLayout.Orientation = UI.Orientation.Horizontal; panel.RenderStyle = FieldsetStyle.Simple; IParserAccessor pa = (IParserAccessor)panel; Label tableLabel = new Label(); tableLabel.Font.Bold = true; tableLabel.Text = entry.Table; pa.AddParsedSubObject(tableLabel); Label operationLabel = new Label(); operationLabel.Text = entry.OperationTitle; pa.AddParsedSubObject(operationLabel); cell.Controls.Add(panel); }
protected void DrawChangesDiv(TableCell cell, AuditEntry entry) { PXPanel panel = new PXPanel(); panel.ContentLayout.Layout = LayoutType.Stack; panel.ContentLayout.Orientation = UI.Orientation.Horizontal; panel.RenderStyle = FieldsetStyle.Simple; panel.ContentLayout.InnerSpacing = false; IParserAccessor pa = (IParserAccessor)panel; foreach (AuditValue value in entry.Values) { Table table = new Table(); table.BorderStyle = BorderStyle.Solid; table.BorderWidth = Unit.Pixel(1); table.BorderColor = System.Drawing.SystemColors.ControlLight; table.Attributes.Add("bordercolor", "ControlLight"); table.GridLines = GridLines.Both; table.Height = Unit.Percentage(100); TableRow fieldRow = new TableRow(); TableCell fieldCell = new TableCell(); fieldCell.Font.Bold = true; fieldCell.Style[HtmlTextWriterStyle.PaddingLeft] = "5px"; fieldCell.Style[HtmlTextWriterStyle.PaddingRight] = "5px"; fieldCell.ForeColor = System.Drawing.Color.DarkSlateGray; fieldCell.Text = value.DisplayName; fieldRow.Cells.Add(fieldCell); table.Rows.Add(fieldRow); if (entry.Operation == AuditOperation.Update) { TableRow oldValueRow = new TableRow(); TableCell oldValueCell = new TableCell(); oldValueCell.ForeColor = System.Drawing.Color.DarkRed; oldValueCell.Height = Unit.Percentage(100); SetValue(oldValueCell, value.OldValue, value.Format); oldValueRow.Cells.Add(oldValueCell); table.Rows.Add(oldValueRow); } TableRow newValueRow = new TableRow(); TableCell newValueCell = new TableCell(); newValueCell.ForeColor = System.Drawing.Color.DarkSlateGray; if (entry.Operation == AuditOperation.Insert || entry.Operation == AuditOperation.Update) newValueCell.ForeColor = System.Drawing.Color.DarkGreen; if (entry.Operation == AuditOperation.Delete) newValueCell.ForeColor = System.Drawing.Color.DarkRed; newValueCell.Height = Unit.Percentage(100); SetValue(newValueCell, value.NewValue, value.Format); newValueRow.Cells.Add(newValueCell); table.Rows.Add(newValueRow); pa.AddParsedSubObject(table); } cell.Controls.Add(panel); }