private void TxtUsuario_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { TxtPass.Focus(); } }
private void TxtUser_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { TxtPass.Focus(); } }
private void BtnConfirm_Click(object sender, EventArgs e) { if (TxtUser.Text == "" || TxtPass.Text == "") { MessageBox.Show(this, "Eines der Felder ist leer.", "Fehlerhafte Eingabe!", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { // Check LoginData AuthHandler Auth = new AuthHandler(); AuthenticateResponse AuthData = new AuthenticateResponse(); try { AuthData = Auth.Authenticate(TxtUser.Text.ToString().Trim(), TxtPass.Text.ToString().Trim()); } catch (Exception ex) { MessageBox.Show(this, ex.Message.ToString(), "Fehlermeldung von Minecraft.net", MessageBoxButtons.OK, MessageBoxIcon.Error); TxtPass.Focus(); TxtPass.SelectAll(); return; } // Load users.xml Manager U = new Manager(); oUser.accessToken = AuthData.AccessToken; oUser.clientToken = AuthData.ClientToken; U.SaveAccount(oUser); DialogResult = DialogResult.OK; Close(); } }
protected void BtoIngresar_Click(object sender, EventArgs e) { if (TxtUsuario.Text.Length == 0) { LblMensaje.Text = "Campo requerido"; LblMensaje.Visible = true; TxtUsuario.Focus(); } else { if (TxtPass.Text.Length == 0) { LblMensaje.Text = "Campo requerido"; LblMensaje.Visible = true; TxtPass.Focus(); } else { if (TxtClinica.Text.Length == 0) { LblMensaje.Text = "Campo requerido"; LblMensaje.Visible = true; TxtClinica.Focus(); } else { LblMensaje.Text = "listo para ingresar"; LblMensaje.Enabled = true; } } } }
private async void Btn_acessar_Clicked(object sender, EventArgs e) { if (string.IsNullOrEmpty(TxtLogin.Text)) { await DisplayAlert("Aviso", "Ops, Algo errado, campo CPF vazio.", "Ok"); TxtLogin.Focus(); return; } if (string.IsNullOrEmpty(TxtPass.Text)) { await DisplayAlert("Aviso", "Ops, Algo errado, campo senha vazio.", "Ok"); TxtPass.Focus(); return; } this.IsBusy = true; await Delay(200); IDictionary <string, string> parametros = new Dictionary <string, string>(); parametros.Add("login", TxtLogin.Text.Replace("-", "").Replace(".", "")); parametros.Add("senha", TxtPass.Text); this.Logar(parametros); }
private bool isformvalid() { if (TxtUName.Text == "") { Response.Write("<script> alert ('Kullanıcı Adı Giriniz'); </script>"); TxtUName.Focus(); return(false); } else if (TxtPass.Text != TxtCPass.Text) { Response.Write("<script> alert ('Şifreler Aynı Olmalı'); </script>"); TxtPass.Focus(); return(false); } else if (TxtMail.Text == "") { Response.Write("<script> alert ('Email Adresi Giriniz'); </script>"); TxtMail.Focus(); return(false); } else if (TxtName.Text == "") { Response.Write("<script> alert ('Ad Soyad Giriniz'); </script>"); TxtName.Focus(); return(false); } return(true); }
private bool Validate() { if (string.IsNullOrEmpty(Txtnombre.Text)) { DisplayAlert("Error", "Debe ingresar un usuario", "Aceptar"); Txtnombre.Focus(); return(false); } else if (string.IsNullOrEmpty(TxtPass.Text)) { DisplayAlert("Error", "Debe ingresar una Contraseña", "Aceptar"); TxtPass.Focus(); return(false); } return(true); }
private bool Validate() { if (string.IsNullOrEmpty(TxtUsername.Text)) { DisplayAlert("Error", "Debe ingresar un nombre de usuario", "Aceptar"); TxtUsername.Focus(); return(false); } else if (string.IsNullOrEmpty(TxtEmail.Text)) { DisplayAlert("Error", "Debe ingresar un Correo Válido", "Aceptar"); TxtEmail.Focus(); return(false); } else if (string.IsNullOrEmpty(TxtPass.Text)) { DisplayAlert("Error", "Debe ingresar una Contraseña", "Aceptar"); TxtPass.Focus(); return(false); } else if (TxtPass.Text != TxtPassC.Text) { DisplayAlert("Error", "Las contraseñas no coinciden", "Aceptar"); TxtPass.Focus(); return(false); } try { MailAddress m = new MailAddress(TxtEmail.Text); } catch (FormatException) { DisplayAlert("Alerta", "Correo electrónico inválido", "Ok"); return(false); } Regex rgx = new Regex(@"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^\da-zA-Z]).{8,15}$"); if (!rgx.IsMatch(TxtPass.Text)) { DisplayAlert("Error", "La contraseña debe contener de 8-15 caracteres; al menos 1 Mayúscula, Minúscula, Digito y Caracter especial", "OK"); return(false); } return(true); }
protected void TxtUsuario_TextChanged(object sender, EventArgs e) { if (TxtUsuario.Text == String.Empty) { string script = @"<script type='text/javascript'> alert('Campos vacíos...!!');</script>"; ScriptManager.RegisterStartupScript(this, typeof(Page), "alerta", script, false); //MessageBox.Show("Campos Vacíos...!!", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information); TxtPass.Text = ""; TxtPass.Enabled = false; } else { TxtUsuario.Text = varios.formatearRutcP(TxtUsuario.Text); TxtPass.Enabled = true; TxtPass.Focus(); } }
public bool Validar() { bool retorno = true; if (string.IsNullOrEmpty((CmbInstancia.Text))) { errorP1.SetError(CmbInstancia, "Debe ingresar la instancia."); CmbInstancia.Focus(); retorno = false; } else { errorP1.SetError(CmbInstancia, ""); } if (string.IsNullOrEmpty((TxtBaseDatos.Text))) { errorP1.SetError(TxtBaseDatos, "Debe ingresar la base de datos."); TxtBaseDatos.Focus(); retorno = false; } else { errorP1.SetError(TxtBaseDatos, ""); } if (string.IsNullOrEmpty((TxtPass.Text))) { errorP1.SetError(TxtPass, "Debe ingresar la contraseña."); TxtPass.Focus(); retorno = false; } else { errorP1.SetError(TxtPass, ""); } return(retorno); }
private async void BuscarUsuario(IDictionary <string, string> cpf_buscar) { try { string retorno = CallWS.ChamaWs(cpf_buscar, "BuscarUsuario"); XDocument xml = XDocument.Parse(retorno); var dados = (from s in xml.Descendants("DadosUsuario") select new { dsTipo = s.Element("dsTipo").Value }).ToList(); if (dados.Count == 0) { await Navigation.PushAsync(new usuCad()); } else { if (dados[0].dsTipo == "APP") { await DisplayAlert("Alerta", "Bem vindo novamente, esse CPF já está cadastrado, " + "digite sua senha para acessar sua conta", "Aceitar"); TxtPass.Focus(); } else { await Navigation.PushAsync(new usuCad()); } } } catch { await DisplayAlert("Erro", "Não foi possível iniciar um novo cadastro agora!", "OK"); } }
private void BtnSave_Click(object sender, EventArgs e) { if (TxtUser.Text == "" || TxtPass.Text == "") { MessageBox.Show(this, "Eines der Felder ist leer.", "Fehlerhafte Eingabe!", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { // Check LoginData AuthHandler Auth = new AuthHandler(); AuthenticateResponse AuthData = new AuthenticateResponse(); try { AuthData = Auth.Authenticate(TxtUser.Text.ToString().Trim(), TxtPass.Text.ToString().Trim()); } catch (MCInvalidCredentialsException ex) { MessageBox.Show(this, ex.Message.ToString(), "Fehlermeldung von Minecraft.net", MessageBoxButtons.OK, MessageBoxIcon.Error); TxtPass.Focus(); TxtPass.SelectAll(); return; } catch (MCUserMigratedException ex) { MessageBox.Show(this, ex.Message.ToString(), "Fehlermeldung von Minecraft.net", MessageBoxButtons.OK, MessageBoxIcon.Error); TxtPass.Focus(); TxtPass.SelectAll(); return; } catch (Exception ex) { MessageBox.Show(this, ex.Message.ToString(), "Verbindungsfehler", MessageBoxButtons.OK, MessageBoxIcon.Error); TxtPass.Focus(); TxtPass.SelectAll(); return; } MCUserAccount newAcc = new MCUserAccount { guid = Guid.NewGuid(), profiles = new List <MCUserAccountProfile>(), accessToken = AuthData.AccessToken, clientToken = AuthData.ClientToken, username = TxtUser.Text.ToString().Trim(), activeProfile = AuthData.SelectedProfile.Id }; for (int i = 0; i < AuthData.AvailableProfiles.Length; i++) { MCUserAccountProfile newprofile = new MCUserAccountProfile { id = AuthData.AvailableProfiles[i].Id, name = AuthData.AvailableProfiles[i].Name, legacy = AuthData.AvailableProfiles[i].Legacy }; newAcc.profiles.Add(newprofile); } Manager U = new Manager(); U.AddAccount(newAcc); // set default user if only one given MCUser user = U.GetAccounts(); if (U.GetNumAccounts() == 1) { U.SetDefault(newAcc.guid); } DialogResult = DialogResult.OK; Close(); } }
private void CmdAceptar_Click(object sender, EventArgs e) { DataTable dtResult = new DataTable(); if (TxtUsuario.Text == "") { MessageBox.Show("¡ Nombre del usuario incorrectos, Ingrese otro !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); TxtUsuario.Focus(); return; } if (TxtPass.Text == "") { MessageBox.Show("¡ Password incorrecto, Ingrese otro !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); TxtPass.Focus(); return; } ObternerBD(n_IdEmpresa); if (intOportunidades <= 3) { CN_sys_usuarios objUsuario = new CN_sys_usuarios(); objUsuario.mysConec = Program.mysConeccion; dtResult = objUsuario.TraerUsuario(TxtUsuario.Text, TxtPass.Text, Convert.ToInt32(Program.STU_SISTEMA.EMPRESAID), Convert.ToInt32(Program.STU_SISTEMA.SYS_UNIUSU)); intOportunidades = intOportunidades + 1; if (dtResult.Rows.Count == 0) { MessageBox.Show("¡ Usuario o Password incorrectos, Ingrese otro !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); } else { Program.STU_SISTEMA.USUARIOALIAS = TxtUsuario.Text; Program.STU_SISTEMA.USUARIOID = Convert.ToInt32(dtResult.Rows[0]["n_id"].ToString()); Program.STU_SISTEMA.USUARIOPERFIL = Convert.ToInt32(dtResult.Rows[0]["n_idperfil"].ToString()); this.Hide(); this.Close(); FrmSelEmpresa miForm = new FrmSelEmpresa(); miForm.n_VienedelMenu = 0; miForm.mysConec = mysConeccion; miForm.ShowDialog(); //this.Hide(); //this.Close(); //FrmMenu10 xFrmMenu = new FrmMenu10(); //Program.STU_SISTEMA.USUARIOALIAS = TxtUsuario.Text; //Program.STU_SISTEMA.USUARIOID = Convert.ToInt32(dtResult.Rows[0]["n_id"].ToString()); //Program.STU_SISTEMA.USUARIOPERFIL = Convert.ToInt32(dtResult.Rows[0]["n_idperfil"].ToString()); //objTC.mysConec = mysConeccion; //objTC.TraerTC(DateTime.Now.ToString("dd/MM/yyyy"), 151); //dtResult = objTC.dtLista; //if (dtResult.Rows.Count != 0) //{ // Program.STU_SISTEMA.TIPOCAMBIO = Convert.ToDouble(dtResult.Rows[0]["n_impven"]); // objTC = null; //} //else //{ // Program.STU_SISTEMA.TIPOCAMBIO = 0; //} //Program.GuardarIngreso(1); //xFrmMenu.ShowDialog(); } } else { MessageBox.Show("¡ Ha excedido el numero de oportunidades para ingresar al sistema !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); mysConeccion = null; this.Close(); Close(); } }
private void selection_changed(object sender, SelectionChangedEventArgs e) { TxtPass.Clear(); TxtPass.Focus(); }
protected void BtnReg_Click(object sender, EventArgs e) { if (TxtCity.SelectedValue == "-1") { TxtCity.Focus(); showErrorMwssage(4); } else if (DdlLicensCode.SelectedValue == "-1") { DdlLicensCode.Focus(); showErrorMwssage(5); } else { if (GlobFuncs.IsExist(TxtEmail.Text.ToString()) == true) { TxtEmail.Focus(); showErrorMwssage(6); } else if (checkbox1.Checked != true) { showErrorMwssage(7); } else if (TxtName.Text.Length == 0) { TxtName.Focus(); showErrorMwssage(8); } else if (TxtAddress.Text.Length == 0) { TxtAddress.Focus(); showErrorMwssage(9); } else if (TxtId.Text.Length == 0) { TxtId.Focus(); showErrorMwssage(10); } else if (TxtDateOfBirth.Text.Length == 0) { TxtDateOfBirth.Focus(); showErrorMwssage(11); } else if (TxtLicenseNumber.Text.Length == 0) { TxtLicenseNumber.Focus(); showErrorMwssage(12); } else if (TxtDateOfIssuanceLicense.Text.Length == 0) { TxtDateOfIssuanceLicense.Focus(); showErrorMwssage(13); } else if (TxtEmail.Text.Length == 0) { TxtEmail.Focus(); showErrorMwssage(14); } else if (TxtPass.Text.Length == 0) { TxtPass.Focus(); showErrorMwssage(15); } else if (TxtPhone.Text.Length == 0) { TxtPhone.Focus(); showErrorMwssage(16); } else { string pass = GlobFuncs.Hash(TxtPass.Text.ToString()); Users Us = new Users(-1, TxtName.Text.ToString(), TxtAddress.Text.ToString(), int.Parse(TxtCity.Text.ToString()), TxtId.Text.ToString(), DateTime.Parse(TxtDateOfBirth.Text), TxtLicenseNumber.Text.ToString(), int.Parse(DdlLicensCode.Text.ToString()), DateTime.Parse(TxtDateOfIssuanceLicense.Text), TxtEmail.Text.ToString(), pass, TxtPhone.Text.ToString()); person per = new person(); per = Us.RegUser(); sendRegMessage(per.CustomId, 0.ToString(), per.FullName); Session["Person"] = per; Response.Redirect("PrivateArea.aspx"); } } }