예제 #1
0
    protected void ddl_cont_prov_SelectedIndexChanged(object sender, EventArgs e)
    {
        ddl_cont_dist.Items.Clear();

        if (ddl_cont_prov.SelectedIndex != 0)
        {
            AppMiTaller.Intranet.BL.UbigeoBL oUbigeoBL = new AppMiTaller.Intranet.BL.UbigeoBL();
            ddl_cont_dist.DataSource     = oUbigeoBL.GetListaDistrito(ddl_cont_dep.SelectedValue.ToString(), ddl_cont_prov.SelectedValue.ToString());
            ddl_cont_dist.DataValueField = "coddist";
            ddl_cont_dist.DataTextField  = "nombre";
            ddl_cont_dist.DataBind();
            ddl_cont_dist.Items.Insert(0, new ListItem("--Seleccione--", "0"));
        }
    }
예제 #2
0
    private void Inicializa()
    {
        if (Request.QueryString["nid_vehiculo"] != null)
        {
            Session["txh_nid_vehiculo"] = Request.QueryString["nid_vehiculo"];
        }

        txt_pro_nro_doc.Attributes.Add("onBlur", "return  Fc_BuscarPropietario()");
        txt_clie_nro_doc.Attributes.Add("onBlur", "return Fc_BuscarCliente()");
        txt_cont_nro_doc.Attributes.Add("onBlur", "return Fc_BuscarContacto()");
        txt_pro_nro_doc.Attributes.Add("onkeypress", "return SoloNumeros(event)");
        txt_clie_nro_doc.Attributes.Add("onkeypress", "return SoloNumeros(event)");
        txt_cont_nro_doc.Attributes.Add("onkeypress", "return SoloNumeros(event)");
        txt_kilometraje.Attributes.Add("onkeypress", "return SoloNumeros(event)");

        lblTextoPlaca.Text = oParm.N_Placa;

        CargarMarcas();
        CargarEstado();
        CargarAnioTipos();

        CargarTipoPersona(ddl_pro_tipopersona, ddl_pro_tipodoc);
        CargarTipoPersona(ddl_clie_tipopersona, ddl_clie_tipodoc);
        CargarTipoPersona(ddl_cont_tipopersona, ddl_cont_tipodoc);


        if (oParm.SRC_CodPais.Equals("1"))
        {
            lblEtiquetaTipo.Visible = false;
            ddl_Anio.Visible        = false;
            ddl_Tipo.Visible        = false;

            lblEtiquetaAnio.Visible  = (Session["NUEVO"] == null);
            lblEtiquetaColor.Visible = (Session["NUEVO"] == null);
            lblEtiquetaMotor.Visible = (Session["NUEVO"] == null);
            txtAnio.Visible          = (Session["NUEVO"] == null);
            txtColor.Visible         = (Session["NUEVO"] == null);
            txtMotor.Visible         = (Session["NUEVO"] == null);
        }
        else
        {
            lblEtiquetaColor.Visible = false;
            lblEtiquetaMotor.Visible = false;
            txtAnio.Visible          = false;
            txtColor.Visible         = false;
            txtMotor.Visible         = false;
        }

        AppMiTaller.Intranet.BL.UbigeoBL oUbigeoBL = new AppMiTaller.Intranet.BL.UbigeoBL();
        ddl_cont_dep.DataSource     = oUbigeoBL.GetListaDepartamento();
        ddl_cont_dep.DataValueField = "coddpto";
        ddl_cont_dep.DataTextField  = "nombre";
        ddl_cont_dep.DataBind();
        ddl_cont_dep.Items.Insert(0, new ListItem("--Seleccione--", "0"));
        ddl_cont_prov.Items.Add(new ListItem("--Seleccione--", "0"));
        ddl_cont_dist.Items.Add(new ListItem("--Seleccione--", "0"));
        txt_cont_dir.Text = string.Empty;

        if (Session["NUEVO"] != null)
        {
            btnEditar.Visible  = false;
            btnGrabar.Visible  = true;
            btn_obtvin.Visible = false;
            txt_nrovin.Enabled = true;

            txt_placapatente.Text = "";
            txt_nrovin.Text       = "";
            txt_kilometraje.Text  = "0";

            p_DV.Enabled = true;

            p_propietario.Enabled = true;
            p_cliente.Enabled     = true;
            p_contacto.Enabled    = true;

            hid_nid_propietario.Value = "0"; //PROP
            hid_nid_cliente.Value     = "0"; //    CLI
            hid_nid_contacto.Value    = "0"; //   CONT

            hid_indnuevo.Value = "0";        // ID_VEH
        }
        else
        {
            CargarEntidad();

            btnEditar.Visible  = true;
            btnGrabar.Visible  = false;
            btn_obtvin.Visible = false;

            txt_placapatente.Text = objEnt.nu_placa.ToString().Trim();
            txt_nrovin.Text       = (oParm.SRC_VINObligatorio.Equals("1") ? objEnt.nu_vin.ToString().Trim() : objEnt.nu_placa.ToString().Trim());

            txt_nrovin.Enabled = true;

            txt_kilometraje.Text = objEnt.qt_km_actual.ToString();

            hid_NumPlaca.Value = objEnt.nu_placa.ToString().Trim();
            hid_indnuevo.Value = objEnt.nid_vehiculo.ToString().Trim();

            ddl_marca.SelectedValue = objEnt.nid_marca.ToString();
            ddl_marca_SelectedIndexChanged(this, null);
            ddl_modelo.SelectedValue = objEnt.nid_modelo.ToString();

            if (objEnt.fl_activo.ToString().Trim().Equals("Activo"))
            {
                ddl_estado.SelectedValue = "A";
            }
            else
            {
                ddl_estado.SelectedValue = "I";
            }

            if (oParm.SRC_CodPais.Equals("2"))
            {
                if (objEnt.nu_anio != 0)
                {
                    ddl_Anio.SelectedValue = objEnt.nu_anio.ToString();                     // Anio Vehiculo
                }
                if (!String.IsNullOrEmpty(objEnt.co_tipo))
                {
                    ddl_Tipo.SelectedValue = objEnt.co_tipo.ToString();                                       // Anio Vehiculo
                }
            }

            BuscarDatosClientes();

            p_DV.Enabled          = (Session["edidet_objEnt"] != null);
            p_propietario.Enabled = (Session["edidet_objEnt"] != null);
            p_cliente.Enabled     = (Session["edidet_objEnt"] != null);
            p_contacto.Enabled    = (Session["edidet_objEnt"] != null);

            btnEditar.Visible = (Session["verdet_objEnt"] != null);
            btnGrabar.Visible = (Session["edidet_objEnt"] != null);

            if (oParm.SRC_CodPais.Equals("1"))
            {
                CitasBE     oCitasBE     = new CitasBE();
                CitasBEList oCitasBEList = new CitasBEList();
                CitasBL     oCitasBL     = new CitasBL();

                oCitasBE.Nu_vin = txt_nrovin.Text.Trim();

                oCitasBEList = new CitasBEList();
                oCitasBEList = oCitasBL.ListarDatosSecVehiculo(oCitasBE);

                if (oCitasBEList.Count > 0)
                {
                    txtAnio.Text  = oCitasBEList[0].an_fabricacion.ToString();
                    txtColor.Text = oCitasBEList[0].no_color_exterior.ToString();
                    txtMotor.Text = oCitasBEList[0].nu_motor.ToString();
                }
            }
        }
    }