Ejemplo n.º 1
0
        protected void btnAtribuir_Click(object sender, EventArgs e)
        {
            int varRet   = 0;
            int coutRows = grwVolDispo.Rows.Count;
            int atv      = SequencialAtividade_Evento(ddwTipoVoluntario.DataValueField, Convert.ToInt32(Session["evento"]));

            for (int i = 0; i < coutRows; i++)
            {
                CheckBox chk    = (CheckBox)grwVolDispo.Rows[i].FindControl("CheckBox1");
                Label    lblCpf = (Label)grwVolDispo.Rows[i].FindControl("Label1");
                if (chk.Checked)
                {
                    EventoDAO oEdv = new EventoDAO();
                    int       aux  = oEdv.atribuirVoluntarioEvento(lblCpf.Text, Convert.ToInt32(lblCodEve.Text), atv.ToString());
                    if (aux == 1)
                    {
                        varRet++;
                    }
                }
            }

            if (varRet > 0)
            {
                Response.Write(string.Format("<script>alert('Foram atribuidos {0} voluntários a este evento ');window.location = 'atribuicaoVol.aspx';</script>", varRet));
            }
        }