Ejemplo n.º 1
0
        protected void ltitulo_click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            LinkLabel link = sender as LinkLabel;
            // identify which button was clicked and perform necessary actions
            var id = Int32.Parse(link.Name);

            Event ev = new Event(id);

            /*
             * InfoEventoInscrito infoEventoInscrito = new InfoEventoInscrito(ev, usuario);
             * infoEventoInscrito.Show();
             * this.Close();
             */

            InfoEventoInscrito infoEventoInscrito = new InfoEventoInscrito(ev, usuario);

            this.Visible             = false;
            infoEventoInscrito.Owner = this;
            infoEventoInscrito.ShowDialog();
            if (!this.isClosed)
            {
                this.Visible = true;
                panelEventos.Controls.Clear();
                mostrarEventos();
            }
        }
Ejemplo n.º 2
0
        protected void ltitulo_click(object sender, EventArgs e)
        {
            LinkLabel link = sender as LinkLabel;
            // identify which button was clicked and perform necessary actions
            var   id = Int32.Parse(link.Name);
            Event ev = new Event(id);

            if (usuario == null)
            {
                Cursor.Current = Cursors.WaitCursor;
                InfoEvento infoEvento = new InfoEvento(ev, null);
                this.Visible = false;
                infoEvento.ShowDialog();
                usuario = infoEvento.Usuario;
                actualizar();
                this.Visible = true;


                /*
                 * Cursor.Current = Cursors.WaitCursor;
                 * InfoEvento infoEvento = new InfoEvento(ev, this.usuario);
                 * infoEvento.Show();
                 * this.Close();
                 */
            }
            else
            {
                Boolean         found  = false;
                BD              bd     = new BD();
                MySqlDataReader reader = bd.Query("SELECT idEvent FROM inscription WHERE userName = '******';");
                if (reader.HasRows)
                {
                    while (reader.Read() && !found)
                    {
                        int idEvent = (int)reader[0];
                        if (idEvent == ev.ID)
                        {
                            found = true;

                            Cursor.Current = Cursors.WaitCursor;
                            InfoEventoInscrito infoEvento = new InfoEventoInscrito(ev, this.usuario);
                            infoEvento.Owner = this;
                            this.Visible     = false;
                            infoEvento.ShowDialog();
                            if (!isClosed)
                            {
                                this.Visible = true;
                            }


                            /*
                             * Cursor.Current = Cursors.WaitCursor;
                             * InfoEventoInscrito infoEvento = new InfoEventoInscrito(ev, this.usuario);
                             * infoEvento.Show();
                             * this.Close();
                             */
                        }
                    }
                    reader.Close();
                    bd.closeBD();
                    if (!found)
                    {
                        /*
                         * Cursor.Current = Cursors.WaitCursor;
                         * InfoEvento infoEvento = new InfoEvento(ev, this.usuario);
                         * this.Visible = false;
                         * infoEvento.ShowDialog();
                         * usuario = infoEvento.Usuario;
                         * actualizar();
                         * this.Visible = true;
                         */

                        Cursor.Current = Cursors.WaitCursor;
                        InfoEvento infoEvento = new InfoEvento(ev, this.usuario);
                        infoEvento.Owner = this;
                        this.Visible     = false;
                        infoEvento.ShowDialog();
                        if (!isClosed)
                        {
                            this.Visible = true;
                        }
                    }
                }
                else
                {
                    /*
                     * Cursor.Current = Cursors.WaitCursor;
                     * InfoEvento infoEvento = new InfoEvento(ev, this.usuario);
                     * this.Visible = false;
                     * infoEvento.ShowDialog();
                     * usuario = infoEvento.Usuario;
                     * actualizar();
                     * this.Visible = true;
                     */


                    Cursor.Current = Cursors.WaitCursor;
                    InfoEvento infoEvento = new InfoEvento(ev, this.usuario);
                    infoEvento.Owner = this;
                    this.Visible     = false;
                    infoEvento.ShowDialog();
                    if (!isClosed)
                    {
                        this.Visible = true;
                    }
                }
            }
        }