예제 #1
0
        /// <summary>
        /// validate create country translation.
        /// </summary>
        /// <param name="countryTranslationFormData">the countryTranslationFormData to validate.</param>
        /// <returns>true if the proportises are valide.</returns>
        public bool ValidateCountryTranslationFormData(CountryTranslationFormData countryTranslationFormData)
        {
            List <string> errors = new List <string>();

            if (countryTranslationFormData == null)
            {
                errors.Add(SharedResources.NullFormData);
            }
            else
            {
                errors.AddRange(
                    GenericValidationAttribute <CountryTranslationFormData> .ValidateAttributes("CountrySummary",
                                                                                                countryTranslationFormData.CountrySummary));
                errors.AddRange(
                    GenericValidationAttribute <CountryTranslationFormData> .ValidateAttributes("CountryDescription",
                                                                                                countryTranslationFormData.CountryDescription));
                errors.AddRange(GenericValidationAttribute <CountryTranslationFormData> .ValidateAttributes("LanguageId",
                                                                                                            countryTranslationFormData.LanguageId.ToString()));
                errors.AddRange(
                    GenericValidationAttribute <CountryTranslationFormData> .ValidateAttributes("CountryTitle",
                                                                                                countryTranslationFormData.CountryTitle));
                errors.AddRange(GenericValidationAttribute <CountryTranslationFormData> .ValidateAttributes("CountryName",
                                                                                                            countryTranslationFormData.CountryName));
            }
            return(errors.Count == 0);
        }
예제 #2
0
        /// <summary>
        /// Validate update country translation list.
        /// </summary>
        /// <param name="request">the request to validate.</param>
        /// <returns>errors validation</returns>
        private List <string> ValidateUpdateCountryTranslationRange(CountryTranslationRequest request)
        {
            var errors = new List <string>();

            if (request?.CountryTranslationDtoList == null)
            {
                errors.Add(CountryMessageResource.NullRequest);
            }
            else
            {
                foreach (var translation in request.CountryTranslationDtoList)
                {
                    errors.AddRange(
                        GenericValidationAttribute <CountryTranslationDto> .ValidateAttributes("CountrySummary",
                                                                                               translation.CountrySummary));
                    errors.AddRange(
                        GenericValidationAttribute <CountryTranslationDto> .ValidateAttributes("CountryDescription",
                                                                                               translation.CountryDescription));
                    errors.AddRange(
                        GenericValidationAttribute <CountryTranslationDto> .ValidateAttributes("TranslationId",
                                                                                               translation.TranslationId.ToString()));
                    errors.AddRange(
                        GenericValidationAttribute <CountryTranslationDto> .ValidateAttributes("CountryTitle",
                                                                                               translation.CountryTitle));
                    errors.AddRange(
                        GenericValidationAttribute <CountryTranslationDto> .ValidateAttributes("CountryName",
                                                                                               translation.CountryName));
                }
            }
            return(errors);
        }
예제 #3
0
        /// <summary>
        /// Validate create country translation.
        /// </summary>
        /// <param name="request">the request to validate.</param>
        /// <returns>errors validation</returns>
        private List <string> ValidateCreateCountryTranslation(CountryTranslationRequest request)
        {
            var errors = new List <string>();

            if (request?.CountryTranslationDto == null)
            {
                errors.Add(CountryMessageResource.NullRequest);
            }
            else
            {
                errors.AddRange(GenericValidationAttribute <CountryTranslationDto> .ValidateAttributes("CountrySummary",
                                                                                                       request.CountryTranslationDto.CountrySummary));
                errors.AddRange(
                    GenericValidationAttribute <CountryTranslationDto> .ValidateAttributes("CountryDescription",
                                                                                           request.CountryTranslationDto.CountryDescription));
                errors.AddRange(GenericValidationAttribute <CountryTranslationDto> .ValidateAttributes("CountryId",
                                                                                                       request.CountryTranslationDto.CountryId.ToString()));
                errors.AddRange(GenericValidationAttribute <CountryTranslationDto> .ValidateAttributes("LanguageId",
                                                                                                       request.CountryTranslationDto.LanguageId.ToString()));
                errors.AddRange(GenericValidationAttribute <CountryTranslationDto> .ValidateAttributes("CountryTitle",
                                                                                                       request.CountryTranslationDto.CountryTitle));
                errors.AddRange(GenericValidationAttribute <CountryTranslationDto> .ValidateAttributes("CountryName",
                                                                                                       request.CountryTranslationDto.CountryName));
            }

            return(errors);
        }
예제 #4
0
        /// <summary>
        /// Validate find country translation.
        /// </summary>
        /// <param name="request">the request to validate.</param>
        /// <returns>errors validation</returns>
        private List <string> ValidateFindCountryTranslations(CountryTranslationRequest request)
        {
            var errors = new List <string>();

            if (request?.CountryTranslationDto == null)
            {
                errors.Add(CountryMessageResource.NullRequest);
            }
            else
            {
                switch (request.FindCountryTranslationDto)
                {
                case FindCountryTranslationDto.CountryId:
                    errors.AddRange(
                        GenericValidationAttribute <CountryTranslationDto> .ValidateAttributes("CountryId",
                                                                                               request.CountryTranslationDto.CountryId.ToString()));
                    break;

                case FindCountryTranslationDto.CountryTranslationId:
                    errors.AddRange(GenericValidationAttribute <CountryTranslationDto> .ValidateAttributes(
                                        "TranslationId", request.CountryTranslationDto.TranslationId.ToString()));
                    break;
                }
            }
            return(errors);
        }
예제 #5
0
        /// <summary>
        /// Validate update occurrence translation list.
        /// </summary>
        /// <param name="request">the request to validate.</param>
        /// <returns>errors validation</returns>
        private List <string> ValidateUpdateOccurrenceTranslationRange(OccurrenceTranslationRequest request)
        {
            var errors = new List <string>();

            if (request?.OccurrenceTranslationDtoList == null)
            {
                errors.Add(OccurrenceMessageResource.NullRequest);
            }
            else
            {
                foreach (var translation in request.OccurrenceTranslationDtoList)
                {
                    errors.AddRange(
                        GenericValidationAttribute <OccurrenceTranslationDto> .ValidateAttributes("OccurrenceDescription",
                                                                                                  translation.OccurrenceDescription));
                    errors.AddRange(
                        GenericValidationAttribute <OccurrenceTranslationDto> .ValidateAttributes("TranslationId",
                                                                                                  translation.TranslationId.ToString()));
                    errors.AddRange(
                        GenericValidationAttribute <OccurrenceTranslationDto> .ValidateAttributes("OccurrenceTitle",
                                                                                                  translation.OccurrenceTitle));
                }
            }
            return(errors);
        }
예제 #6
0
        /// <summary>
        /// validate create  sheet.
        /// </summary>
        /// <param name="sheetFormData">the sheetFormData to validate.</param>
        /// <returns>true if the proportises are valide.</returns>
        public bool ValidateSheet(SheetFormData sheetFormData)
        {
            List <string> errors = new List <string>();

            if (sheetFormData == null)
            {
                errors.Add(SharedResources.NullFormData);
            }
            else
            {
                errors.AddRange(GenericValidationAttribute <SheetFormData> .ValidateAttributes("CountryId", sheetFormData.CountryId.ToString()));
            }
            return(errors.Count == 0);
        }
예제 #7
0
        /// <summary>
        /// errors validation list.
        /// </summary>
        /// <param name="request">request to validate.</param>
        /// <returns></returns>
        private List <string> ValidateDeleteUser(UserRequest request)
        {
            var errors = new List <string>();

            if (request?.UserDto == null)
            {
                errors.Add(UserMessageResource.NullRequest);
            }
            else
            {
                errors.AddRange(GenericValidationAttribute <UserDto> .ValidateAttributes("UserId", request.UserDto.UserId.ToString()));
            }
            return(errors);
        }
        /// <summary>
        /// Validation delete partner.
        /// </summary>
        /// <param name="request">the request to validate.</param>
        /// <returns>errors validation</returns>
        private List <string> ValidateFindContactMessages(ContactMessageRequest request)
        {
            var errors = new List <string>();

            if (request?.ContactMessageDto == null)
            {
                errors.Add(ContactMessageResource.NullRequest);
            }
            else
            {
                errors.AddRange(GenericValidationAttribute <ContactMessageDto> .ValidateAttributes("ContactMessageId", request.ContactMessageDto.ContactMessageId.ToString()));
            }
            return(errors);
        }
예제 #9
0
        /// <summary>
        /// Validate find section translation.
        /// </summary>
        /// <param name="request">the request to validate.</param>
        /// <returns>errors validation</returns>
        private List <string> ValidateDeleteStepParagraphTranslation(StepParagraphTranslationRequest request)
        {
            var errors = new List <string>();

            if (request?.StepParagraphTranslationDto == null)
            {
                errors.Add(StepMessageResource.NullRequest);
            }
            else
            {
                errors.AddRange(GenericValidationAttribute <StepParagraphTranslationDto> .ValidateAttributes("TranslationId", request.StepParagraphTranslationDto.TranslationId.ToString()));
            }
            return(errors);
        }
예제 #10
0
        /// <summary>
        /// Validate create section translation.
        /// </summary>
        /// <param name="request">the request to validate.</param>
        /// <returns>errors validation</returns>
        private List <string> ValidateCreateStepParagraph(StepParagraphRequest request)
        {
            List <string> errors = new List <string>();

            if (request?.StepParagraphDto == null)
            {
                errors.Add(StepMessageResource.NullRequest);
            }
            else
            {
                errors.AddRange(GenericValidationAttribute <StepParagraphDto> .ValidateAttributes("StepId", request.StepParagraphDto.StepId.ToString()));
            }
            return(errors);
        }
예제 #11
0
        /// <summary>
        /// Validate delete activity file translation.
        /// </summary>
        /// <param name="request">the request to validate.</param>
        /// <returns>errors validation</returns>
        private List <string> ValidateDeleteNewsletterMailTranslation(NewsletterMailTranslationRequest request)
        {
            List <string> errors = new List <string>();

            if (request?.NewsletterMailTranslationDto == null)
            {
                errors.Add(NewsletterMailMessageResource.NullRequest);
            }
            else
            {
                errors.AddRange(GenericValidationAttribute <NewsletterMailTranslationDto> .ValidateAttributes("TranslationId", request.NewsletterMailTranslationDto.TranslationId.ToString()));
            }
            return(errors);
        }
예제 #12
0
        /// <summary>
        /// Validate create rule.
        /// </summary>
        /// <param name="request">the request to validate.</param>
        /// <returns>validation errors.</returns>
        private List <string> ValidateDeleteRule(RuleRequest request)
        {
            List <string> errors = new List <string>();

            if (request?.RuleDto == null)
            {
                errors.Add(RuleMessageResource.NullRequest);
            }
            else
            {
                errors.AddRange(GenericValidationAttribute <RuleDto> .ValidateAttributes("RuleId", request.RuleDto.RuleId.ToString()));
            }
            return(errors);
        }
예제 #13
0
        /// <summary>
        /// Validation delete news.
        /// </summary>
        /// <param name="request">the request to validate.</param>
        /// <returns>errors validation</returns>
        private List <string> ValidateDeleteNews(NewsRequest request)
        {
            var errors = new List <string>();

            if (request?.NewsDto == null)
            {
                errors.Add(NewsMessageResource.NullRequest);
            }
            else
            {
                errors.AddRange(GenericValidationAttribute <NewsDto> .ValidateAttributes("NewsId", request.NewsDto.NewsId.ToString()));
            }
            return(errors);
        }
예제 #14
0
        /// <summary>
        /// Validation delete subscriber.
        /// </summary>
        /// <param name="request">the request to validate.</param>
        /// <returns>errors validation</returns>
        private List <string> ValidateFindSubscribers(SubscriberRequest request)
        {
            var errors = new List <string>();

            if (request?.SubscriberDto == null)
            {
                errors.Add(SubscriberMessageResource.NullRequest);
            }
            else
            {
                errors.AddRange(GenericValidationAttribute <SubscriberDto> .ValidateAttributes("SubscriberId", request.SubscriberDto.SubscriberId.ToString()));
            }
            return(errors);
        }
예제 #15
0
        /// <summary>
        /// Validate delete Language.
        /// </summary>
        /// <param name="request">the request attribute to validate</param>
        /// <returns>errors validation</returns>
        private List <string> ValidateDeleteLanguage(LanguageRequest request)
        {
            var errors = new List <string>();

            if (request?.LanguageDto == null)
            {
                errors.Add(LanguageMessageResource.NullRequest);
            }
            else
            {
                errors.AddRange(GenericValidationAttribute <LanguageDto> .ValidateAttributes("LanguageId", request.LanguageDto.LanguageId.ToString()));
            }
            return(errors);
        }
예제 #16
0
        /// <summary>
        /// Validate delete country translation.
        /// </summary>
        /// <param name="request">the request to validate.</param>
        /// <returns>errors validation</returns>
        private List <string> ValidateDeleteSheet(SheetRequest request)
        {
            List <string> errors = new List <string>();

            if (request?.SheetDto == null)
            {
                errors.Add(CountryMessageResource.NullRequest);
            }
            else
            {
                errors.AddRange(GenericValidationAttribute <SheetDto> .ValidateAttributes("SheetId", request.SheetDto.SheetId.ToString()));
            }
            return(errors);
        }
예제 #17
0
        /// <summary>
        /// Validation delete occurrence.
        /// </summary>
        /// <param name="request">the request to validate.</param>
        /// <returns>errors validation</returns>
        private List <string> ValidateOccurrenceId(OccurrenceRequest request)
        {
            var errors = new List <string>();

            if (request?.OccurrenceDto == null)
            {
                errors.Add(OccurrenceMessageResource.NullRequest);
            }
            else
            {
                errors.AddRange(GenericValidationAttribute <OccurrenceDto> .ValidateAttributes("OccurrenceId",
                                                                                               request.OccurrenceDto.OccurrenceId.ToString()));
            }
            return(errors);
        }
예제 #18
0
        /// <summary>
        /// Validate create rule.
        /// </summary>
        /// <param name="request">the request to validate.</param>
        /// <returns>validation errors.</returns>
        private List <string> ValidateCreateRule(RuleRequest request)
        {
            List <string> errors = new List <string>();

            if (request?.RuleDto == null)
            {
                errors.Add(RuleMessageResource.NullRequest);
            }
            else
            {
                errors.AddRange(GenericValidationAttribute <RuleDto> .ValidateAttributes("RulePrefix", request.RuleDto.RulePrefix));
                errors.AddRange(GenericValidationAttribute <RuleDto> .ValidateAttributes("RuleName", request.RuleDto.RuleName));
            }
            return(errors);
        }
예제 #19
0
        /// <summary>
        /// validate create newsletterMail translation.
        /// </summary>
        /// <param name="newsletterMailTranslationFormData">the newsletterMailTranslationFormData to validate.</param>
        /// <returns>true if the proportises are valide.</returns>
        public bool ValidateUpdateNewsletterMailTranslationFormData(NewsletterMailTranslationFormData newsletterMailTranslationFormData)
        {
            List <string> errors = new List <string>();

            if (newsletterMailTranslationFormData == null)
            {
                errors.Add(SharedResources.NullFormData);
            }
            else
            {
                errors.AddRange(GenericValidationAttribute <NewsletterMailTranslationFormData> .ValidateAttributes("NewsletterMailSubject", newsletterMailTranslationFormData.NewsletterMailSubject));
                errors.AddRange(GenericValidationAttribute <NewsletterMailTranslationFormData> .ValidateAttributes("LanguageId", newsletterMailTranslationFormData.LanguageId.ToString()));
            }
            return(errors.Count == 0);
        }
예제 #20
0
        /// <summary>
        /// Validation update partner.
        /// </summary>
        /// <param name="request">the request to validate.</param>
        /// <returns>errors validation</returns>
        private List <string> ValidateUpdatePartner(PartnerRequest request)
        {
            var errors = new List <string>();

            if (request?.PartnerDto == null)
            {
                errors.Add(PartnerMessageResource.NullRequest);
            }
            else
            {
                errors.AddRange(GenericValidationAttribute <PartnerDto> .ValidateAttributes("PartnerName", request.PartnerDto.PartnerName));
                errors.AddRange(GenericValidationAttribute <PartnerDto> .ValidateAttributes("PartnerLink", request.PartnerDto.PartnerLink));
            }
            return(errors);
        }
예제 #21
0
        /// <summary>
        /// Validation update subscriber.
        /// </summary>
        /// <param name="request">the request to validate.</param>
        /// <returns>errors validation</returns>
        private List <string> ValidateUpdateSubscriber(SubscriberRequest request)
        {
            var errors = new List <string>();

            if (request?.SubscriberDto == null)
            {
                errors.Add(SubscriberMessageResource.NullRequest);
            }
            else
            {
                errors.AddRange(GenericValidationAttribute <SubscriberDto> .ValidateAttributes("SubscriberEmail", request.SubscriberDto.SubscriberEmail));
                errors.AddRange(GenericValidationAttribute <SubscriberDto> .ValidateAttributes("SubscriberLastName", request.SubscriberDto.SubscriberLastName));
                errors.AddRange(GenericValidationAttribute <SubscriberDto> .ValidateAttributes("SubscriberFirstName", request.SubscriberDto.SubscriberFirstName));
            }
            return(errors);
        }
예제 #22
0
        /// <summary>
        /// validate create  sheet translation.
        /// </summary>
        /// <param name="sheetTranslationFormData">the sheetTranslationFormData to validate.</param>
        /// <returns>true if the proportises are valide.</returns>
        public bool ValidateSheetTranslation(SheetTranslationFormData sheetTranslationFormData)
        {
            List <string> errors = new List <string>();

            if (sheetTranslationFormData == null)
            {
                errors.Add(SharedResources.NullFormData);
            }
            else
            {
                errors.AddRange(GenericValidationAttribute <SheetTranslationFormData> .ValidateAttributes("SheetValue", sheetTranslationFormData.SheetValue));
                errors.AddRange(GenericValidationAttribute <SheetTranslationFormData> .ValidateAttributes("LanguageId", sheetTranslationFormData.LanguageId.ToString()));
                errors.AddRange(GenericValidationAttribute <SheetTranslationFormData> .ValidateAttributes("SheetTitle", sheetTranslationFormData.SheetTitle));
            }
            return(errors.Count == 0);
        }
예제 #23
0
        /// <summary>
        /// create user rule validation.
        /// </summary>
        /// <param name="request">the request to validate.</param>
        /// <returns>errors validation</returns>
        private List <string> ValidateCreateUserRule(UserRuleRequest request)
        {
            var errors = new List <string>();

            if (request?.UserRuleDto == null)
            {
                errors.Add(UserRuleMessageResource.NullRequest);
            }
            else
            {
                errors.AddRange(GenericValidationAttribute <UserRuleDto> .ValidateAttributes("UserRuleStatus", request.UserRuleDto.UserRuleStatus.ToString()));
                errors.AddRange(GenericValidationAttribute <UserRuleDto> .ValidateAttributes("UserId", request.UserRuleDto.UserId.ToString()));
                errors.AddRange(GenericValidationAttribute <UserRuleDto> .ValidateAttributes("RuleId", request.UserRuleDto.RuleId.ToString()));
            }
            return(errors);
        }
예제 #24
0
        /// <summary>
        /// Validation creation country.
        /// </summary>
        /// <param name="request">the request to validate.</param>
        /// <returns>errors validation</returns>
        private List <string> ValidateCreateCountry(CountryRequest request)
        {
            var errors = new List <string>();

            if (request?.CountryDto == null)
            {
                errors.Add(CountryMessageResource.NullRequest);
            }
            else
            {
                errors.AddRange(GenericValidationAttribute <CountryDto> .ValidateAttributes("CountryImage",
                                                                                            request.CountryDto.CountryImage.ToString()));
            }

            return(errors);
        }
예제 #25
0
        /// <summary>
        /// validate create news translation.
        /// </summary>
        /// <param name="newsTranslationFormData">the newsTranslationFormData to validate.</param>
        /// <returns>true if the proportises are valide.</returns>
        public bool ValidateNewsTranslationFormData(NewsTranslationFormData newsTranslationFormData)
        {
            List <string> errors = new List <string>();

            if (newsTranslationFormData == null)
            {
                errors.Add(SharedResources.NullFormData);
            }
            else
            {
                errors.AddRange(GenericValidationAttribute <NewsTranslationFormData> .ValidateAttributes("NewsSummary", newsTranslationFormData.NewsSummary));
                errors.AddRange(GenericValidationAttribute <NewsTranslationFormData> .ValidateAttributes("NewsDescription", newsTranslationFormData.NewsDescription));
                errors.AddRange(GenericValidationAttribute <NewsTranslationFormData> .ValidateAttributes("LanguageId", newsTranslationFormData.LanguageId.ToString()));
                errors.AddRange(GenericValidationAttribute <NewsTranslationFormData> .ValidateAttributes("NewsTitle", newsTranslationFormData.NewsTitle));
            }
            return(errors.Count == 0);
        }
예제 #26
0
        /// <summary>
        /// Validate update news translation.
        /// </summary>
        /// <param name="request">the request to validate.</param>
        /// <returns>errors validation</returns>
        private List <string> ValidateUpdateNewsTranslation(NewsTranslationRequest request)
        {
            var errors = new List <string>();

            if (request?.NewsTranslationDto == null)
            {
                errors.Add(NewsMessageResource.NullRequest);
            }
            else
            {
                errors.AddRange(GenericValidationAttribute <NewsTranslationDto> .ValidateAttributes("NewsSummary", request.NewsTranslationDto.NewsSummary));
                errors.AddRange(GenericValidationAttribute <NewsTranslationDto> .ValidateAttributes("NewsDescription", request.NewsTranslationDto.NewsDescription));
                errors.AddRange(GenericValidationAttribute <NewsTranslationDto> .ValidateAttributes("TranslationId", request.NewsTranslationDto.TranslationId.ToString()));
                errors.AddRange(GenericValidationAttribute <NewsTranslationDto> .ValidateAttributes("NewsTitle", request.NewsTranslationDto.NewsTitle));
            }
            return(errors);
        }
예제 #27
0
        /// <summary>
        /// Validate Create Country Sheet Traslation.
        /// </summary>
        /// <param name="request">the request to validate.</param>
        /// <returns>errors validation</returns>
        private List <string> ValidateCreateSheetTranslation(SheetTranslationRequest request)
        {
            List <string> errors = new List <string>();

            if (request?.SheetTranslationDto == null)
            {
                errors.Add(CountryMessageResource.NullRequest);
            }
            else
            {
                errors.AddRange(GenericValidationAttribute <SheetTranslationDto> .ValidateAttributes("SheetValue", request.SheetTranslationDto.SheetValue));
                errors.AddRange(GenericValidationAttribute <SheetTranslationDto> .ValidateAttributes("SheetId", request.SheetTranslationDto.SheetId.ToString()));
                errors.AddRange(GenericValidationAttribute <SheetTranslationDto> .ValidateAttributes("LanguageId", request.SheetTranslationDto.LanguageId.ToString()));
                errors.AddRange(GenericValidationAttribute <SheetTranslationDto> .ValidateAttributes("SheetTitle", request.SheetTranslationDto.SheetTitle));
            }
            return(errors);
        }
예제 #28
0
        /// <summary>
        /// Validate create section translation.
        /// </summary>
        /// <param name="request">the request to validate.</param>
        /// <returns>errors validation</returns>
        private List <string> ValidateCreateStepParagraphTranslation(StepParagraphTranslationRequest request)
        {
            var errors = new List <string>();

            if (request?.StepParagraphTranslationDto == null)
            {
                errors.Add(StepMessageResource.NullRequest);
            }
            else
            {
                errors.AddRange(GenericValidationAttribute <StepParagraphTranslationDto> .ValidateAttributes("ParagraphDescription", request.StepParagraphTranslationDto.ParagraphDescription));
                errors.AddRange(GenericValidationAttribute <StepParagraphTranslationDto> .ValidateAttributes("ParagraphId", request.StepParagraphTranslationDto.ParagraphId.ToString()));
                errors.AddRange(GenericValidationAttribute <StepParagraphTranslationDto> .ValidateAttributes("LanguageId", request.StepParagraphTranslationDto.LanguageId.ToString()));
                errors.AddRange(GenericValidationAttribute <StepParagraphTranslationDto> .ValidateAttributes("ParagraphTitle", request.StepParagraphTranslationDto.ParagraphTitle));
            }
            return(errors);
        }
예제 #29
0
        /// <summary>
        /// validate create news.
        /// </summary>
        /// <param name="newsFormData">the newsFormData to validate.</param>
        /// <returns>true if the proportises are valide.</returns>
        public bool ValidateNewsFormData(NewsFormData newsFormData)
        {
            List <string> errors = new List <string>();

            if (newsFormData == null)
            {
                errors.Add(SharedResources.NullFormData);
            }
            else
            {
                errors.AddRange(
                    GenericValidationAttribute <NewsFormData> .ValidateAttributes("NewsImage",
                                                                                  newsFormData.NewsImage?.ToString()));
                errors.AddRange(
                    GenericValidationAttribute <NewsFormData> .ValidateAttributes("NewsDate", newsFormData.NewsDate));
            }
            return(errors.Count == 0);
        }
예제 #30
0
        /// <summary>
        /// Validate delete activity translation.
        /// </summary>
        /// <param name="request">the request to validate.</param>
        /// <returns>errors validation</returns>
        private List <string> ValidateFindNewsletterMail(NewsletterMailRequest request)
        {
            List <string> errors = new List <string>();

            if (request?.NewsletterMailDto == null)
            {
                errors.Add(NewsletterMailMessageResource.NullRequest);
            }
            else
            {
                switch (request.FindNewsletterMailDto)
                {
                case FindNewsletterMailDto.NewsletterMailId:
                    errors.AddRange(GenericValidationAttribute <NewsletterMailDto> .ValidateAttributes("NewsletterMailId", request.NewsletterMailDto.NewsletterMailId.ToString()));
                    break;
                }
            }
            return(errors);
        }