private void DatosInterface() { //OBTIENE LOS DATOS Tipo_boleto obj = (Tipo_boleto)Session["oBoleto"];//Llamar a la sesion txtNomBoleto.Text = obj.nombre_tipo; txtPrecioBoleto.Text = obj.Precio_tipo.ToString(); }
public Tipo_boleto interfaceDatos() { //RETORNA LOS DATOS Tipo_boleto obj = new Tipo_boleto(); obj.nombre_tipo = txtNomBoleto.Text.Trim(); obj.Precio_tipo = Convert.ToDecimal(txtPrecioBoleto.Text.Trim()); return(obj); }
protected void Seleccionar(object sender, GridViewCommandEventArgs e) { if (e.CommandName.ToString() == "Editar") { Tipo_boleto obj = new Tipo_boleto(); //Aqui hablo a la tabla del modelo que quiero int index = Convert.ToInt32(e.CommandArgument.ToString()); //toma todos los datos int idgenero = Convert.ToInt32(gvTipoBoleto.DataKeys[index].Value.ToString()); string boleto = gvTipoBoleto.Rows[index].Cells[1].Text.Trim(); decimal precio = Convert.ToDecimal(gvTipoBoleto.Rows[index].Cells[2].Text.Trim()); obj.id_tipoBoleto = idgenero;//Compara los datos del objeto con los obtenidos del datavigriew obj.nombre_tipo = boleto; obj.Precio_tipo = precio; Session["oBoleto"] = obj; //primero esto antes del redirect Session["operacion"] = "editando"; Response.Redirect("BoletoEdit.aspx"); //Para ingresar a una nueva ventana } }