Пример #1
0
        private void ultraLabel_Eventos_Click(object sender, EventArgs e)
        {
            Form_event eventform = new Form_event(conn, this, us.getDirectorshipName(), us.getId());

            AddForm(eventform);
            ultraSplitter1.Collapsed = true;
        }
Пример #2
0
        public Form_modifyEvent(string idEvento, Form_main formMain, Form_event formEvent, SqlDataReader DR, Connector conn)
        {
            InitializeComponent();
            this.idEvento   = idEvento;
            this.formMain   = formMain;
            this.formEvent  = formEvent;
            this.DR         = DR;
            this.conn       = conn;
            this.sqlString  = null;
            this.eventoBase = new ArrayList();
            this.eventoForm = new ArrayList();

            if (idEvento.Length > 0)
            {
                sqlString = "select * from SACMEDB.dbo.event where id = '" + idEvento + "'";
                fillArrayList(eventoBase, sqlString);
                sqlString = "SELECT [id] as 'ID', [name] as 'NOMBRE DE EVENTO',[description] as 'DESCRIPCION',(SELECT SACMEDB.dbo.users.name + ' ' + SACMEDB.dbo.users.lastname from SACMEDB.dbo.users where id = responsible) as 'RESPONSABLE',[duration] as 'DURACION',[start] as 'FECHA DE INICIO',(select name from [SACMEDB].[dbo].[eventType] where id=eventTypeId) as 'TIPO DE EVENTO',(select name from [SACMEDB].[dbo].[branch] where id=branchId) as 'RAMA ENCARGADA',[created] as 'FECHA DE CREACION',(SELECT SACMEDB.dbo.users.name + ' ' + SACMEDB.dbo.users.lastname from SACMEDB.dbo.users where id = createdBy) as 'CREADO POR' FROM [SACMEDB].[dbo].[event]  where id = '" + idEvento + "'";
                fillArrayList(eventoForm, sqlString);


                SqlManager.executeQuery("delete from organizersTmp", conn);
                sqlString = "INSERT INTO [SACMEDB].[dbo].[organizersTmp]([name],[institution]) select name,institution from [SACMEDB].[dbo].[organizers] where id = any (select organizerId from [SACMEDB].[dbo].[eventOrganizer] where  eventOrganizer.eventId =  '" + idEvento + "')";
                SqlManager.executeQuery(sqlString, conn);


                SqlManager.executeQuery("delete from usersTmp", conn);
                sqlString = "INSERT INTO [SACMEDB].[dbo].[usersTmp] select * from [SACMEDB].[dbo].[users] where id = any(select userId from eventParticipant where eventId = '" + idEvento + "')";
                SqlManager.executeQuery(sqlString, conn);


                actualizarDataGrids();

                /*
                 * 0)id___________________int
                 * 1)nombre
                 * 2)descripcion
                 * 3)encargado
                 * 4)duracion
                 * 5)fecha de inicio______date
                 * 6)tipo de evento_______int
                 * 7)id de rama___________int
                 * 8)fecha de creacion____date
                 * 9)creado por
                 */

                this.txtNombreM.Text        = eventoForm[1].ToString();
                this.txtDescripcionM.Text   = eventoForm[2].ToString();
                this.txtEncargadoM.Text     = eventoForm[3].ToString();
                this.txtDuracionM.Text      = eventoForm[4].ToString();
                this.dateFechaInicioM.Text  = eventoForm[5].ToString(); fechaInicioOriginal = eventoForm[5].ToString();
                this.txtTipoM.Text          = eventoForm[6].ToString();
                this.txtRamaEncargadaM.Text = eventoForm[7].ToString();
            }
        }