DevTreks/Services/ContentService.cs
/// <summary>
/// Inserts a db audit trail after an edit 
/// </summary>
/// <param name="uri"></param>
Inserts a db audit trail after an edit
Inserts a db audit trail after an edit
public async Task<int> InsertAuditItemAsync(ContentURI uri)
        {
            int iAuditItemId = 0;
            if (uri.URIClub.PKId != 0)
            {
                bool bIsEditSubServerAction
                    = DataHelpers.GeneralHelpers.IsEditSubServerAction(uri);
                if (bIsEditSubServerAction)
                {
                    if (uri.URIDataManager.ServerSubActionType
                        == DataHelpers.GeneralHelpers.SERVER_SUBACTION_TYPES.runaddin
                       && (uri.URIDataManager.TempDocSaveMethod
                        == DataHelpers.AddInHelper.SAVECALCS_METHOD.none.ToString()
                        || string.IsNullOrEmpty(uri.URIDataManager.TempDocSaveMethod)))
                    {
                        return 0;
                    }
                    string sServerSubAction = uri.URIDataManager.ServerSubActionType.ToString();
                    int iMemberId = uri.URIMember.MemberId;
                    int iClubInUseId = uri.URIClub.PKId;
                    string sEditedDocURIPattern = (!string.IsNullOrEmpty(uri.URIDataManager.ContentURIPattern))
                        ? uri.URIDataManager.ContentURIPattern : uri.URIPattern;
                    string sEditedDocFullPath = uri.URIFull;
                    string sClubInUseAuthorizationLevel = uri.URIClub.PrivateAuthorizationLevel.ToString();
                    if (uri.URIMember.ClubInUse != null)
                    {
                        iClubInUseId = uri.URIMember.ClubInUse.PKId;
                        sClubInUseAuthorizationLevel = uri.URIMember.ClubInUse.PrivateAuthorizationLevel.ToString();
                    }
                    string sMemberRole = uri.URIMember.MemberRole.ToString();
                    DateTime dtToday = DataHelpers.GeneralHelpers.GetDateShortNow();
                    int iOwnerClubId = uri.URIClub.PKId;
                    iAuditItemId = await _repository.InsertNewAuditItemAsync(
                        uri, sServerSubAction, iMemberId,
                       iClubInUseId, sEditedDocURIPattern, sEditedDocFullPath,
                       sClubInUseAuthorizationLevel, sMemberRole, dtToday, iOwnerClubId);
                }
            }
            return iAuditItemId;
        }
public async Task < int > InsertAuditItemAsync ( ContentURI uri ) { int iAuditItemId = 0 ; if ( uri . URIClub . PKId != 0 ) { bool bIsEditSubServerAction = DataHelpers . GeneralHelpers . IsEditSubServerAction ( uri ) ; if ( bIsEditSubServerAction ) { if ( uri . URIDataManager . ServerSubActionType == DataHelpers . GeneralHelpers . SERVER_SUBACTION_TYPES . runaddin && ( uri . URIDataManager . TempDocSaveMethod == DataHelpers . AddInHelper . SAVECALCS_METHOD . none . ToString ( ) || string . IsNullOrEmpty ( uri . URIDataManager . TempDocSaveMethod ) ) ) { return 0 ; } string sServerSubAction = uri . URIDataManager . ServerSubActionType . ToString ( ) ; int iMemberId = uri . URIMember . MemberId ; int iClubInUseId = uri . URIClub . PKId ; string sEditedDocURIPattern = ( ! string . IsNullOrEmpty ( uri . URIDataManager . ContentURIPattern ) ) ? uri . URIDataManager . ContentURIPattern : uri . URIPattern ; string sEditedDocFullPath = uri . URIFull ; string sClubInUseAuthorizationLevel = uri . URIClub . PrivateAuthorizationLevel . ToString ( ) ; if ( uri . URIMember . ClubInUse != null ) { iClubInUseId = uri . URIMember . ClubInUse . PKId ; sClubInUseAuthorizationLevel = uri . URIMember . ClubInUse . PrivateAuthorizationLevel . ToString ( ) ; } string sMemberRole = uri . URIMember . MemberRole . ToString ( ) ; DateTime dtToday = DataHelpers . GeneralHelpers . GetDateShortNow ( ) ; int iOwnerClubId = uri . URIClub . PKId ; iAuditItemId = await _repository . InsertNewAuditItemAsync ( uri , sServerSubAction , iMemberId , iClubInUseId , sEditedDocURIPattern , sEditedDocFullPath , sClubInUseAuthorizationLevel , sMemberRole , dtToday , iOwnerClubId ) ; } } return iAuditItemId ; }
Inserts a db audit trail after an edit
Inserts a db audit trail after an edit
//tempdoc changes don't need auditing //anonymous member viewing addin results
uri
ContentURI
None