Beispiel #1
0
 private QuotaValidationResult CheckTotal()
 {
     if (EmailCountersStorage.Total > EmailsTotalQuota)
     {
         var quotaExceedData = QuotaExceedData.Create(EmailQuotaType.TotalSentEmails, EmailsTotalQuota, EmailCountersStorage.Total);
         return(QuotaValidationResult.GetValidationExccedResult(quotaExceedData));
     }
     return(QuotaValidationResult.Success);
 }
Beispiel #2
0
        private QuotaValidationResult CheckEmailValidationsTotal(string emailAddress)
        {
            int totalValidationsValue = EmailCountersStorage.EmailVerificationsTotal[emailAddress];

            if (totalValidationsValue > EmailValidationsTotalQuota)
            {
                var quotaExceedData = QuotaExceedData.Create(EmailQuotaType.EmailVerificationGlobally, EmailValidationsTotalQuota, totalValidationsValue);
                return(QuotaValidationResult.GetValidationExccedResult(quotaExceedData));
            }
            return(QuotaValidationResult.Success);
        }
Beispiel #3
0
        private QuotaValidationResult CheckEmailValidationWithUserId(int userId)
        {
            int userValidationValue = EmailCountersStorage.EmailVerificationsByUserId[userId];

            if (userValidationValue > EmailValidationByUserIdQuota)
            {
                var quotaExceedData = QuotaExceedData.Create(EmailQuotaType.EmailVerificationByUserId, EmailValidationByUserIdQuota, userValidationValue);
                return(QuotaValidationResult.GetValidationExccedResult(quotaExceedData));
            }
            return(QuotaValidationResult.Success);
        }
Beispiel #4
0
        private QuotaValidationResult CheckEmailValidationWithEmail(string emailAddress)
        {
            int emailValidationValue = EmailCountersStorage.EmailVerificationsByEmail[emailAddress];

            if (emailValidationValue > EmailValidationByEmailQuota)
            {
                var quotaExceedData = QuotaExceedData.Create(EmailQuotaType.EmailVerificationByEmail, EmailValidationByEmailQuota, emailValidationValue);
                return(QuotaValidationResult.GetValidationExccedResult(quotaExceedData));
            }
            return(QuotaValidationResult.Success);
        }
Beispiel #5
0
        private QuotaValidationResult CheckTotalByEmail(string emailAddress)
        {
            int totalByEmailValue = EmailCountersStorage.TotalByEmail[emailAddress];

            if (totalByEmailValue > TotalByEmailQuota)
            {
                var quotaExceedData = QuotaExceedData.Create(EmailQuotaType.SameEmailAddress, TotalByEmailQuota, totalByEmailValue);
                return(QuotaValidationResult.GetValidationExccedResult(quotaExceedData));
            }
            return(QuotaValidationResult.Success);
        }