Example #1
0
        public async Task CmdSendMail()
        {
            IsSendMailVisible = false;
            StateHasChanged();


            await WebApi.CmdSendMail(LocalData.CurrTSUser.Email.Trim(), EmailOperationsEnum.PasswordChange);

            IsSendMailVisible     = false;
            IsEmailedCodeDisabled = false;
            IsButtonDisabled      = false;


            StateHasChanged();
        }
        public async Task CmdSendMail()
        {
            IsSendMailVisible = false;
            StateHasChanged();

            if (!string.IsNullOrEmpty(tsUser.Email))
            {
                tsUser.Email = tsUser.Email.Trim();
            }

            if (string.IsNullOrEmpty(tsUser.Email.Trim()))
            {
                LocalFunctions.AddError("Please enter email", MethodBase.GetCurrentMethod(), true, false);
            }
            else
            {
                if (LocalFunctions.CheckEmailFormat(tsUser.Email.Trim()))
                {
                    if (await WebApi.CmdCheckEmailNotExists(tsUser.Email.Trim()))
                    {
                        await WebApi.CmdSendMail(tsUser.Email.Trim(), EmailOperationsEnum.Registration);

                        IsSendMailVisible     = false;
                        IsEmailedCodeDisabled = false;
                        IsButtonDisabled      = false;
                    }
                    else
                    {
                        IsSendMailVisible     = true;
                        IsEmailedCodeDisabled = true;
                        IsButtonDisabled      = false;
                    }
                }
                else
                {
                    LocalFunctions.AddError("Email format is not correct", MethodBase.GetCurrentMethod(), true, false);
                }
            }


            StateHasChanged();
        }