Esempio n. 1
0
        public tarea(int idGrupo, int id, Socket tareas, FlowLayoutPanel flp)
        {
            InitializeComponent();

            this.id = id;
            this.tareas = tareas;
            this.flp = flp;

            DataSourcePOI dsp = new DataSourcePOI();

            DataTable dt = dsp.getTarea(idGrupo);

            pbGamification.Maximum = dt.Rows.Count;

            if (dt != null)
            {
                for (int bc = 0; bc < dt.Rows.Count; bc++)
                {
                    DataTable dtt = dsp.getTareaAlumno(int.Parse(dt.Rows[bc][0].ToString()), id);

                    chkTarea = new CheckBox();
                    chkTarea.Text = dt.Rows[bc][0].ToString() + ", " + dt.Rows[bc][1].ToString();

                    if (dtt != null)
                    {
                        bool stado = bool.Parse(dtt.Rows[0][1].ToString());
                        chkTarea.Checked = stado;

                        if (stado)
                        {
                            pbGamification.Increment(1);
                        }
                    }
                    chkTarea.AutoSize = true;
                    chkTarea.CheckedChanged += new EventHandler(chkTarea_CheckedChanged);
                    flpTarea.Controls.Add(chkTarea);

                }
            }

            this.idGrupo = idGrupo;
        }