Beispiel #1
0
        public c_subgrupos(int id, int idGrupo, Socket subgrupos, FlowLayoutPanel flp)
        {
            InitializeComponent();

            this.id = id;
            this.idGrupo = idGrupo;
            this.subgrupos = subgrupos;
            this.flp = flp;

            DataSourcePOI dsp = new DataSourcePOI();
            DataTable dt = dsp.getSubGrupo(id);

            DataTable dtt = dsp.getGrupo(idGrupo);

            if (dtt != null)
                lblGrupo.Text = dtt.Rows[0][0].ToString();

            if (dt != null)
            {
                for (int bc = 0; bc < dt.Rows.Count; bc++)
                {
                    lstSubgrupos.Items.Add(dt.Rows[bc][1].ToString());
                    lstSubgrupos.Items[bc].SubItems.Add(dt.Rows[bc][0].ToString());
                    lstSubgrupos.DoubleClick += new EventHandler(lstSubgrupos_DoubleClick);
                }
            }
        }
Beispiel #2
0
        private void registrar_Load(object sender, EventArgs e)
        {
            DataSourcePOI dspoi = new DataSourcePOI();

            cb_carrera.DisplayMember = "nombreGrupo";
            cb_carrera.ValueMember = "idGrupo";
            cb_carrera.DataSource = dspoi.getGrupos();
        }
Beispiel #3
0
        private void btn_enviar_Click(object sender, EventArgs e)
        {
            if (Publicacion.Text != "")
            {
                if (!file)
                {

                    DataSourcePOI dsp = new DataSourcePOI();

                    DataTable dtt = dsp.insertPublicacion(Publicacion.Text, idGrupo, id);

                    if (dtt.Rows[0][0].ToString() != "null")
                    {
                        DataTable dt = dsp.getPublicacion(idGrupo);

                        for (int bc = 0; bc < dt.Rows.Count; bc++)
                        {

                            c_desplegar c = new c_desplegar(dt.Rows[bc][4] + "", dt.Rows[bc][1] + "", int.Parse(dtt.Rows[0][0].ToString()), idGrupo, id, file, dt.Rows[bc][5].ToString(), socketPublicacion);

                        }
                        Publicacion.Text = "";
                        flp.Controls.Clear();
                        FG fg = new FG();
                        fg.publicaciones(id, idGrupo, socketPublicacion, flp);
                    }
                }
                else
                {
                    Mensaje mensaje = new Mensaje();
                    mensaje.archi = a;
                    mensaje.tipoo = Mensaje.tipo.publicacionarchivo;

                    DataSourcePOI dsp = new DataSourcePOI();

                    DataTable dtt = dsp.insertPublicacionArchivo(Publicacion.Text, idGrupo, id, a.j);

                    if (dtt.Rows[0][0].ToString() != "null")
                    {
                        DataTable dt = dsp.getPublicacion(idGrupo);

                        for (int bc = 0; bc < dt.Rows.Count; bc++)
                        {
                            c_desplegar c = new c_desplegar(dt.Rows[bc][4] + "", dt.Rows[bc][1] + "", int.Parse(dtt.Rows[0][0].ToString()), idGrupo, id, file, dt.Rows[bc][5].ToString(), socketPublicacion);

                        }
                        Publicacion.Text = "";
                        flp.Controls.Clear();
                        FG fg = new FG();
                        fg.publicaciones(id, idGrupo, socketPublicacion, flp);
                    }
                    socketPublicacion.Send(mensaje.toBytes());
                    file = false;
                }
            }
        }
Beispiel #4
0
 private void btnAgregarNueva_Click(object sender, EventArgs e)
 {
     if (txtNombreTarea.Text != "")
     {
         DataSourcePOI dsp = new DataSourcePOI();
         bool agregado = dsp.insertTarea(txtNombreTarea.Text, idGrupo);
         if (agregado)
             pnlAdd.Visible = false;
         FG fg = new FG();
         fg.tareas(id, idGrupo, tareas, flp);
     }
 }
Beispiel #5
0
 private void bt_In_Click(object sender, EventArgs e)
 {
     if (tb_correo.Text!=""&&tb_contra.Text!="") { }
     DataSourcePOI dspoi = new DataSourcePOI();
        bool result = dspoi.registrarse(tb_correo.Text, tb_contra.Text, Convert.ToInt32(cb_carrera.SelectedValue));
     if (result)
     {
         MessageBox.Show("Registro Exitoso", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information);
         Close();
     }
     else
     {
         MessageBox.Show("Registro Fallido", "Fallido", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Beispiel #6
0
        private void btnAgregar_Click(object sender, EventArgs e)
        {
            if (txtNombreSubgrupo.Text != "")
            {
                DataSourcePOI dsp = new DataSourcePOI();

                int idGrupinho = dsp.insertSubgruponom(idGrupo, txtNombreSubgrupo.Text);

                dsp.insertSubGrupo(id, idGrupinho);

                pnlsubgrup.Visible = false;

                FG fg = new FG();
                fg.subrgupos(id, idGrupo, subgrupos, flp);
            }
        }
Beispiel #7
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;
        }
Beispiel #8
0
        private void btn_Publicar_Click(object sender, EventArgs e)
        {
            if (input_publicacion.Text != "")
            {
                DataSourcePOI dsp = new DataSourcePOI();

                bool resultado = dsp.insertComentario(idpublicacion, input_publicacion.Text, id);

                if (resultado)
                {
                    DataTable dt = dsp.getComentario(idpublicacion);

                    for (int bc = 0; bc < dt.Rows.Count; bc++)
                    {
                        c_desplegar c = new c_desplegar(input_publicacion.Text, publicacion.Text, idpublicacion, idGrupo, id, isExistsFile, nombreArchivo, archivoS);

                    }
                    input_publicacion.Text = "";
                }
            }
        }
Beispiel #9
0
        private void lstAgregarse_DoubleClick(object sender, EventArgs e)
        {
            DataSourcePOI dsp = new DataSourcePOI();

            string[] datos = lstAgregarse.SelectedItems[0].Text.Split('-');
            int idSubgrupoGrupo = int.Parse(datos[0]);
            dsp.insertSubGrupo(id, idSubgrupoGrupo);
            pnlAgregarse.Visible = false;
            FG fg = new FG();
            fg.subrgupos(id, idGrupo, subgrupos, flp);
        }
Beispiel #10
0
        private void pictureBox1_Click(object sender, EventArgs e)
        {
            pnlAgregarse.Visible = true;
            DataSourcePOI dsp = new DataSourcePOI();
            DataTable dt = dsp.getnotmygroups(id);

            if (dt != null)
            {
                for (int bc = 0; bc < dt.Rows.Count; bc++)
                {
                    lstAgregarse.Items.Add(dt.Rows[bc][0].ToString() + "-" + dt.Rows[bc][2].ToString());
                }
            }
        }
Beispiel #11
0
        public void publicaciones(int id, int idGrupo, Socket conectado, FlowLayoutPanel flp_publicacion)
        {
            DataSourcePOI dsp = new DataSourcePOI();

            c_Publicacion p = new c_Publicacion(id, idGrupo, conectado, flp_publicacion);
            flp_publicacion.Controls.Add(p);

            DataTable dt = dsp.getPublicacion(idGrupo);
            c_desplegar c = null;

            tareas(id, idGrupo, conectado, flowLayoutPanel2);

            subrgupos(id, idGrupo, conectado, flowLayoutPanel1);

            bool isExistsFile = false;

            int temp = 0;

            if (dt != null)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    // c_desplegar c = new c_desplegar("nombre"+i, "Toda la publicacion aqui", 1);

                    string comprar = dt.Rows[i][5].ToString();

                    if (!"".Equals(comprar))
                    {
                        isExistsFile = true;
                    }

                    c = new c_desplegar(dt.Rows[i][4] + "", dt.Rows[i][1] + "", int.Parse(dt.Rows[i][0].ToString()), idGrupo, id, isExistsFile, dt.Rows[i][5].ToString(), conectado);

                    DataTable dtc = dsp.getComentario(int.Parse(dt.Rows[i][0].ToString()));

                    temp = int.Parse(dt.Rows[i][0].ToString());

                    if (dtc != null)
                    {
                        for (int j = 0; j < dtc.Rows.Count; j++)
                        {
                            int temp2 = int.Parse(dtc.Rows[j][1].ToString());
                            if (temp == temp2)
                            {
                                Label l = new Label();
                                l.Text = dtc.Rows[j][0].ToString();
                                c.flp_comentarios.Controls.Add(l);
                            }
                        }
                    }
                    flp_publicacion.Controls.Add(c);
                    isExistsFile = false;
                }
            }
        }
Beispiel #12
0
        private void chkTarea_CheckedChanged(object sender, EventArgs e)
        {
            chkTarea = (CheckBox)sender;
            bool checado = chkTarea.Checked;
            DataSourcePOI dsp = new DataSourcePOI();

            int status = 0;

            string[] texto = chkTarea.Text.Split(',');

            if (checado)
            {
                status = 1;
                pbGamification.Increment(1);
            }
            else {
                pbGamification.Value--;
            }

            DataTable dtt = dsp.getTareaAlumno(int.Parse(texto[0]), id);
            if (dtt != null)
                dsp.actualizarTarea(status, int.Parse(texto[0]));
            else
                dsp.insertarTareaAlumno(status, int.Parse(texto[0]), id);
        }