示例#1
0
        protected void btnAgregar_Click(object sender, EventArgs e)
        {
            SalasBLL oSalas = new SalasBLL();
            Sala     sala   = new Sala();

            sala.Ubicacion = txtUbicacion.Text;
            sala.Capacidad = Convert.ToInt32(txtCapacidad.Text);

            lblEstado.Text = new SalasBLL().CrearPelicula(sala);
            CargarGrid();
        }
示例#2
0
        protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            SalasBLL oCargos = new SalasBLL();
            Sala     sala    = new Sala();

            try
            {
                sala.Id        = Convert.ToInt32(GridView1.DataKeys[e.RowIndex]["Id"]);
                sala.Ubicacion = ((TextBox)GridView1.Rows[e.RowIndex].FindControl("txtUbicacion")).Text;
                sala.Capacidad = Convert.ToInt32(((TextBox)GridView1.Rows[e.RowIndex].FindControl("txtCapacidad")).Text);

                oCargos.Actualizar(sala);

                GridView1.EditIndex = -1;
                CargarGrid();
            }
            catch (Exception ex)
            {
                throw;
            }
        }