예제 #1
0
        protected void Unnamed_ServerClick1(object sender, EventArgs e)
        {
            Buscadores bus = new Buscadores();
            string     a   = txtpatente.Value;

            using (aplicadaBDEntities DBF = new aplicadaBDEntities())
            {
                vehiculo objvehiculo = bus.buscarvehiculo(a);
                if (objvehiculo != null)
                {
                    ordenestado ordenestado = new ordenestado();
                    orden       orden       = bus.buscarordenporvehiculo(objvehiculo.id_vehiculo);
                    if (orden != null)
                    {
                        ordenestado = bus.buscarvestadoorden(orden.id_orden);
                    }
                    if ((orden == null) || (ordenestado.estado == null) || (ordenestado.estado == 4))
                    {
                        NoAuto.Visible = false;
                        RecargarAuto();
                        VerGrid();
                        A1.Visible           = true;
                        btnServicios.Visible = true;
                    }
                    else
                    {
                        Label3.Text    = "EL VEHICULO YA POSEE UNA ORDEN ACTIVA";
                        NoAuto.Visible = true;
                    }
                }
                else
                {
                    NoAuto.Visible = true;
                    Label3.Text    = "PONER ENTRE DE 6 Y 7 CARACTERES";
                    int b = txtpatente.Value.Length;
                    if (b >= 6 && b <= 7)
                    {
                        NoAuto.Visible            = false;
                        Dmodelo.Visible           = true;
                        modelito.Visible          = true;
                        txtmodelo.Visible         = false;
                        txtmarca.Visible          = false;
                        btnAgregarcliente.Visible = true;
                        txtaño.Disabled           = false;
                        btnGuardar.Visible        = Visible;
                    }
                }
            }
        }