示例#1
0
        /// <summary>Creates a new, empty AuditDataThreadRelatedEntity object.</summary>
        /// <returns>A new, empty AuditDataThreadRelatedEntity object.</returns>
        public override IEntity Create()
        {
            IEntity toReturn = new AuditDataThreadRelatedEntity();

            // __LLBLGENPRO_USER_CODE_REGION_START CreateNewAuditDataThreadRelated
            // __LLBLGENPRO_USER_CODE_REGION_END
            return(toReturn);
        }
示例#2
0
        /// <summary>
        /// Audits the creation of a new thread by the specified user
        /// </summary>
        /// <param name="userID">User ID.</param>
        /// <param name="threadID">Thread ID.</param>
        /// <returns>true if the save was successful, false otherwise</returns>
        public static bool AuditNewThread(int userID, int threadID)
        {
            AuditDataThreadRelatedEntity toLog = new AuditDataThreadRelatedEntity();

            toLog.AuditActionID = (int)AuditActions.AuditNewThread;
            toLog.UserID        = userID;
            toLog.AuditedOn     = DateTime.Now;
            toLog.ThreadID      = threadID;
            return(toLog.Save());
        }
示例#3
0
 /// <summary>
 /// Audits the creation of a new thread by the specified user
 /// </summary>
 /// <param name="userId">User ID.</param>
 /// <param name="threadId">Thread ID.</param>
 /// <returns>true if the save was successful, false otherwise</returns>
 public static async Task <bool> AuditNewThreadAsync(int userId, int threadId)
 {
     using (var adapter = new DataAccessAdapter())
     {
         var toLog = new AuditDataThreadRelatedEntity
         {
             AuditActionID = (int)AuditActions.AuditNewThread,
             UserID        = userId,
             AuditedOn     = DateTime.Now,
             ThreadID      = threadId
         };
         return(await adapter.SaveEntityAsync(toLog).ConfigureAwait(false));
     }
 }
示例#4
0
        private void rptAudits_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            switch (e.Item.ItemType)
            {
            case ListItemType.AlternatingItem:
            case ListItemType.Item:
                AuditDataCoreEntity auditCore = (AuditDataCoreEntity)e.Item.DataItem;
                Label lblAuditAction          = (Label)e.Item.FindControl("lblAuditAction");
                lblAuditAction.Text = ((AuditActions)auditCore.AuditActionID).ToString();
                Label lblAuditDateTime = (Label)e.Item.FindControl("lblAuditDateTime");
                lblAuditDateTime.Text = auditCore.AuditedOn.ToString("dd-MMM-yyyy HH:mm:ss");

                HyperLink infoLink = (HyperLink)e.Item.FindControl("lnkAdditionalInfoLink");

                switch ((AuditActions)auditCore.AuditActionID)
                {
                case AuditActions.AuditNewMessage:
                case AuditActions.AuditAlteredMessage:
                case AuditActions.AuditApproveAttachment:
                    AuditDataMessageRelatedEntity auditMessageData = auditCore as AuditDataMessageRelatedEntity;
                    if (auditMessageData != null)
                    {
                        // convert the link into a link to the message in question.
                        infoLink.Visible     = true;
                        infoLink.NavigateUrl = "../GotoMessage.aspx?ThreadID=" + auditMessageData.Message.ThreadID + "&MessageID=" + auditMessageData.MessageID;
                        infoLink.Text        = "Message in thread: '" + auditMessageData.Message.Thread.Subject + "'";
                    }
                    break;

                case AuditActions.AuditEditMemo:
                case AuditActions.AuditNewThread:
                    AuditDataThreadRelatedEntity auditThreadData = auditCore as AuditDataThreadRelatedEntity;
                    if (auditThreadData != null)
                    {
                        infoLink.Visible     = true;
                        infoLink.NavigateUrl = "../Messages.aspx?ThreadID=" + auditThreadData.ThreadID;
                        infoLink.Text        = "Thread: '" + auditThreadData.Thread.Subject + "'";
                    }
                    break;

                case AuditActions.AuditLogin:
                    break;
                }
                break;
            }
        }