Exemple #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         this.ddlEstadoMesa.DataSource     = EstadoMesaLN.ObtenerTodos();
         this.ddlEstadoMesa.DataTextField  = "descripcion";
         this.ddlEstadoMesa.DataValueField = "estadoMesa";
         this.ddlEstadoMesa.DataBind();
     }
 }
        private void mostrarEstados()
        {
            List <EstadoMesaEntidad> listaEstadosMesas = EstadoMesaLN.ObtenerTodos();
            String hilera = "<center><table style='border:solid 1px black'>";

            foreach (EstadoMesaEntidad item in listaEstadosMesas)
            {
                hilera += "<tr><td style=\"padding:5px\">";
                hilera += "<strong>" + item.descripcion + "</strong>" + "</td>";
                hilera += "<td style=\"padding:5px\">";
                hilera += "<img src=\"img/mesaEstados/E" + (item.estadoMesa) + ".jpg\" height=\"30px\" width=\"30px\"/>";
                hilera += "</td></tr>";
            }

            hilera += "</table></center>";


            idEstadosMesas.InnerHtml = hilera;
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         try
         {
             MesaEntidad mesa   = new MesaEntidad();
             int         numero = Convert.ToInt16(Request.QueryString["idMesa"].ToString());
             mesa = MesaLN.ObtenerMesa(numero);
             this.txtCantidad.Text             = mesa.cantidadPersonas.ToString();
             this.txtNumero.Text               = mesa.idMesa.ToString();
             this.ddlEstadoMesa.DataSource     = EstadoMesaLN.ObtenerTodos();
             this.ddlEstadoMesa.DataTextField  = "descripcion";
             this.ddlEstadoMesa.DataValueField = "estadoMesa";
             this.ddlEstadoMesa.DataBind();
             this.ddlEstadoMesa.SelectedValue = mesa.estadoMesa.estadoMesa.ToString();
         }
         catch (Exception)
         {
             Response.Redirect("MantenimientoMesas.aspx");
         }
     }
 }