dfmmalaw
6/26/2017 - 2:54 PM

Adding event logging to the UserAudit table

Adding event logging to the UserAudit table

public void updateApiVendor(string username, Vendor existingVendor, Vendor updatedVendor)
{
    UserAudit toUpdate = create();
    toUpdate.AuditType = UserAudit.ADMIN_APIVENDOR_EDIT;
    toUpdate.Message =
        $"Updated vendor with id: {existingVendor.VendorId}. (old, new): VendorName ({existingVendor.VendorName}, {updatedVendor.VendorName})" + "   " +
        $"SendNotificationsViaApi ({existingVendor.SendNotificationsViaApi}, {updatedVendor.SendNotificationsViaApi})" + "   " +
        $"StandardApiEndpoint ({existingVendor.StandardApiEndpoint}, {updatedVendor.StandardApiEndpoint})" + "   " +
        $"OutboundUsername ({existingVendor.OutboundUsername}, {updatedVendor.OutboundUsername})" + "   " +
        $"OutboundPassword ({existingVendor.OutboundPassword}, {updatedVendor.OutboundPassword})" + "   " +
        $"SendInvite ({existingVendor.SendInvite}, {updatedVendor.SendInvite})" + "   " +
        $"Seamless ({existingVendor.Seamless}, {updatedVendor.Seamless})" + "   " +
        $"DateDosSigned ({existingVendor.DateDosSigned}, {updatedVendor.DateDosSigned})" + "   " +
        $"DateTestBegin ({existingVendor.DateTestBegin}, {updatedVendor.DateTestBegin})" + "   " +
        $"ActiveDate ({existingVendor.ActiveDate}, {updatedVendor.ActiveDate})" + "   " +
        $"InactiveDate ({existingVendor.InactiveDate}, {updatedVendor.InactiveDate})" + "   " +
        $"CertificateRequirements ({existingVendor.CertificateRequirements}, {updatedVendor.CertificateRequirements})";
    userAuditRepository.add(toUpdate);
}

public void addApiVendor(string username, Vendor vendor)
{
    UserAudit toUpdate = create();
    toUpdate.AuditType = UserAudit.ADMIN_APIVENDOR_ADD;
    toUpdate.Message = 
        $"Added vendor with id: {vendor.VendorId}. SendNotificationsViaApi: {vendor.SendNotificationsViaApi}" + "   " +
        $"StandardApiEndpoint: {vendor.StandardApiEndpoint}" + "   " +
        $"StandardApiEndpoint: {vendor.StandardApiEndpoint}" + "   " +
        $"OutboundUsername: {vendor.OutboundUsername}" + "   " +
        $"OutboundPassword: {vendor.OutboundPassword}" + "   " +
        $"SendInvited: {vendor.SendInvite}" + "   " +
        $"Seamless: {vendor.Seamless}" + "   " +
        $"DateDosSigned: {vendor.DateDosSigned}" + "   " +
        $"DateTestBegin: {vendor.DateTestBegin}" + "   " +
        $"ActiveDate: {vendor.ActiveDate}" + "   " +
        $"InactiveDate: {vendor.InactiveDate}" + "   " +
        $"CertificateRequirements: {vendor.CertificateRequirements}";
    userAuditRepository.add(toUpdate);
}
public const int ADMIN_APIVENDOR_EDIT = 1112;
public const int ADMIN_APIVENDOR_ADD = 1113;