/// <summary> /// Recupera la ubicacion de una direccion /// </summary> /// <param name="UidDireccion"></param> /// <returns></returns> public ResponseHelper GetRecuperaUbicacionDireccion(string UidDireccion) { MVUbicacion = new VMUbicacion(); MVUbicacion.RecuperaUbicacionDireccion(UidDireccion); Respuesta = new ResponseHelper(); Respuesta.Data = MVUbicacion; Respuesta.Status = true; Respuesta.Message = "Informacion agregada satisfactoriamente"; return(Respuesta); }
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; }