public ValidationResult Validate(DataForm form)
        {
            ValidationResult result        = new ValidationResult(true);
            EmailSentForm    emailSentForm = (EmailSentForm)form;

            if (emailSentForm.EmailFrom.Length == 0)
            {
                result.Result       = false;
                result.ErrorMessage = "Email From can not be empty";
            }

            if (emailSentForm.EmailTos.Length == 0)
            {
                result.Result       = false;
                result.ErrorMessage = "Email Tos can not be empty";
            }

            if (emailSentForm.EmailSubject.Length == 0)
            {
                result.Result       = false;
                result.ErrorMessage = "Email Subject can not be empty";
            }

            if (emailSentForm.EmailContent.Length == 0)
            {
                result.Result       = false;
                result.ErrorMessage = "Email Content can not be empty";
            }

            return(result);
        }
Beispiel #2
0
        public string UpdateEmailSent(EmailSentForm emailSentForm)
        {
            DefaultController defaultController = new DefaultController(EmailSentService.Keywords.EMAILSENT);

            defaultController.FormValidator = new EmailSentFormValidator();

            OperationResult result = defaultController.Update(emailSentForm);

            return(Serializer.Json.Serialize(result));
        }