コード例 #1
0
 private Boolean valido()
 {
     Utiles validador = new Utiles();
     string error = null;
     if (this.dni.Text == "" || !validador.IsNumber(this.dni.Text))
     {
         error = "El DNI no puede ser nulo y solo debe contener numeros\n";
     }
     if (error != null)
     {
         MessageBox.Show(error);
         return false;
     }
     return true;
 }
コード例 #2
0
        private bool valido()
        {
            Utiles validador = new Utiles();
            string error = null;

            if (this.año.Text == "") { this.año.Text = "0"; }

            if (Convert.ToString(this.comboBox1.SelectedItem) == "")
            {
                error = "Debe seleccionar un listado para consultar.\n";
            }
            if (!validador.IsNumber(this.año.Text) || Convert.ToInt32(this.año.Text) < (Convert.ToInt32(DateTime.Today.Year) - 10))
            {
                error = error + "El año ingresado es inválido, debe tener sólo números y no puede ser mayor a 10 años.\n";
            }
            if (error != null)
            {
                MessageBox.Show(error);
                return false;
            }
            return true;
        }
コード例 #3
0
 private bool valido()
 {
     Utiles validador = new Utiles();
     string error = null;
     if (this.dni.Text == "" || !validador.IsNumber(this.dni.Text))
     {
         error = "El DNI no puede ser nulo y solo debe contener numeros\n";
     }
     if (this.nombre.Text == "")
     {
         error = error + "El nombre no puede ser nulo\n";
     }
     if (this.apellido.Text == "")
     {
         error = error + "El apellido no puede ser vacio\n";
     }
     if (this.direccion.Text == "")
     {
         error = error + "La direccion no puede ser nula\n";
     }
     if (this.fechaNacimiento.Value > DateTime.Today)
     {
         error = error + "La fecha de nacimiento no puede ser mayor al día de hoy\n";
     }
     if (this.telefono.Text == "" || !validador.IsNumber(this.telefono.Text))
     {
         error = error + "El telefono no puede ser nulo y solo debe contener numeros\n";
     }
     if (responsableEncomienda != null && this.cantidadPasajeros > 0 && this.butacas.Text == "" || this.butacas.SelectedIndex == -1)
     {
         error = error + "Debe seleccionar una butaca\n";
     }
     if (!this.clienteDisponible())
     {
         error = error + "El ya tiene un vuelo programado para las fechas del vuelo seleccionado\n";
     }
     if (error != null)
     {
         MessageBox.Show(error);
         return false;
     }
     return true;
 }
コード例 #4
0
 private Boolean validoDniDuplicado()
 {
     Utiles validador = new Utiles();
     string error = null;
     if (this.dni.Text == "" || !validador.IsNumber(this.dni.Text))
     {
         error = "El DNI no puede ser nulo y solo debe contener numeros\n";
     }
     if (this.nombre.Text == "")
     {
         error = error + "El nombre no puede ser nulo\n";
     }
     if (this.apellido.Text == "")
     {
         error = error + "El apellido no puede ser vacio\n";
     }
     if (error != null)
     {
         MessageBox.Show(error);
         return false;
     }
     return true;
 }
コード例 #5
0
        private void dni_TextChanged(object sender, EventArgs e)
        {
            try {
                Utiles validador = new Utiles();
                if (this.dni.Text != "" && validador.IsNumber(this.dni.Text))
                {
                    GD2C2015DataSet.ClientesRow[] result = (GD2C2015DataSet.ClientesRow[])this.gD2C2015DataSet.Clientes.Select("cli_dni='" + Convert.ToInt32(this.dni.Text) + "' AND cli_activo=1");
                    if (result.Length == 1)
                    {
                        GD2C2015DataSet.ClientesRow row = result.First();
                        this.nombre.Text = row.cli_nombre;
                        this.apellido.Text = row.cli_apellido;
                        this.direccion.Text = row.cli_direccion;
                        this.telefono.Text = row.cli_telefono.ToString();
                        this.mail.Text = row.cli_mail;
                        this.fechaNacimiento.Value = row.cli_fecha_nacimiento;
                        this.clienteId = row.cli_id;
                    }
                    else if (result.Length > 1)
                    {
                        this.buscar.Show();
                        MessageBox.Show("Ingrese el nombre y apellido y presione el botón Buscar");
                    }
                    else
                    {
                        limpiarDatos();
                    }
                }
                else
                {
                    limpiarDatos();
                }
            }
            catch (System.OverflowException)
            {

            }
        }
コード例 #6
0
 private Boolean datosCompraValidos()
 {
     Utiles validador = new Utiles();
     string error = null;
     if (clienteId == 0)
     {
         error = "Debe seleccionar un comprador\n";
     }
     if (this.pagaTarjeta)
     {
         if (this.numeroTarjeta.Text.Length < 12 || !validador.IsNumber(this.numeroTarjeta.Text))
         {
             error = error + "El número de tarjeta debe tener 12 números\n";
         }
         if (this.codigoSeguridad.Text.Length < 3 || !validador.IsNumber(this.codigoSeguridad.Text))
         {
             error = error + "El código de seguridad debe tener 3 números\n";
         }
         if (this.mesVenciemiento.SelectedIndex == -1)
         {
             error = error + "Debe seleccionar un mes de vencimiento\n";
         }
         if (this.anioVencimiento.SelectedIndex == -1)
         {
             error = error + "Debe seleccionar un año de vencimiento\n";
         }
         if (this.cuotas.SelectedIndex == -1)
         {
             error = error + "Debe seleccionar la cantidad de cuotas\n";
         }
         if (this.tipoTarjeta.SelectedIndex == -1)
         {
             error = error + "Debe seleccionar la tarjeta\n";
         }
     }
     if (error != null)
     {
         MessageBox.Show(error);
         return false;
     }
     return true;
 }
コード例 #7
0
 private bool compradorValido()
 {
     Utiles validador = new Utiles();
     string error = null;
     if (this.dni.Text == "" || !validador.IsNumber(this.dni.Text))
     {
         error = "El DNI no puede ser nulo y solo debe contener numeros\n";
     }
     if (this.nombre.Text == "")
     {
         error = error + "El nombre no puede ser nulo\n";
     }
     if (this.apellido.Text == "")
     {
         error = error + "El apellido no puede ser vacio\n";
     }
     if (this.direccion.Text == "")
     {
         error = error + "La direccion no puede ser nula\n";
     }
     if (this.telefono.Text == "" || !validador.IsNumber(this.telefono.Text))
     {
         error = error + "El telefono no puede ser nulo y solo debe contener numeros\n";
     }
     if (error != null)
     {
         MessageBox.Show(error);
         return false;
     }
     return true;
 }
コード例 #8
0
 private bool validoVuelo()
 {
     Utiles validador = new Utiles();
     string error = null;
     if (this.cantidadPasajeros.Text == "" && this.pesoEncomienda.Text == "")
     {
         error = error + "Debe ingresar al menos un valor en alguno de los campos: cantidad pasajeros y/o kg encomienda\n";
     }
     if (!validador.IsNumber(this.cantidadPasajeros.Text))
     {
         error = error + "El campo cantidad de pasajeros debe ser numerico\n";
     }
     if (!validador.IsNumber(this.pesoEncomienda.Text))
     {
         error = error + "El campo peso encomienda debe ser numerico\n";
     }
     if (error != null)
     {
         MessageBox.Show(error);
         return false;
     }
     return true;
 }
コード例 #9
0
        private bool valido()
        {
            Utiles validador = new Utiles();
            String errores = "";

            if ((this.kgEncomientasText.Text == "") || (!validador.IsNumber(this.kgEncomientasText.Text)))
            {
                errores = "Kg Encomiendas. ";
            }

            if ((this.ButacasPasilloText.Text == "") || (!validador.IsNumber(this.ButacasPasilloText.Text)))
            {
                errores = errores + "Butacas Pasillo. ";
            }

            if ((this.ButacasVentanillaText.Text == "") || (!validador.IsNumber(this.ButacasVentanillaText.Text)))
            {
                errores = errores + "Butacas Ventanilla. ";
            }

            if (this.ComboTipoServicio.SelectedIndex < 0)
            {
                errores = errores + "Tipo de Servicio. ";
            }

            if (this.matriculaText.Text == "")
            {
                errores = errores + "Matricula. ";
            }

            if (this.modeloText.Text == "")
            {
                errores = errores + "Modelo. ";
            }

            if (this.FabricateTextBox.Text == "")
            {
                errores = errores + "Fabricante. ";
            }
            if (errores != "")
            {
                MessageBox.Show("Debe completar los siguientes campos(o completarlos con valores validos): " + errores, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return false;
            }
            return true;
        }