Esempio n. 1
0
        protected void DgvDirecciones_RowEditing(object sender, GridViewEditEventArgs e)
        {
            int    index = DgvDirecciones.SelectedIndex;
            string valor = DgvDirecciones.DataKeys[index].Value.ToString();

            Session["MVDireccion"] = MVDireccion;
            MVDireccion.ObtenDireccion(valor);
            //Esconde el Id en un textbox
            txtIdDireccion.Text    = MVDireccion.ID.ToString();
            DDLDPais.SelectedIndex = DDLDPais.Items.IndexOf(DDLDPais.Items.FindByValue(MVDireccion.PAIS));
            //Obtener lista de estado y seleccionar el del objeto
            MuestraEstados(MVDireccion.PAIS, "Gestion");
            DDLDEstado.SelectedIndex = DDLDEstado.Items.IndexOf(DDLDEstado.Items.FindByValue(MVDireccion.ESTADO));

            // Obtener lista de municipio y seleccionar el del objeto
            MuestraMunicipio(MVDireccion.ESTADO, "Gestion");
            DDLDMunicipio.SelectedIndex = DDLDMunicipio.Items.IndexOf(DDLDMunicipio.Items.FindByValue(MVDireccion.MUNICIPIO));

            // Obtener lista de ciudades y seleccionar el del objeto
            MuestraCiudad(MVDireccion.MUNICIPIO, "Gestion");
            DDLDCiudad.SelectedIndex = DDLDCiudad.Items.IndexOf(DDLDCiudad.Items.FindByValue(MVDireccion.CIUDAD));

            // Obtener lista de colonias y seleccionar el del objeto
            MuestraColonia(MVDireccion.CIUDAD, "Gestion");
            DDLDColonia.SelectedIndex = DDLDColonia.Items.IndexOf(DDLDColonia.Items.FindByValue(MVDireccion.COLONIA));

            txtCalle0.Text                   = MVDireccion.CALLE0;
            txtCalle1.Text                   = MVDireccion.CALLE1;
            txtCalle2.Text                   = MVDireccion.CALLE2;
            txtDManzana.Text                 = MVDireccion.MANZANA;
            txtDLote.Text                    = MVDireccion.LOTE;
            txtDCodigoPostal.Text            = MVDireccion.CodigoPostal;
            txtDReferencia.Text              = MVDireccion.REFERENCIA;
            txtIdentificadorDeDireccion.Text = MVDireccion.IDENTIFICADOR;
            //Habilita los controles al momento de mostrar el panel
            EstatusDeCamposDeDireccion(true);
            MVUbicacion.RecuperaUbicacionDireccion(MVDireccion.ID.ToString());

            if (MVUbicacion.VchLatitud == string.Empty)
            {
                MVUbicacion.VchLatitud = "20.6362699";
            }
            if (MVUbicacion.VchLongitud == string.Empty)
            {
                MVUbicacion.VchLongitud = "-87.0766052";
            }
            latitud.Text            = MVUbicacion.VchLatitud;
            lonjitud.Text           = MVUbicacion.VchLongitud;
            PlantillaMensajeVentana = "<label>" + MVDireccion.IDENTIFICADOR + "</label>";
            MuestraUbicacionEnMapa(double.Parse(MVUbicacion.VchLatitud), double.Parse(MVUbicacion.VchLongitud), PlantillaMensajeVentana, 17);


            PnlDetallesDireccion.Visible = true;
            PanelUbicacion.Visible       = false;
        }
Esempio n. 2
0
        protected void DgvDirecciones_RowEditing(object sender, GridViewEditEventArgs e)
        {
            int    index = DgvDirecciones.SelectedIndex;
            string valor = DgvDirecciones.DataKeys[index].Value.ToString();

            Session["MVDireccion"] = MVDireccion;
            MVDireccion.ObtenDireccion(valor);
            //Esconde el Id en un textbox
            txtIdDireccion.Text    = MVDireccion.ID.ToString();
            DDLDPais.SelectedIndex = DDLDPais.Items.IndexOf(DDLDPais.Items.FindByValue(MVDireccion.PAIS));
            //Obtener lista de estado y seleccionar el del objeto
            MuestraEstados(MVDireccion.PAIS, "Gestion");
            DDLDEstado.SelectedIndex = DDLDEstado.Items.IndexOf(DDLDEstado.Items.FindByValue(MVDireccion.ESTADO));

            // Obtener lista de municipio y seleccionar el del objeto
            MuestraMunicipio(MVDireccion.ESTADO, "Gestion");
            DDLDMunicipio.SelectedIndex = DDLDMunicipio.Items.IndexOf(DDLDMunicipio.Items.FindByValue(MVDireccion.MUNICIPIO));

            // Obtener lista de ciudades y seleccionar el del objeto
            MuestraCiudad(MVDireccion.MUNICIPIO, "Gestion");
            DDLDCiudad.SelectedIndex = DDLDCiudad.Items.IndexOf(DDLDCiudad.Items.FindByValue(MVDireccion.CIUDAD));

            // Obtener lista de colonias y seleccionar el del objeto
            MuestraColonia(MVDireccion.CIUDAD, "Gestion");
            DDLDColonia.SelectedIndex = DDLDColonia.Items.IndexOf(DDLDColonia.Items.FindByValue(MVDireccion.COLONIA));

            txtCalle0.Text                   = MVDireccion.CALLE0;
            txtCalle1.Text                   = MVDireccion.CALLE1;
            txtCalle2.Text                   = MVDireccion.CALLE2;
            txtDManzana.Text                 = MVDireccion.MANZANA;
            txtDLote.Text                    = MVDireccion.LOTE;
            txtDCodigoPostal.Text            = MVDireccion.CodigoPostal;
            txtDReferencia.Text              = MVDireccion.REFERENCIA;
            txtIdentificadorDeDireccion.Text = MVDireccion.IDENTIFICADOR;
            //Habilita los controles al momento de mostrar el panel
            EstatusDeCamposDeDireccion(true);
            PnlDetallesDireccion.Visible = true;
        }