private async void Btn_Send_OnClicked(object sender, EventArgs e)
        {
            try
            {
                if (!CrossConnectivity.Current.IsConnected)
                {
                    await DisplayAlert(AppResources.Label_Error, AppResources.Label_Check_Your_Internet, AppResources.Label_OK);
                }
                else
                {
                    try
                    {
                        using (var client = new HttpClient())
                        {
                            if (!Txt_Email.Text.Contains("@"))
                            {
                                await DisplayAlert(AppResources.Label_Error, AppResources.Label_Please_Write_your_full_email, AppResources.Label_OK);

                                Txt_Email.Focus();
                            }
                            var formContent = new FormUrlEncodedContent(new[]
                            {
                                new KeyValuePair <string, string>("email", Txt_Email.Text),
                            });

                            var response = await client.PostAsync(Settings.WebsiteUrl + API_Request.API_Reset_password, formContent).ConfigureAwait(false);

                            response.EnsureSuccessStatusCode();
                            string json = await response.Content.ReadAsStringAsync();

                            var    data      = JsonConvert.DeserializeObject <Dictionary <string, object> >(json);
                            string apiStatus = data["api_status"].ToString();
                            if (apiStatus == "200")
                            {
                                UserDialogs.Instance.Toast(AppResources.Label_Email_Has_Been_Send);
                            }
                            else
                            {
                                JObject errors    = JObject.FromObject(data["errors"]);
                                var     errortext = errors["error_text"].ToString();
                                await DisplayAlert(AppResources.Label_Security, errortext, AppResources.Label_Retry);
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        var exception = ex.ToString();
                        UserDialogs.Instance.HideLoading();

                        await DisplayAlert(AppResources.Label_Error, exception, AppResources.Label_OK);
                    }
                }
            }
            catch (Exception ex)
            {
                var exception = ex.ToString();
            }
        }
示例#2
0
 void LimparCampos()
 {
     Txt_Email.Clear();
     Txt_Nome.Clear();
     Txt_Senha.Clear();
     Txt_ConfirmarSenha.Clear();
     CB_Tipo.Text        = "";
     Check_Senha.Checked = false;
 }
示例#3
0
 //
 //Controllers
 private void ClearTXT()
 {
     Txt_Nome.Clear();
     Txt_Email.Clear();
     txt_Cpf.Clear();
     txt_Cel.Clear();
     chk_WhatsApp.Checked = false;
     txt_Telefone.Clear();
     txt_Ramal.Clear();
     txt_Endereco.Clear();
     txt_Numero.Clear();
     txt_Bairro.Clear();
     lb_AuantityFound.Text = "-";
 }
示例#4
0
        //Raise a request for AscentialTest automation tool information.
        public void ZeenyxWebsite(string sFirstname, string sLastname, string sEmail, string sSubject, string sMessage)
        {
            Lnk_Contact.Click();

            Txt_FirstName.SendKeys(sFirstname);
            //Thread.Sleep(2000);
            //driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(3);
            Txt_LastName.SendKeys(sLastname);
            //driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(3);
            Txt_Email.SendKeys(sEmail);

            Dropdown_Subject.Click();
            SelectElement oSelect = new SelectElement(Dropdown_Subject);

            oSelect.SelectByText(sSubject);

            Txt_Message.SendKeys(sMessage);

            //driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(3);
        }
示例#5
0
        /// <summary>
        /// Limpando todos os TextBox
        /// </summary>
        private void LimparCampos()
        {
            Txt_Nome.Clear();
            Txt_Endereco.Clear();
            Txt_Email.Clear();
            Txt_Tipo.Text   = "";
            Txt_Estado.Text = "";
            Txt_Cidade.Clear();
            Txt_Bairro.Clear();
            Txt_Cep.Clear();
            Txt_Complemento.Clear();

            //Parte de Pessoa Física
            Txt_CPF.Clear();
            Txt_Celular.Clear();
            Txt_Sexo.Text = "";
            Txt_DataNacimento.Clear();

            //Parte Jurídica
            Txt_CNPJ.Clear();
            Txt_Contato.Clear();
            Txt_RazaoSocial.Clear();
            Txt_InscricaoEstadual.Clear();
        }
示例#6
0
 private void Btn_Logar_Click(object sender, EventArgs e)
 {
     if (Txt_Email.Text.Trim() == "")
     {
         processar = false;
         MessageBox.Show("Preencha o Login", "Enigma ADM System", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     if (Txt_Senha.Text.Trim() == "")
     {
         processar = false;
         MessageBox.Show("Preencha a Senha", "Enigma ADM System", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     if (processar)
     {
         Form_Load frm = new Form_Load();
         frm.Show();
         frm.Refresh();
         try
         {
             Usuario    u   = new Usuario();
             UsuarioDAL dal = new UsuarioDAL();
             u       = dal.Consultar(Txt_Email.Text.Trim().Replace(",", "."));
             u.Senha = Txt_Senha.Text.Trim();
             if (u.ID == 0)
             {
                 frm.Close();
                 MessageBox.Show("Usuário inexistente", "Enigma ADM System", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
             else
             {
                 if (u.TipoConta.Trim() == "C" || u.TipoConta.Trim() == "A")
                 {
                     if (dal.Logar(u.Email, u.Senha))
                     {
                         Form_Menu frmmenu = new Form_Menu();
                         UsuarioAtual.ID        = u.ID;
                         UsuarioAtual.Email     = u.Email;
                         UsuarioAtual.Nome      = u.Nome;
                         UsuarioAtual.Senha     = null;
                         UsuarioAtual.TipoConta = u.TipoConta;
                         UsuarioAtual.Foto      = u.Foto;
                         this.Visible           = false;
                         frmmenu.Show();
                         Txt_Email.Clear();
                         Txt_Senha.Clear();
                     }
                     else
                     {
                         frm.Close();
                         MessageBox.Show("Login ou Senha incorreto", "EnigmaADMSys", MessageBoxButtons.OK, MessageBoxIcon.Error);
                     }
                 }
                 else
                 {
                     frm.Close();
                     MessageBox.Show("Seu usuário não tem permissão para acessar !", "EnigmaADMSys", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 }
             }
         }
         catch
         {
             frm.Close();
             MessageBox.Show("Erro de Conexão. Tente novamente", "EnigmaADMSys", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         frm.Close();
     }
     processar = true;
 }