Ejemplo n.º 1
0
        public static void OrderCreated(object o, OrderEventArgs e)
        {
            Order order = e.Order;

            // List of email addresses to which notifications are being sent, so we
            // don't send anyone the same notification for the same order twice
            // (eg. if a single order contains multiple assets requiring approval by the same user)
            List <string> userEmails = new List <string>();

            // List of users to which email notifications will be sent
            List <User> users = new List <User>();

            // Get all of the users assigned to approving order items
            // so that we can email them to approve requests for assets

            foreach (OrderItem orderItem in order.OrderItemList)
            {
                if (orderItem.OrderItemStatus == OrderItemStatus.AwaitingApproval)
                {
                    // Get the user assigned to approving this order item
                    User authorisingUser = orderItem.AssignedToUser;

                    // Get the email address of the authorising user
                    string authorisingUserEmail = authorisingUser.Email.ToLower();

                    if (!userEmails.Contains(authorisingUserEmail))
                    {
                        users.Add(authorisingUser);
                        userEmails.Add(authorisingUserEmail);
                    }
                }
            }

            foreach (User user in users)
            {
                NotifyAdmin.OrderItemApprovalRequired(user, order);

                // Drop out as debug users dont want to receive emails for every user
                if (Email.HasDebugMode)
                {
                    break;
                }
            }
        }
Ejemplo n.º 2
0
 public static void UnapprovedUserCreated(object sender, UserEventArgs e)
 {
     NotifyAdmin.UnapprovedUserCreated(e.User);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Sends the asset feedback.
 /// </summary>
 /// <param name="asset">The asset for which feedback is being sent.</param>
 /// <param name="user">The user who is sending the feedback.</param>
 /// <param name="feedback">The feedback sent by the user</param>
 public static void SendAssetFeedback(Asset asset, User user, string feedback)
 {
     NotifyAdmin.SendAssetFeedback(asset, user, feedback);
     NotifyUser.SendAssetFeedback(asset, user, feedback);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Sends email notifications when an asset with a duplicate hash is uploaded (ie. duplicate file)
 /// </summary>
 public static void AssetUploadDuplicateHash(User user, IEnumerable <Asset> assetList)
 {
     m_Logger.DebugFormat("Enter NotifyEngine.AssetUploadDuplicateHash");
     NotifyAdmin.AssetUploadDuplicateHash(user, assetList);
     m_Logger.DebugFormat("Exit NotifyEngine.AssetUploadDuplicateHash");
 }
Ejemplo n.º 5
0
 public static void AssetProcessingComplete(Asset asset)
 {
     NotifyAdmin.AssetProcessingComplete(asset, asset.UploadedByUser);
 }
Ejemplo n.º 6
0
 public static void AssetDelegated(object sender, AssetDelegatedEventArgs e)
 {
     NotifyAdmin.AssetDelegated(e.Asset, e.User);
 }
Ejemplo n.º 7
0
 public static void FtpDownloadComplete(object sender, FtpDownloadCompleteEventArgs e)
 {
     m_Logger.DebugFormat("Enter NotifyEngine.FtpDownloadComplete");
     NotifyAdmin.FtpDownloadComplete(e.User, e.ServerMessages);
     m_Logger.DebugFormat("Exit NotifyEngine.FtpDownloadComplete");
 }
Ejemplo n.º 8
0
 public static void AssetWorkflowCancelled(object sender, AssetWorkflowEventArgs e)
 {
     m_Logger.DebugFormat("AssetWorkflowCancelled - AssetWorkflowId: {0}", e.AssetWorkflow.AssetWorkflowId);
     NotifyAdmin.AssetWorkflowCancelled(e.AssetWorkflow);
 }
Ejemplo n.º 9
0
 public static void AssetWorkflowRejected(object sender, AssetWorkflowRejectedEventArgs e)
 {
     m_Logger.DebugFormat("AssetWorkflowRejected - AssetWorkflowId: {0}", e.AssetWorkflow.AssetWorkflowId);
     NotifyAdmin.AssetWorkflowRejected(e.AssetWorkflow, e.RejectingUser);
 }
Ejemplo n.º 10
0
 public static void AssetWorkflowCommenterUpdated(object sender, AssetWorkflowCommenterEventArgs e)
 {
     m_Logger.DebugFormat("AssetWorkflowCommenterUpdated - AssetWorkflowCommenterId: {0}", e.AssetWorkflowCommenter.AssetWorkflowCommenterId);
     NotifyAdmin.AssetWorkflowCommenterUpdated(e.AssetWorkflowCommenter);
 }
Ejemplo n.º 11
0
 public static void NewUserOrderItemComment(object o, OrderItemCommentEventArgs e)
 {
     NotifyAdmin.NewOrderItemComment(e.Order, e.OrderItemComment);
 }
Ejemplo n.º 12
0
 public static void InvalidLoginAttempt(LoginSecurityException lsecex)
 {
     NotifyAdmin.InvalidLoginAttempt(lsecex);
 }
Ejemplo n.º 13
0
 public static void InvalidRegistrationAttempt(RegistrationSecurityException rsuex)
 {
     NotifyAdmin.InvalidRegistrationAttempt(rsuex);
 }