private void LLenarCampos() { v_Direccion direccion = lg.ObtenerDireccion(TbUsuario.Text).Single(); v_MecanismoContacto contacto = lg.ObtenerMecanismo(TbUsuario.Text).Single(); v_Party party = lg.ObtenerParty(TbUsuario.Text).Single(); TbPrimerNombre.Text = party.Nombre; TbSegundoNombre.Text = party.SegundoNombre; TbPrimerApellido.Text = party.Apellido1; TbSegundoApellido.Text = party.Apellido2; TbContacto.Text = contacto.Valor; DropDownListContacto.SelectedValue = contacto.TipoMecanismoID.ToString(); DropDownListTipoDireccion.SelectedValue = direccion.TipoDireccionID.ToString(); DropDownListUbicacion.SelectedValue = direccion.GeoID.ToString(); TbLinea1.Text = direccion.LineaDireccion1; TbLinea2.Text = direccion.LineaDireccion2; TbLinea3.Text = direccion.LineaDireccion3; TbInstrucciones.Text = direccion.Instrucciones; }
protected void BtnModificarDatos_Click(object sender, EventArgs e) { try { String StrPartyID = Session["Party"].ToString(); String StrPrimerNombre = primerNombre.Value; String StrSegundoNombre = segundoNombre.Value; String StrPrimerApellido = primerApellido.Value; String StrSegundoApellido = segundoApellido.Value; System.Diagnostics.Debug.WriteLine(StrSegundoNombre + "En modificar campos"); lg.ModificarParty(StrPrimerNombre, StrSegundoNombre, StrPrimerApellido, StrSegundoApellido, StrPartyID); String StrLineaDireccion1 = direccionMod.Value; v_Direccion direccion = lg.ObtenerDireccion(Session["Party"].ToString()).Single(); Byte ByteDireccionID = direccion.DireccionID; short ShGeoID = direccion.GeoID; String StrLineaDireccion2 = null; String StrLineaDireccion3 = null; String StrInstrucciones = null; Byte ByteTipoDireccionID = direccion.TipoDireccionID; lg.ModificarDireccion(ByteDireccionID, ShGeoID, StrLineaDireccion1, StrLineaDireccion2, StrLineaDireccion3, StrInstrucciones, ByteTipoDireccionID, StrPartyID); divMsjDatos.Attributes.Add("style", "display:inline"); LbMsjDatos.Text = "Datos modificados con éxito"; //Response.Redirect("/ModuloCliente/mientras.aspx?nombre= &correo=" + Session["Party"].ToString() + "&id= ", false); } catch (ExcepcionCampoVacio ex) { divMsjDatos.Attributes.Add("style", "display:inline"); LbMsjDatos.Text = ex.Message; } }