Exemplo n.º 1
0
        private void txtPlaca_TextChanged(object sender, TextChangedEventArgs e)
        {
            if (Validacion.IsValidPlaca(txtPlaca.Text) || (txtPlaca.Text) == "")
            {
                lblErrPlaca.Foreground = Brushes.Red;
                lblErrPlaca.Content    = "El brevete no es Valido";
            }
            else
            {
                veh = new BDVeh();
                lblErrPlaca.Content = "";
                if (veh.IsExistVeh(txtPlaca.Text))
                {
                    DataRow row = (veh.GetById(txtPlaca.Text)).Rows[0];
                    txtClase.Text      = row["clase"].ToString();
                    txtClase.IsEnabled = false;
                    txtSerie.Text      = row["serie"].ToString();
                    txtSerie.IsEnabled = false;
                }
                else
                {
                    txtClase.IsEnabled = true;
                    txtSerie.IsEnabled = true;

                    lblErrPlaca.Foreground = Brushes.Green;
                    lblErrPlaca.Content    = str;
                }
            }
        }
Exemplo n.º 2
0
 private void txtBusqueda_TextChanged_1(object sender, TextChangedEventArgs e)
 {
     if (bsqPlaca == false)
     {
         if (Validacion.IsValidCodPapeleta(txtBusqueda.Text) || (txtBusqueda.Text) == "")
         {
             lblErrBus.Content = "El Codigo de Papeleta no es Valido";
         }
         else
         {
             lblErrBus.Content = "";
         }
     }
     else
     {
         if (Validacion.IsValidPlaca(txtBusqueda.Text) || (txtBusqueda.Text) == "")
         {
             lblErrBus.Content = "La placa no es Valida";
         }
         else
         {
             lblErrBus.Content = "";
         }
     }
 }