Ejemplo n.º 1
0
        protected void btSimRe_Click(object sender, EventArgs e)
        {
            bool a = false;

            for (int i = 0; i < gvSalaList.Rows.Count; i++)
            {
                if (((CheckBox)gvSalaList.Rows[i].FindControl("chbxEliminar")).Checked)
                {
                    a = true;
                    Models.Salas salas   = SalasDAO.GetSalaByID(Convert.ToInt32(gvSalaList.DataKeys[i].Value));
                    int          id_sala = salas.id_sala;
                    SalasDAO.RemoveSala(id_sala);
                    continue;
                }
            }
            MPE_Rem.Hide();
            if (a == true)
            {
                DataBindGrid();
                String str = "<script>alertify.success('Remoção feita com sucesso!');</script>";
                Page.ClientScript.RegisterStartupScript(this.GetType(), "Script", str, false);
            }
            else
            {
                DataBindGrid();
                String str = "<script>alertify.error('Não há nada para remover!');</script>";
                Page.ClientScript.RegisterStartupScript(this.GetType(), "Script", str, false);
            }
        }
Ejemplo n.º 2
0
        protected void gvEquipList_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                Equip Equip = EquipDAO.GetEquipByID(Convert.ToInt32(e.Row.Cells[0].Text));

                Categoria cat         = CatDAO.GetCatByID(Equip.id_cat);
                Label     lbCategoria = (Label)e.Row.FindControl("lbCategoria");
                lbCategoria.Text = cat.Nome;

                Salas sala   = SalasDAO.GetSalaByID(Equip.id_sala);
                Label lbSala = (Label)e.Row.FindControl("lbSala");
                lbSala.Text = sala.nome_sala;
            }
        }
Ejemplo n.º 3
0
        protected void btEquip_Click(object sender, EventArgs e)
        {
            Button bt = (Button)sender;

            GridViewRow gv = (GridViewRow)bt.NamingContainer;

            int index = gv.RowIndex;

            Button    btEquip = (Button)gvReqList.Rows[index].FindControl("btEquip");
            String    descri  = btEquip.Text;
            Equip     equip   = EquipDAO.GetEquipByDescri(descri);
            Categoria cat     = CatDAO.GetCatByID(equip.id_cat);

            Models.Salas sala = SalasDAO.GetSalaByID(equip.id_sala);
            lbDescri.Text    = "<b>Descrição : </b>" + descri + "\n";
            lbCategoria.Text = "<b>Categoria : </b>" + cat.Nome + "\n";
            lbSala.Text      = "<b>Sala : </b>" + sala.nome_sala + "\n";
            MPE_Equip.Show();
        }