protected void lstPlacaVehiculo_SelectedIndexChanged(object sender, EventArgs e)
        {
            VehiculoServiceClient servVehiculo = new VehiculoServiceClient();

            try
            {
                List<VehiculoBE> lstVehiculo = new List<VehiculoBE>(servVehiculo.ConsultarVehiculo(lstPlacaVehiculo.SelectedItem.Text));

                foreach(VehiculoBE datos in lstVehiculo)
                {
                    TxtConductor.Text = datos.Conductor.Nombres_Conductor+" "+datos.Conductor.Apellido_1+" "+datos.Conductor.Apellido_2;
                    LblRutaVehiculo.Text = datos.Ruta.Nombre_Ruta;

                }
                DivConductor.Visible = true;

            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servVehiculo.Close();
            }
        }
Beispiel #2
0
        protected void Ubica_SelectedIndexChanged(object sender, EventArgs e)
        {
            VehiculoServiceClient servVehiculo = new VehiculoServiceClient();

            try
            {
                if (lstUbica.SelectedItem.ToString() == Ubicacion.VEHICULO.ToString())
                {
                    lstPlacaVehiculo.DataSource     = servVehiculo.ConsultarVehiculo(string.Empty);
                    lstPlacaVehiculo.DataValueField = "Id_Vehiculo";
                    lstPlacaVehiculo.DataTextField  = "Placa";
                    lstPlacaVehiculo.DataBind();
                    diVehiculo.Visible = true;
                    lstPlacaVehiculo.Focus();
                }
                else
                {
                    diVehiculo.Visible   = false;
                    DivConductor.Visible = false;
                    lstPlacaVehiculo.Controls.Clear();
                }
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }

            finally
            {
                servVehiculo.Close();
                BtnGuardar.Visible = true;
            }
        }
Beispiel #3
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            VehiculoServiceClient servVehiculo = new VehiculoServiceClient();
            long resp;

            ContratistaBE contratista = new ContratistaBE();

            try
            {
                contratista.Cedula    = txtCedulaCont.Text;
                contratista.Nombres   = txtNombreContratista.Text;
                contratista.Apellidos = txtPrimerApellido.Text;
                contratista.Direccion = txtDireccion.Text;
                contratista.Telefono  = txtTelefono.Text;
                resp = servVehiculo.RegistrarContratista(contratista);

                MessageBox.Show("El Contratista fue registrado satisfactoriamente", "Registrar Contratista");
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servVehiculo.Close();
                Response.Redirect("~/Vehiculos/frmRegistrarContratista.aspx");
                txtCedula.Focus();
            }
        }
        protected void lstUbicacion_SelectedIndexChanged(object sender, EventArgs e)
        {
            VehiculoServiceClient serVehiculo = new VehiculoServiceClient();

            try
            {
                if (lstUbicacion.SelectedItem.Text == Ubicacion.VEHICULO.ToString())
                {
                    lstPlacaVehículo.DataSource     = serVehiculo.ConsultarVehiculo(string.Empty);
                    lstPlacaVehículo.DataValueField = "Id_Vehiculo";
                    lstPlacaVehículo.DataTextField  = "Placa";
                    lstPlacaVehículo.DataBind();
                    divPlaca.Visible = true;
                }
                else
                {
                    divPlaca.Visible = true;
                }
            }

            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                serVehiculo.Close();
            }
        }
        protected void txtCedula_TextChanged(object sender, EventArgs e)
        {
            ClienteServiceClient  servCliente = new ClienteServiceClient();
            VehiculoServiceClient servVeh     = new VehiculoServiceClient();
            DataTable             table       = new DataTable();
            long resp;

            try
            {
                resp = servCliente.ConsultarExistenciasClientes(txtCedula.Text);

                if (resp == 0)
                {
                    MessageBox.Show("El cliente no se encuentra registrado en el sistema", "Registrar Pedido");
                    divInfoCliente.Visible = false;
                    txtCedula.Text         = "";
                    txtCedula.Focus();
                }

                else
                {
                    ClienteBE objCliente = servCliente.Consultar_Cliente(txtCedula.Text);

                    txtCedulaCli.Text       = objCliente.Cedula;
                    lblIdCedula.Text        = objCliente.Id_Cliente;
                    txtNombreCliente.Text   = objCliente.Nombres_Cliente;
                    txtPrimerApellido.Text  = objCliente.Apellido_1;
                    txtSegundoApellido.Text = objCliente.Apellido_2;
                    table.Columns.Add("IdUbicacion");
                    table.Columns.Add("Direccion");
                    table.Columns.Add("Barrio");
                    table.Columns.Add("Telefono");
                    table.Columns.Add("Ciudad");

                    foreach (UbicacionBE datos in objCliente.ListaDirecciones)
                    {
                        table.Rows.Add(datos.Id_Ubicacion, datos.Direccion, datos.Barrio, datos.Telefono_1, datos.Ciudad.Nombre_Ciudad);
                        gvDirecciones.DataSource = table;
                        gvDirecciones.DataBind();
                    }
                    divDirCliente.Visible  = true;
                    divInfoCliente.Visible = true;
                    lstTamanos.Focus();
                    txtCedula.Text           = "";
                    btnMenuPrincipal.Visible = true;
                }
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servCliente.Close();
                servVeh.Close();
            }
        }
Beispiel #6
0
        protected void txtPlaca1_TextChanged(object sender, EventArgs e)
        {
            VehiculoServiceClient serVehiculo = new VehiculoServiceClient();
            long resp;

            try
            {
                resp = serVehiculo.ConsultarExistenciaVehiculo(txtPlaca1.Text);

                if (resp != 0)
                {
                    MessageBox.Show("El vehículo ya se encuentra registrado en el sistema", "Registrar Vehículo");
                    txtPlaca1.Text                 = "";
                    DivVehiculo.Visible            = false;
                    DivSelRuta.Visible             = false;
                    DivDatosPropietario.Visible    = false;
                    DivConsultaPropietario.Visible = false;
                    DivAsignacionConductor.Visible = false;
                    DivDatosConductor.Visible      = false;
                    txtPlaca1.Focus();
                    txtMarca.Text        = "";
                    txtCilindraje.Text   = "";
                    txtMotor.Text        = "";
                    txtChasis.Text       = "";
                    txtApellidos.Text    = "";
                    txtCedConductor.Text = "";
                    txtCedula.Text       = "";
                    txtCedula2.Text      = "";
                    txtNombreCond.Text   = "";
                    txtNombres.Text      = "";
                }


                else
                {
                    txtPlaca.Text  = txtPlaca1.Text;
                    txtPlaca1.Text = "";
                    txtMarca.Focus();
                    DivVehiculo.Visible            = true;
                    DivDatosPropietario.Visible    = true;
                    DivSelRuta.Visible             = true;
                    DivAsignacionConductor.Visible = true;
                    lblCedula1.Visible             = true;
                    txtCedula1.Visible             = true;
                    btnGuardar.Visible             = true;
                }
            }

            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                serVehiculo.Close();
            }
        }
        protected void lstCaso_SelectedIndexChanged(object sender, EventArgs e)
        {
            VehiculoServiceClient servVehiculo = new VehiculoServiceClient();
            DataTable             table        = new DataTable();

            try
            {
                if (lstCaso.SelectedItem.Text == Tipo_Casos.CODIGO.ToString() + " " + Tipo_Casos.ERRADO.ToString())
                {
                    divCodCorrecto.Visible = true;
                    SetFocus(txtCodigoVerific);
                }
                else
                {
                    divCodCorrecto.Visible = false;
                }

                if (lstCaso.SelectedItem.Text == Tipo_Casos.ESCAPE.ToString())
                {
                    divEscape.Visible = true;
                    SetFocus(lstCilEntrega);
                    List <Ubicacion_CilindroBE> lstCilVehiculos = new List <Ubicacion_CilindroBE>(servVehiculo.ConsultarCilPorVehiculo("1"));

                    if (lstCilVehiculos.Count == 0)
                    {
                        MessageBox.Show("El vehículo no tiene cilindros cargados", "Casos Especiales");
                        btnGuardar.Visible = false;
                        lstCaso.Items.RemoveAt(lstCaso.SelectedIndex);
                        divCodCorrecto.Visible   = false;
                        lstCilEntrega.Visible    = false;
                        lblCodigoVerific.Visible = false;
                    }
                    else
                    {
                        foreach (Ubicacion_CilindroBE datos in lstCilVehiculos)
                        {
                            lstCilEntrega.Items.Add(datos.Cilindro.Codigo_Cilindro);
                        }
                    }
                }
                else
                {
                    divEscape.Visible = false;
                }
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servVehiculo.Close();
                divGrid.Visible = true;
            }
        }
Beispiel #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                txtCodigoCilindro.Focus();
                btnMenu.Visible = true;
                ReporteServiceClient  servReporte  = new ReporteServiceClient();
                VehiculoServiceClient servVehiculo = new VehiculoServiceClient();

                try
                {
                    lstUbicacion.DataSource     = servReporte.ConsultaTipoUbicacion().Skip(1);
                    lstUbicacion.DataValueField = "Id_Tipo_Ubica";
                    lstUbicacion.DataTextField  = "Nombre_Ubicacion";
                    lstUbicacion.DataBind();

                    lstTamano.DataSource     = servReporte.ConsultaTamanoCilindro();
                    lstTamano.DataValueField = "Id_Tamano";
                    lstTamano.DataTextField  = "Tamano";
                    lstTamano.DataBind();

                    //Anos[] anos = Auxiliar.ConsultarAnos();
                    //IEnumerable<Anos> listaAnos = anos.Skip(1).OrderByDescending(g => g);
                    //foreach (Anos datosAnos in listaAnos)
                    //{
                    //    lstAno.Items.Add(datosAnos.ToString());
                    //}

                    lstPlacas.DataSource     = servVehiculo.ConsultarVehiculo(string.Empty);
                    lstPlacas.DataValueField = "Id_Vehiculo";
                    lstPlacas.DataTextField  = "Placa";
                    lstPlacas.DataBind();
                }
                catch (Exception ex)
                {
                    Response.Redirect("~/About.aspx");
                }

                finally
                {
                    servVehiculo.Close();
                    servReporte.Close();
                }
            }
        }
Beispiel #9
0
        protected void txtCedula1_TextChanged(object sender, EventArgs e)
        {
            VehiculoServiceClient servVehiculo = new VehiculoServiceClient();

            VehiculoBE consultar_conductor = new VehiculoBE();
            long       resp;

            try
            {
                resp = servVehiculo.ConsultarExistenciaConductor(txtCedula1.Text);

                if (resp == 0)
                {
                    MessageBox.Show("El conductor no se encuentra registrado en el sistema", "Registro de Vehículos");

                    txtCedula1.Text             = "";
                    txtCedConductor.Text        = "";
                    txtNombreCond.Text          = "";
                    txtSegundoApellidoCond.Text = "";
                    txtPrimerApellidoCond.Text  = "";
                    DivDatosConductor.Visible   = false;
                    txtCedula1.Focus();
                }
                else
                {
                    ConductorBE objConductor = servVehiculo.Consultar_Conductor(txtCedula1.Text);
                    txtCedConductor.Text        = objConductor.Cedula;
                    txtNombreCond.Text          = objConductor.Nombres_Conductor;
                    txtPrimerApellidoCond.Text  = objConductor.Apellido_1;
                    txtSegundoApellidoCond.Text = objConductor.Apellido_2;
                    DivDatosConductor.Visible   = true;
                    btnGuardar.Visible          = true;
                    txtCedula1.Text             = "";
                    btnGuardar.Focus();
                }
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servVehiculo.Close();
            }
        }
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            VehiculoServiceClient servVehiculo = new VehiculoServiceClient();

            long resp;
            VehiculoBE modificar_vehiculo = new VehiculoBE();

            try
            {
                modificar_vehiculo.Placa = txtPlaca.Text;
                modificar_vehiculo.Marca = txtMarca.Text;
                modificar_vehiculo.Cilindraje = txtCilindraje.Text;
                modificar_vehiculo.Modelo = lstModelo.SelectedValue;
                modificar_vehiculo.Motor = txtMotor.Text;
                modificar_vehiculo.Chasis = txtChasis.Text;
                modificar_vehiculo.Estado = lstEstado.SelectedValue;

                ConductorBE cond = new ConductorBE();
                cond.Cedula = lblImprimirCedula.Text;
                modificar_vehiculo.Conductor = cond;

                RutaBE rutaasig = new RutaBE();
                rutaasig.Id_Ruta = lstRuta.SelectedValue;
                modificar_vehiculo.Ruta = rutaasig;

                ContratistaBE contratista = new ContratistaBE();
                contratista.Cedula = txtCedula2.Text;
                modificar_vehiculo.Contratista = contratista;

                resp = servVehiculo.Modificar_Vehiculo(modificar_vehiculo);

                MessageBox.Show("El vehículo fue modificado satisfactoriamente", "Modificar Vehículo");
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servVehiculo.Close();
                Response.Redirect("~/Vehiculos/frmModificarVehiculo.aspx");
            }
        }
Beispiel #11
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            VehiculoServiceClient servVehiculo = new VehiculoServiceClient();

            long       resp;
            VehiculoBE registrar_vehiculo = new VehiculoBE();

            try
            {
                registrar_vehiculo.Placa      = txtPlaca.Text;
                registrar_vehiculo.Marca      = txtMarca.Text;
                registrar_vehiculo.Cilindraje = txtCilindraje.Text;
                registrar_vehiculo.Modelo     = lstModelo.SelectedValue;
                registrar_vehiculo.Motor      = txtMotor.Text;
                registrar_vehiculo.Chasis     = txtChasis.Text;
                registrar_vehiculo.Estado     = lstEstado.SelectedValue;

                ConductorBE cond = new ConductorBE();
                cond.Cedula = txtCedConductor.Text;
                registrar_vehiculo.Conductor = cond;

                ContratistaBE contrat = new ContratistaBE();
                contrat.Cedula = txtCedula2.Text;
                registrar_vehiculo.Contratista = contrat;

                RutaBE rutaasig = new RutaBE();
                rutaasig.Id_Ruta        = lstRuta.SelectedValue;
                registrar_vehiculo.Ruta = rutaasig;

                resp = servVehiculo.Registrar_Vehiculo(registrar_vehiculo);

                MessageBox.Show("El vehículo fue registrado satisfactoriamente", "Registrar Vehículo");
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servVehiculo.Close();
                Response.Redirect("~/Vehiculos/frmRegistrarVehiculo.aspx");
            }
        }
        protected void txtCedulaCond_TextChanged(object sender, EventArgs e)
        {
            VehiculoServiceClient servVehiculo = new VehiculoServiceClient();
            VehiculoBE            vehiculo     = new VehiculoBE();

            try
            {
                ////Conductor_VehiculoBE cond_veh = new Conductor_VehiculoBE();
                ////vehiculo.Conductor_Vehiculo =cond_veh;

                ////ConductorBE cond = new ConductorBE();
                ////cond.Cedula = txtCedulaCond.Text;
                ////cond_veh.Conductor= cond;


                ////VehiculoBE consulta = servVehiculo.Consultar_Conductor(txtCedulaCond.Text);

                ////if (consulta.Conductor_Vehiculo.Conductor.Cedula != txtCedulaCond.Text)
                ////    {
                ////        lblImprimirCedula.Text = consulta.Conductor_Vehiculo.Conductor.Cedula;
                ////        txtNombreCond.Text = consulta.Conductor_Vehiculo.Conductor.Nombres_Conductor;
                ////        txtPrimerApellidoCond.Text = consulta.Conductor_Vehiculo.Conductor.Apellido_1;
                ////        txtSegundoApellidoCond.Text = consulta.Conductor_Vehiculo.Conductor.Apellido_2;
                ////        txtCedulaCond.Text = "";
                ////    }

                ////    else
                ////    {
                ////        MessageBox.Show("El conductor no se encuentra registrado en el sistema", "Asignar Conductor");
                ////    }

                ////    txtRuta.Focus();
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servVehiculo.Close();
            }
        }
        protected void txtCedula_TextChanged(object sender, EventArgs e)
        {
            VehiculoServiceClient servVehiculo = new VehiculoServiceClient();

            long resp;

            try
            {
                resp = servVehiculo.ConsultarExistenciaConductor(txtCedula.Text);

                if (resp != 0)
                {
                    MessageBox.Show("El Conductor ya se encuentra registrado en el sistema", "Registrar Conductor");
                    divInfoConductor.Visible = false;
                    btnGuardar.Visible       = false;
                    txtCedulaCond.Text       = "";
                    txtCedula.Text           = "";
                    txtDireccion.Text        = "";
                    txtPrimerApellido.Text   = "";
                    txtNombreConductor.Text  = "";
                    txtTelefono.Text         = "";
                    txtCedula.Focus();
                }
                else
                {
                    divInfoConductor.Visible = true;
                    btnGuardar.Visible       = true;
                    txtNombreConductor.Focus();
                    txtCedulaCond.Text = txtCedula.Text;
                    txtCedula.Text     = "";
                }
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servVehiculo.Close();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            txtCedula.Focus();

            if (!Page.IsPostBack)
            {
                PedidoServiceClient servPed = new PedidoServiceClient();

                objdtLista = new DataTable();
                CrearTabla();
                CargaInicialGridView();
            }

            if (!IsPostBack)
            {
                ReporteServiceClient  servReporte  = new ReporteServiceClient();
                VehiculoServiceClient servVehiculo = new VehiculoServiceClient();

                try
                {
                    lstTamanos.DataSource     = servReporte.ConsultaTamanoCilindro();
                    lstTamanos.DataValueField = "Id_Tamano";
                    lstTamanos.DataTextField  = "Tamano";
                    lstTamanos.DataBind();

                    lstPlacas.DataSource     = servVehiculo.ConsultarVehiculo(string.Empty);
                    lstPlacas.DataValueField = "Id_Vehiculo";
                    lstPlacas.DataTextField  = "Placa";
                    lstPlacas.DataBind();
                }
                catch (Exception ex)
                {
                    Response.Redirect("~/About.aspx");
                }
                finally
                {
                    servReporte.Close();
                    servVehiculo.Close();
                }
            }
        }
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            VehiculoServiceClient servVehiculo= new VehiculoServiceClient();
            long resp;

            ConductorBE conductor = new ConductorBE();

            try
            {
                conductor.Cedula = txtCedulaCond.Text;
                conductor.Nombres_Conductor = txtNombreConductor.Text.ToUpper();
                conductor.Apellido_1 = txtPrimerApellido.Text.ToUpper();
                conductor.Apellido_2 = txtSegundoApellido.Text.ToUpper();
                conductor.Direccion = txtDireccion.Text.ToUpper();
                conductor.Barrio = txtBarrio.Text.ToUpper();
                conductor.Telefono = txtTelefono.Text;

                CiudadBE ciucli = new CiudadBE();
                ciucli.Nombre_Ciudad = lstCiudad.SelectedValue;

                DepartamentoBE depcli = new DepartamentoBE();
                depcli.Nombre_Departamento = lstDepartamento.SelectedValue;
                ciucli.Departamento = depcli;
                conductor.Ciudad = ciucli;

                resp = servVehiculo.RegistrarConductor(conductor);

                MessageBox.Show("El conductor fue registrado satisfactoriamente", "Registrar Conductor");

            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servVehiculo.Close();
                Response.Redirect("~/Vehiculos/frmRegistrarConductor.aspx");
            }
        }
Beispiel #16
0
        protected void txtCedula_TextChanged(object sender, EventArgs e)
        {
            VehiculoServiceClient servVehiculo = new VehiculoServiceClient();

            try
            {
                long consultarPropVehiculo = servVehiculo.ConsultarExistenciaContratista(txtCedula.Text);

                if (consultarPropVehiculo != 0)
                {
                    txtCedula2.Text = txtCedula.Text;
                    ContratistaBE objContratista = servVehiculo.ConsultarPropVehiculo(txtCedula2.Text);
                    txtCedula.Text    = "";
                    txtNombres.Text   = objContratista.Nombres;
                    txtApellidos.Text = objContratista.Apellidos;
                    DivConsultaPropietario.Visible = true;
                    txtCedula1.Focus();
                }
                else
                {
                    MessageBox.Show("El propietario no se encuentra registrado en el sistema", "Registro de Vehículos");

                    txtCedula.Text    = "";
                    txtCedula2.Text   = "";
                    txtNombres.Text   = "";
                    txtApellidos.Text = "";
                    DivConsultaPropietario.Visible = false;
                    txtCedula.Focus();
                }
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servVehiculo.Close();
            }
        }
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            VehiculoServiceClient servVehiculo = new VehiculoServiceClient();
            long resp;

            ConductorBE conductor = new ConductorBE();

            try
            {
                conductor.Cedula            = txtCedulaCond.Text;
                conductor.Nombres_Conductor = txtNombreConductor.Text.ToUpper();
                conductor.Apellido_1        = txtPrimerApellido.Text.ToUpper();
                conductor.Apellido_2        = txtSegundoApellido.Text.ToUpper();
                conductor.Direccion         = txtDireccion.Text.ToUpper();
                conductor.Barrio            = txtBarrio.Text.ToUpper();
                conductor.Telefono          = txtTelefono.Text;

                CiudadBE ciucli = new CiudadBE();
                ciucli.Nombre_Ciudad = lstCiudad.SelectedValue;

                DepartamentoBE depcli = new DepartamentoBE();
                depcli.Nombre_Departamento = lstDepartamento.SelectedValue;
                ciucli.Departamento        = depcli;
                conductor.Ciudad           = ciucli;

                resp = servVehiculo.RegistrarConductor(conductor);

                MessageBox.Show("El conductor fue registrado satisfactoriamente", "Registrar Conductor");
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servVehiculo.Close();
                Response.Redirect("~/Vehiculos/frmRegistrarConductor.aspx");
            }
        }
Beispiel #18
0
        protected void lstPlacaVehiculo_SelectedIndexChanged(object sender, EventArgs e)
        {
            VehiculoServiceClient servVehiculo = new VehiculoServiceClient();

            try
            {
                List <VehiculoBE> lstVehiculo = new List <VehiculoBE>(servVehiculo.ConsultarVehiculo(lstPlacaVehiculo.SelectedItem.Text));

                foreach (VehiculoBE datos in lstVehiculo)
                {
                    TxtConductor.Text    = datos.Conductor.Nombres_Conductor + " " + datos.Conductor.Apellido_1 + " " + datos.Conductor.Apellido_2;
                    LblRutaVehiculo.Text = datos.Ruta.Nombre_Ruta;
                }
                DivConductor.Visible = true;
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servVehiculo.Close();
            }
        }
        protected void txtCedula_TextChanged(object sender, EventArgs e)
        {
            ClienteServiceClient servCliente = new ClienteServiceClient();
            VehiculoServiceClient servVeh = new VehiculoServiceClient();
            DataTable table = new DataTable();
            long resp;
            try
            {
                resp = servCliente.ConsultarExistenciasClientes(txtCedula.Text);

               if (resp == 0)
               {
                   MessageBox.Show("El cliente no se encuentra registrado en el sistema", "Registrar Pedido");
                   divInfoCliente.Visible = false;
                   txtCedula.Text = "";
                   txtCedula.Focus();
               }

               else
               {
                   ClienteBE objCliente = servCliente.Consultar_Cliente(txtCedula.Text);

                   txtCedulaCli.Text = objCliente.Cedula;
                   lblIdCedula.Text = objCliente.Id_Cliente;
                   txtNombreCliente.Text = objCliente.Nombres_Cliente;
                   txtPrimerApellido.Text = objCliente.Apellido_1;
                   txtSegundoApellido.Text = objCliente.Apellido_2;
                   table.Columns.Add("IdUbicacion");
                   table.Columns.Add("Direccion");
                   table.Columns.Add("Barrio");
                   table.Columns.Add("Telefono");
                   table.Columns.Add("Ciudad");

                   foreach (UbicacionBE datos in objCliente.ListaDirecciones)
                   {
                       table.Rows.Add(datos.Id_Ubicacion, datos.Direccion, datos.Barrio, datos.Telefono_1, datos.Ciudad.Nombre_Ciudad);
                       gvDirecciones.DataSource = table;
                       gvDirecciones.DataBind();
                   }
                   divDirCliente.Visible = true;
                   divInfoCliente.Visible = true;
                   lstTamanos.Focus();
                   txtCedula.Text = "";
                   btnMenuPrincipal.Visible = true;
               }
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servCliente.Close();
                servVeh.Close();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            txtCedula.Focus();

            if (!Page.IsPostBack)
            {
                PedidoServiceClient servPed = new PedidoServiceClient();

                objdtLista = new DataTable();
                CrearTabla();
                CargaInicialGridView();
            }

            if (!IsPostBack)
            {
                ReporteServiceClient servReporte = new ReporteServiceClient();
                VehiculoServiceClient servVehiculo = new VehiculoServiceClient();

                try
                {
                    lstTamanos.DataSource = servReporte.ConsultaTamanoCilindro();
                    lstTamanos.DataValueField = "Id_Tamano";
                    lstTamanos.DataTextField = "Tamano";
                    lstTamanos.DataBind();

                    lstPlacas.DataSource = servVehiculo.ConsultarVehiculo(string.Empty);
                    lstPlacas.DataValueField = "Id_Vehiculo";
                    lstPlacas.DataTextField = "Placa";
                    lstPlacas.DataBind();
                }
                catch (Exception ex)
                {
                    Response.Redirect("~/About.aspx");
                }
                finally
                {
                    servReporte.Close();
                    servVehiculo.Close();
                }
            }
        }
Beispiel #21
0
        protected void lstOpcion_SelectedIndexChanged(object sender, EventArgs e)
        {
            lstPlaca.Focus();
            CilindroServiceClient servCilindro = new CilindroServiceClient();
            VehiculoServiceClient serVehiculo  = new VehiculoServiceClient();

            string    datoUbica = null;
            DataTable table     = new DataTable();

            try
            {
                table.Columns.Add("CodigosCil");
                table.Columns.Add("Tamano");
                table.Columns.Add("TipoCil");

                if (lstOpcion.SelectedIndex == 1)
                {
                    datoUbica = Ubicacion.PLATAFORMA.ToString();
                    DivUbicacionCil.Visible = true;
                    BtnGuardar.Visible      = true;
                    lstPlaca.Visible        = true;
                    gvCargue.Visible        = true;
                }
                else
                {
                    datoUbica = Ubicacion.VEHICULO.ToString();
                    DivUbicacionCil.Visible = true;
                    BtnGuardar.Visible      = true;
                    lstPlaca.Visible        = true;
                    gvCargue.Visible        = true;
                }

                Session["lstDetail"] = lstDetail;
                List <Ubicacion_CilindroBE> datosConsulta = new List <Ubicacion_CilindroBE>(servCilindro.ConsultarCilUbicacion(datoUbica));

                if (datosConsulta.Count == 0)
                {
                    BtnGuardar.Visible      = false;
                    lstPlaca.Visible        = false;
                    gvCargue.Visible        = false;
                    DivUbicacionCil.Visible = false;
                    MessageBox.Show("La opción seleccionada no contiene registros", "Cargue o descargue de Cilindro");
                }
                else
                {
                    lstPlaca.DataSource     = serVehiculo.ConsultarVehiculo(string.Empty);
                    lstPlaca.DataValueField = "Id_Vehiculo";
                    lstPlaca.DataTextField  = "Placa";
                    lstPlaca.DataBind();

                    foreach (Ubicacion_CilindroBE datos in datosConsulta)
                    {
                        table.Rows.Add(datos.Cilindro.Codigo_Cilindro, datos.Cilindro.Tipo_Cilindro, datos.Cilindro.NTamano.Tamano);
                    }
                    gvCargue.DataSource = table;
                    gvCargue.DataBind();
                }
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servCilindro.Close();
                serVehiculo.Close();
            }
        }
        protected void txtPlaca1_TextChanged(object sender, EventArgs e)
        {
            RutaServicesClient    servRuta     = new RutaServicesClient();
            VehiculoServiceClient servVehiculo = new VehiculoServiceClient();
            long resp;

            try
            {
                resp = servVehiculo.ConsultarExistenciaVehiculo(txtPlaca1.Text);

                if (resp == 0)
                {
                    MessageBox.Show("El vehículo no se encuentra registrado en el sistema", "Modificar Vehículo");
                    DivAsignacionConductor.Visible = false;
                    DivPropietario.Visible         = false;
                    DivSelRuta.Visible             = false;
                    DivVehiculo.Visible            = false;
                    txtPlaca1.Text = "";
                    txtPlaca1.Focus();
                }

                else
                {
                    List <VehiculoBE> lstVehiculo = new List <VehiculoBE>(servVehiculo.ConsultarVehiculo(txtPlaca1.Text));

                    foreach (VehiculoBE datos in lstVehiculo)
                    {
                        txtPlaca.Text      = txtPlaca1.Text;
                        txtMarca.Text      = datos.Marca;
                        txtCilindraje.Text = datos.Cilindraje;
                        lstModelo.Items.Add(datos.Modelo);
                        Anos[]             anos      = Auxiliar.ConsultarAnos();
                        IEnumerable <Anos> listaAnos = anos.OrderByDescending(g => g).Skip(0);
                        foreach (Anos datosAnos in listaAnos)
                        {
                            lstModelo.Items.Add(datosAnos.ToString());
                        }
                        txtMotor.Text  = datos.Motor;
                        txtChasis.Text = datos.Chasis;
                        lstEstado.Items.Add(datos.Estado);
                        List <string> estado = Auxiliar.ConsultaEstado();
                        foreach (string datoEstado in estado)
                        {
                            lstEstado.Items.Add(datoEstado);
                        }
                        txtCedula2.Text             = datos.Contratista.Cedula;
                        txtNombre.Text              = datos.Contratista.Nombres;
                        txtApellidos.Text           = datos.Contratista.Apellidos;
                        lblImprimirCedula.Text      = datos.Conductor.Cedula;
                        txtNombreCond.Text          = datos.Conductor.Nombres_Conductor;
                        txtPrimerApellidoCond.Text  = datos.Conductor.Apellido_1;
                        txtSegundoApellidoCond.Text = datos.Conductor.Apellido_2;
                        lstRuta.Items.Add(datos.Ruta.Nombre_Ruta);
                        lstRuta.DataSource     = servRuta.ConsultarRuta(string.Empty);
                        lstRuta.DataValueField = "Id_Ruta";
                        lstRuta.DataTextField  = "Nombre_Ruta";
                        lstRuta.DataBind();
                        txtMarca.Focus();
                    }
                    DivVehiculo.Visible            = true;
                    DivPropietario.Visible         = true;
                    DivSelRuta.Visible             = true;
                    DivAsignacionConductor.Visible = true;
                    DivDatosConductor.Visible      = true;
                    btnGuardar.Visible             = true;
                }
            }

            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servRuta.Close();
                servVehiculo.Close();
            }
        }
        protected void Ubica_SelectedIndexChanged(object sender, EventArgs e)
        {
            VehiculoServiceClient servVehiculo = new VehiculoServiceClient();

            try
            {
                if (lstUbica.SelectedItem.ToString() == Ubicacion.VEHICULO.ToString())
                {

                    lstPlacaVehiculo.DataSource = servVehiculo.ConsultarVehiculo(string.Empty);
                    lstPlacaVehiculo.DataValueField = "Id_Vehiculo";
                    lstPlacaVehiculo.DataTextField = "Placa";
                    lstPlacaVehiculo.DataBind();
                    diVehiculo.Visible = true;
                    lstPlacaVehiculo.Focus();
                }
                else
                {
                    diVehiculo.Visible = false;
                    DivConductor.Visible = false;
                    lstPlacaVehiculo.Controls.Clear();
                }
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }

            finally
            {
                servVehiculo.Close();
                BtnGuardar.Visible = true;
            }
        }
        protected void txtCedulaCond_TextChanged(object sender, EventArgs e)
        {
            VehiculoServiceClient servVehiculo = new VehiculoServiceClient();
            VehiculoBE vehiculo = new VehiculoBE();

            try
            {
                ////Conductor_VehiculoBE cond_veh = new Conductor_VehiculoBE();
                ////vehiculo.Conductor_Vehiculo =cond_veh;

                ////ConductorBE cond = new ConductorBE();
                ////cond.Cedula = txtCedulaCond.Text;
                ////cond_veh.Conductor= cond;

                ////VehiculoBE consulta = servVehiculo.Consultar_Conductor(txtCedulaCond.Text);

                ////if (consulta.Conductor_Vehiculo.Conductor.Cedula != txtCedulaCond.Text)
                ////    {
                ////        lblImprimirCedula.Text = consulta.Conductor_Vehiculo.Conductor.Cedula;
                ////        txtNombreCond.Text = consulta.Conductor_Vehiculo.Conductor.Nombres_Conductor;
                ////        txtPrimerApellidoCond.Text = consulta.Conductor_Vehiculo.Conductor.Apellido_1;
                ////        txtSegundoApellidoCond.Text = consulta.Conductor_Vehiculo.Conductor.Apellido_2;
                ////        txtCedulaCond.Text = "";
                ////    }

                ////    else
                ////    {
                ////        MessageBox.Show("El conductor no se encuentra registrado en el sistema", "Asignar Conductor");
                ////    }

                ////    txtRuta.Focus();
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servVehiculo.Close();
            }
        }
        protected void txtPlaca1_TextChanged(object sender, EventArgs e)
        {
            RutaServicesClient servRuta = new RutaServicesClient();
            VehiculoServiceClient servVehiculo = new VehiculoServiceClient();
            long resp;

            try
            {
                resp = servVehiculo.ConsultarExistenciaVehiculo(txtPlaca1.Text);

                if (resp == 0)
                {
                    MessageBox.Show("El vehículo no se encuentra registrado en el sistema", "Modificar Vehículo");
                    DivAsignacionConductor.Visible = false;
                    DivPropietario.Visible = false;
                    DivSelRuta.Visible = false;
                    DivVehiculo.Visible = false;
                    txtPlaca1.Text = "";
                    txtPlaca1.Focus();
                }

                else
                {
                    List<VehiculoBE> lstVehiculo = new List<VehiculoBE>(servVehiculo.ConsultarVehiculo(txtPlaca1.Text));

                    foreach (VehiculoBE datos in lstVehiculo)
                    {
                        txtPlaca.Text = txtPlaca1.Text;
                        txtMarca.Text = datos.Marca;
                        txtCilindraje.Text = datos.Cilindraje;
                        lstModelo.Items.Add(datos.Modelo);
                        Anos[] anos = Auxiliar.ConsultarAnos();
                        IEnumerable<Anos> listaAnos = anos.OrderByDescending(g => g).Skip(0);
                        foreach (Anos datosAnos in listaAnos)
                        {
                            lstModelo.Items.Add(datosAnos.ToString());
                        }
                        txtMotor.Text = datos.Motor;
                        txtChasis.Text = datos.Chasis;
                        lstEstado.Items.Add(datos.Estado);
                        List<string> estado = Auxiliar.ConsultaEstado();
                        foreach (string datoEstado in estado)
                        {
                            lstEstado.Items.Add(datoEstado);
                        }
                        txtCedula2.Text = datos.Contratista.Cedula;
                        txtNombre.Text = datos.Contratista.Nombres;
                        txtApellidos.Text = datos.Contratista.Apellidos;
                        lblImprimirCedula.Text = datos.Conductor.Cedula;
                        txtNombreCond.Text = datos.Conductor.Nombres_Conductor;
                        txtPrimerApellidoCond.Text = datos.Conductor.Apellido_1;
                        txtSegundoApellidoCond.Text = datos.Conductor.Apellido_2;
                        lstRuta.Items.Add(datos.Ruta.Nombre_Ruta);
                        lstRuta.DataSource = servRuta.ConsultarRuta(string.Empty);
                        lstRuta.DataValueField = "Id_Ruta";
                        lstRuta.DataTextField = "Nombre_Ruta";
                        lstRuta.DataBind();
                        txtMarca.Focus();

                    }
                    DivVehiculo.Visible = true;
                    DivPropietario.Visible = true;
                    DivSelRuta.Visible = true;
                    DivAsignacionConductor.Visible = true;
                    DivDatosConductor.Visible = true;
                    btnGuardar.Visible = true;

                }
            }

            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servRuta.Close();
                servVehiculo.Close();
            }
        }
        protected void txtCedula1_TextChanged(object sender, EventArgs e)
        {
            VehiculoServiceClient servVehiculo = new VehiculoServiceClient();

            VehiculoBE consultar_conductor = new VehiculoBE();
            long resp;

            try
            {
                resp = servVehiculo.ConsultarExistenciaConductor(txtCedula1.Text);

                if (resp == 0)
                {
                    MessageBox.Show("El conductor no se encuentra registrado en el sistema", "Modificar Vehículo");
                }
                else
                {
                    ConductorBE objConductor = servVehiculo.Consultar_Conductor(txtCedula1.Text);
                    lblImprimirCedula.Text = objConductor.Cedula;
                    txtNombreCond.Text = objConductor.Nombres_Conductor;
                    txtPrimerApellidoCond.Text = objConductor.Apellido_1;
                    txtSegundoApellidoCond.Text = objConductor.Apellido_2;
                    DivDatosConductor.Visible = true;
                    btnGuardar.Visible = true;
                    txtCedula1.Text = "";
                }
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servVehiculo.Close();
                lstRuta.Focus();
            }
        }
        protected void btnAgregar_Click(object sender, EventArgs e)
        {
            ClienteServiceClient servCliente = new ClienteServiceClient();
            VehiculoServiceClient servVehiculo = new VehiculoServiceClient();
            DataTable tabla = new DataTable();
            VentaBE venta = new VentaBE();
            DataTable tabla2 = new DataTable();

            try
            {
                List<Ubicacion_CilindroBE> lstCilVehiculos = new List<Ubicacion_CilindroBE>(servVehiculo.ConsultarCilPorVehiculo("5"));
                List<Ubicacion_CilindroBE> lstCilCliente = new List<Ubicacion_CilindroBE>(servCliente.ConsultarCilPorCliente(lblIdUbica.Text));
                tabla.Columns.Add("CodigosCilVehiculo");
                tabla2.Columns.Add("CodigosCilCliente");

                if (lstCilVehiculos.Count == 0)
                {
                    MessageBox.Show("El vehículo no tiene cilindros de este tamaño cargados en el sistema");
                    divCilSiembra.Visible = false;
                    divDatosConsulta.Visible = false;
                    btnGuardar.Visible = false;
                }
                else
                {
                    foreach (Ubicacion_CilindroBE datos in lstCilVehiculos)
                    {
                        if (lstTamano.SelectedItem.Text == datos.Cilindro.NTamano.Tamano)
                        {
                            tabla.Rows.Add(datos.Cilindro.Codigo_Cilindro);
                            listaCilVeh.Add(datos.Cilindro.Codigo_Cilindro);
                            btnGuardar.Visible = true;
                        }
                        else
                        {
                            MessageBox.Show("El vehículo no tiene cilindros de este tamaño cargados en el sistema");
                            divCilSiembra.Visible = false;
                            divDatosConsulta.Visible = false;
                            btnGuardar.Visible = false;
                        }
                    }
                }
                Session["Vehiculo"] = listaCilVeh;
                gvCilVehiculo.DataSource = tabla;
                gvCilVehiculo.DataBind();

                    foreach (Ubicacion_CilindroBE datos in lstCilCliente)
                    {
                        if (lstTamano.SelectedItem.Text == datos.Cilindro.NTamano.Tamano)
                        {
                            tabla2.Rows.Add(datos.Cilindro.Codigo_Cilindro);
                            listaCilCli.Add(datos.Cilindro.Codigo_Cilindro);
                        }
                    }
                    Session["Cliente"] = listaCilCli;
                    gdCodClientes.DataSource = tabla2;
                    gdCodClientes.DataBind();
                    gdCilSelecCliente.Visible = true;
                    gdCodClientes.Visible = true;
                    gvCilVehiculo.Visible = true;
                    gvSeleccion.Visible = true;
                    btnQuitar.Visible = true;
                    btnQuitar2.Visible = true;
                    btnSeleccionar.Visible = true;
                    btnSelect.Visible = true;
                    divDatosConsulta.Visible = true;
                    if (tabla2.Rows.Count == 0)
                    {
                        divCilSiembra.Visible = true;
                        btnQuitar2.Visible = false;
                        btnSelect.Visible = false;
                        gdCilSelecCliente.Visible = false;
                        gdCodClientes.Visible = false;
                    }

            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servCliente.Close();
                servVehiculo.Close();
                gdCilSelecCliente.Focus();
            }
        }
        protected void lstCaso_SelectedIndexChanged(object sender, EventArgs e)
        {
            VehiculoServiceClient servVehiculo = new VehiculoServiceClient();
            DataTable table = new DataTable();

            try
            {
                if (lstCaso.SelectedItem.Text == Tipo_Casos.CODIGO.ToString() + " " + Tipo_Casos.ERRADO.ToString())
                {
                    divCodCorrecto.Visible = true;
                    SetFocus(txtCodigoVerific);
                }
                else
                {
                    divCodCorrecto.Visible = false;
                }

            if (lstCaso.SelectedItem.Text == Tipo_Casos.ESCAPE.ToString())
            {
                divEscape.Visible = true;
                SetFocus(lstCilEntrega);
                List<Ubicacion_CilindroBE> lstCilVehiculos = new List<Ubicacion_CilindroBE>(servVehiculo.ConsultarCilPorVehiculo("1"));

                if (lstCilVehiculos.Count == 0)
                {
                    MessageBox.Show("El vehículo no tiene cilindros cargados", "Casos Especiales");
                    btnGuardar.Visible = false;
                    lstCaso.Items.RemoveAt(lstCaso.SelectedIndex);
                    divCodCorrecto.Visible = false;
                    lstCilEntrega.Visible = false;
                    lblCodigoVerific.Visible = false;
                }
                else
                {
                    foreach (Ubicacion_CilindroBE datos in lstCilVehiculos)
                    {
                        lstCilEntrega.Items.Add(datos.Cilindro.Codigo_Cilindro);
                    }
                }
            }
            else
            {
                divEscape.Visible = false;
            }
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servVehiculo.Close();
                divGrid.Visible = true;
            }
        }
        protected void btnAgregar_Click(object sender, EventArgs e)
        {
            ClienteServiceClient  servCliente  = new ClienteServiceClient();
            VehiculoServiceClient servVehiculo = new VehiculoServiceClient();
            DataTable             tabla        = new DataTable();
            VentaBE   venta  = new VentaBE();
            DataTable tabla2 = new DataTable();

            try
            {
                List <Ubicacion_CilindroBE> lstCilVehiculos = new List <Ubicacion_CilindroBE>(servVehiculo.ConsultarCilPorVehiculo("5"));
                List <Ubicacion_CilindroBE> lstCilCliente   = new List <Ubicacion_CilindroBE>(servCliente.ConsultarCilPorCliente(lblIdUbica.Text));
                tabla.Columns.Add("CodigosCilVehiculo");
                tabla2.Columns.Add("CodigosCilCliente");

                if (lstCilVehiculos.Count == 0)
                {
                    MessageBox.Show("El vehículo no tiene cilindros de este tamaño cargados en el sistema");
                    divCilSiembra.Visible    = false;
                    divDatosConsulta.Visible = false;
                    btnGuardar.Visible       = false;
                }
                else
                {
                    foreach (Ubicacion_CilindroBE datos in lstCilVehiculos)
                    {
                        if (lstTamano.SelectedItem.Text == datos.Cilindro.NTamano.Tamano)
                        {
                            tabla.Rows.Add(datos.Cilindro.Codigo_Cilindro);
                            listaCilVeh.Add(datos.Cilindro.Codigo_Cilindro);
                            btnGuardar.Visible = true;
                        }
                        else
                        {
                            MessageBox.Show("El vehículo no tiene cilindros de este tamaño cargados en el sistema");
                            divCilSiembra.Visible    = false;
                            divDatosConsulta.Visible = false;
                            btnGuardar.Visible       = false;
                        }
                    }
                }
                Session["Vehiculo"]      = listaCilVeh;
                gvCilVehiculo.DataSource = tabla;
                gvCilVehiculo.DataBind();

                foreach (Ubicacion_CilindroBE datos in lstCilCliente)
                {
                    if (lstTamano.SelectedItem.Text == datos.Cilindro.NTamano.Tamano)
                    {
                        tabla2.Rows.Add(datos.Cilindro.Codigo_Cilindro);
                        listaCilCli.Add(datos.Cilindro.Codigo_Cilindro);
                    }
                }
                Session["Cliente"]       = listaCilCli;
                gdCodClientes.DataSource = tabla2;
                gdCodClientes.DataBind();
                gdCilSelecCliente.Visible = true;
                gdCodClientes.Visible     = true;
                gvCilVehiculo.Visible     = true;
                gvSeleccion.Visible       = true;
                btnQuitar.Visible         = true;
                btnQuitar2.Visible        = true;
                btnSeleccionar.Visible    = true;
                btnSelect.Visible         = true;
                divDatosConsulta.Visible  = true;
                if (tabla2.Rows.Count == 0)
                {
                    divCilSiembra.Visible     = true;
                    btnQuitar2.Visible        = false;
                    btnSelect.Visible         = false;
                    gdCilSelecCliente.Visible = false;
                    gdCodClientes.Visible     = false;
                }
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servCliente.Close();
                servVehiculo.Close();
                gdCilSelecCliente.Focus();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                txtCodigoCilindro.Focus();
                btnMenu.Visible = true;
                ReporteServiceClient servReporte = new ReporteServiceClient();
                VehiculoServiceClient servVehiculo = new VehiculoServiceClient();

                try
                {
                        lstUbicacion.DataSource = servReporte.ConsultaTipoUbicacion().Skip(1);
                        lstUbicacion.DataValueField = "Id_Tipo_Ubica";
                        lstUbicacion.DataTextField = "Nombre_Ubicacion";
                        lstUbicacion.DataBind();

                        lstTamano.DataSource = servReporte.ConsultaTamanoCilindro();
                        lstTamano.DataValueField = "Id_Tamano";
                        lstTamano.DataTextField = "Tamano";
                        lstTamano.DataBind();

                    //Anos[] anos = Auxiliar.ConsultarAnos();
                    //IEnumerable<Anos> listaAnos = anos.Skip(1).OrderByDescending(g => g);
                    //foreach (Anos datosAnos in listaAnos)
                    //{
                    //    lstAno.Items.Add(datosAnos.ToString());
                    //}

                        lstPlacas.DataSource = servVehiculo.ConsultarVehiculo(string.Empty);
                        lstPlacas.DataValueField = "Id_Vehiculo";
                        lstPlacas.DataTextField = "Placa";
                        lstPlacas.DataBind();
                 }
                catch (Exception ex)
                {
                    Response.Redirect("~/About.aspx");
                }

                finally
                {
                    servVehiculo.Close();
                    servReporte.Close();
                }
            }
        }
        protected void txtCedula_TextChanged(object sender, EventArgs e)
        {
            VehiculoServiceClient servVehiculo = new VehiculoServiceClient();

            long resp;
            try
            {
                resp = servVehiculo.ConsultarExistenciaConductor(txtCedula.Text);

                if (resp != 0)
                {
                    MessageBox.Show("El Conductor ya se encuentra registrado en el sistema", "Registrar Conductor");
                    divInfoConductor.Visible = false;
                    btnGuardar.Visible = false;
                    txtCedulaCond.Text = "";
                    txtCedula.Text = "";
                    txtDireccion.Text = "";
                    txtPrimerApellido.Text = "";
                    txtNombreConductor.Text = "";
                    txtTelefono.Text = "";
                    txtCedula.Focus();
                }
                else
                {
                    divInfoConductor.Visible = true;
                    btnGuardar.Visible = true;
                    txtNombreConductor.Focus();
                    txtCedulaCond.Text = txtCedula.Text;
                    txtCedula.Text = "";
                }
            }
            catch (Exception ex)
            {
                Response.Redirect("~/About.aspx");
            }
            finally
            {
                servVehiculo.Close();
            }
        }