private void fillfield(TEstacion estacion) { lblEstacionID.Text = estacion.EstacionID.ToString(); lblNombre.Text = estacion.Nombre; lblRazonSocial.Text = estacion.RazonSocial; lblDomicilio.Text = estacion.Calle; lblNoInterior.Text = estacion.NoInterior; lblNoExterior.Text = estacion.NoExterior; lblCiudad.Text = estacion.Ciudad; lblMunicipio.Text = estacion.Municipio; lblEstado.Text = estacion.Estado; lblZona.Text = estacion.NombreZona; lblGrupo.Text = estacion.NombreGrupo; }
public TEstacion GetEstacion(string Datos) { try { TEstacion est = new TEstacion(); IDbCommand command; using (IDbCommand lcommand = this.ServiceSchema.NewCommand(this.Connection, "cmdEstacion", new string[] { "Datos" }, new object[] { Datos })) { IDataReader reader = lcommand.ExecuteReader(); while (reader.Read()) { est.EstacionID = (int)(reader["EstacionID"] != DBNull.Value ? reader["EstacionID"] : ""); est.Nombre = (string)(reader["Nombre"] != DBNull.Value ? reader["Nombre"] : ""); est.RazonSocial = (string)(reader["RazonSocial"] != DBNull.Value ? reader["RazonSocial"] : ""); est.NombreGrupo = (string)(reader["NombreGrupo"] != DBNull.Value ? reader["NombreGrupo"] : ""); est.Calle = (string)(reader["Calle"] != DBNull.Value ? reader["Calle"] : ""); est.NoInterior = (string)(reader["NoInterior"] != DBNull.Value ? reader["NoInterior"] : ""); est.NoExterior = (string)(reader["NoExterior"] != DBNull.Value ? reader["NoExterior"] : ""); est.Ciudad = (string)(reader["Ciudad"] != DBNull.Value ? reader["Ciudad"] : ""); est.Municipio = (string)(reader["Municipio"] != DBNull.Value ? reader["Municipio"] : ""); est.Estado = (string)(reader["Estado"] != DBNull.Value ? reader["Estado"] : ""); est.NombreZona = (string)(reader["NombreZona"] != DBNull.Value ? reader["NombreZona"] : ""); est.NombreGrupo = (string)(reader["NombreGrupo"] != DBNull.Value ? reader["NombreGrupo"] : ""); est.EntregaCalle = (string)(reader["EntregaCalle"] != DBNull.Value ? reader["EntregaCalle"] : ""); est.EntregaNoExterior = (string)(reader["NoExterior"] != DBNull.Value ? reader["NoExterior"] : ""); est.EntregaNoInterior = (string)(reader["EntregaNoInterior"] != DBNull.Value ? reader["EntregaNoInterior"] : ""); est.EntregaColonia = (string)(reader["EntregaColonia"] != DBNull.Value ? reader["EntregaColonia"] : ""); est.EntregaCiudad = (string)(reader["EntregaCiudad"] != DBNull.Value ? reader["EntregaCiudad"] : ""); est.EntregaMunicipio = (string)(reader["EntregaMunicipio"] != DBNull.Value ? reader["EntregaMunicipio"] : ""); est.EntregaEstado = (string)(reader["EntregaEstado"] != DBNull.Value ? reader["EntregaEstado"] : ""); est.EntregaCP = (string)(reader["EntregaCP"] != DBNull.Value ? reader["EntregaCP"] : ""); } } return(est); } catch (Exception ex) { throw ex; } }
protected void Page_Load(object sender, EventArgs e) { TEstacion estacion = new TEstacion(); fillfield(DataModule.DataService.GetEstacion(DataModule.Seguridad.Attributes[0].ToString())); }