Ejemplo n.º 1
0
        private void Invite()
        {
            if (EmailInvite != string.Empty && EmailInvite != null)
            {
                Validators.EmailValidator validator = new Validators.EmailValidator();

                var result = validator.Validate(EmailInvite);

                if (result.IsValid)
                {
                    CancelAllSearch();
                    Invite item = new ShopIt.Core.Models.Invite();
                    item.InviteeEmail = EmailInvite;
                    Invites.Add(new InviteCreateProjectItemViewModel(this, item));
                    Mvx.Resolve <ITrackingService>().SendEvent("Invite a user on create project");
                    RaisePropertyChanged("Invites");
                    EmailInvite           = string.Empty;
                    IsShowButtonTapInvite = false;
                }
                else if (result.Errors != null)
                {
                    var firstError = result.Errors.First();
                    mMessageboxService.ShowToast(firstError.ErrorMessage);
                }
            }
            else
            {
                View.HidenKeyboard();
            }
        }
Ejemplo n.º 2
0
        public bool IsValid()
        {
            var validation = new Validators.EmailValidator();
            var result     = validation.Validate(this);

            ValidationErrors = result.Errors;
            return(result.IsValid);
        }
Ejemplo n.º 3
0
        public void SendPasswordResetEmailAddressNotFound(string emailAddress)
        {
            var email = new Email {
                Address = emailAddress
            };
            var validator = new Validators.EmailValidator();

            if (!validator.TryValidate(email))
            {
                return;
            }

            Task.Run(async() => {
                System.Net.Mail.MailMessage msg = _emailGenerator.GenerateMessage(new PasswordResetEmailAddressNotFoundModel {
                    EmailAddress = emailAddress,
                    BaseUrl      = Settings.Current.AppUrl,
                }, "PasswordResetEmailAddressNotFound");
                msg.To.Add(email.Address);
                await QueueMessageAsync(msg).AnyContext();
            });
        }