示例#1
0
        /*************************************************************************************************************************************************************/
        /*************************************************************************************************************************************************************/
        /*************************************************************************************************************************************************************/
        public Form_event(Connector conn, Form_main formMain, String directorshipName, string eventCreator)
        {
            InitializeComponent();
            this.conn          = conn;
            this.formMain      = formMain;
            this.eventCreator  = eventCreator;
            this.SelectedItems = true;
            clearRegistryForm();

            toolTip.SetToolTip(btnBorrarCampos, "Borrar Campos");
            toolTip.SetToolTip(btnRegistro, "Registrar Evento");
            toolTip.SetToolTip(btnConsulta, "Consultar Evento");

            this.directorshipName = directorshipName;

            if (directorshipName == "CONSEJERO")
            {
                btnRegistro.Visible  = false;
                btnConsulta.Location = new Point(250, 4);
            }
            fillComboBox(this.cmbTipoC, "select * from [SACMEDB].[dbo].[eventType]", "name");

            fillComboBox(this.cmbTipoR, "select * from [SACMEDB].[dbo].[eventType]", "name");

            fillComboBox(this.cmbRamaEncargadaR, "select * from [SACMEDB].[dbo].[branch]", "name");
        }
示例#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();
            }
        }
示例#3
0
 public Form_genericAddRemove(Connector conn, string titulo, string sqlStringAdd, string sqlStringRemove, UltraComboEditor comboBox, UltraComboEditor idParticipants, Form_main formMain, Form_modifyEvent formModify, bool b)
 {
     InitializeComponent();
     this.Text            = titulo;
     this.conn            = conn;
     this.sqlStringAdd    = sqlStringAdd;
     this.sqlStringRemove = sqlStringRemove;
     this.comboBox        = comboBox;
     this.idParticipants  = idParticipants;
     this.formMain        = formMain;
     this.formModify      = formModify;
     this.b           = b;
     formMain.Enabled = false;
 }
示例#4
0
        private void ultraButton_Ingresar_Click(object sender, EventArgs e)
        {
            usuario     = ultraTextEditor_Usuario.Text;
            contrasenia = ultraTextEditor_Contrasenia.Text;

            if (ultraCheckEditor_PrimeraVez.Checked)
            {
                DirectorioEspol.directorioEspolSoapClient wservice = new DirectorioEspol.directorioEspolSoapClient();
                if (wservice.autenticacion(usuario, contrasenia))
                {
                    MessageBox.Show("Es un usuario espol");
                }
                else
                {
                    MessageBox.Show("NO ES, vayase");
                }
            }


            Form_main formmain = new Form_main(this, sacmeDbConn);

            this.Hide();
            formmain.Show();
        }
示例#5
0
        private void ultraButton_Guardar_Click(object sender, EventArgs e)
        {
            pass       = ultraTextEditor_Contrasenia.Text;
            confirPass = ultraTextEditor_ConfirmContrasenia.Text;

            if (pass == "" || confirPass == "")
            {
                MessageBox.Show("Ingrese correctamente los valores correspondientes");
            }
            else if (pass != confirPass)
            {
                MessageBox.Show("Contraseñas no coinciden");
            }
            else
            {
                this.query = "UPDATE users SET password='******' WHERE username='******';";
                if (SqlManager.executeQuery(query, conn))
                {
                    Form_main formmain = new Form_main(ini, conn, user);
                    this.Hide();
                    formmain.Show();
                }
            }
        }
示例#6
0
        private void ultraButton_Ingresar_Click(object sender, EventArgs e)
        {
            int                flag  = 0;
            String             query = "";
            SqlDataReader      user  = null;
            Form_usersPassword fm;

            this.usuario     = ultraTextEditor_Usuario.Text;
            this.contrasenia = ultraTextEditor_Contrasenia.Text;

            if (this.usuario == "" || this.contrasenia == "")
            {
                MessageBox.Show("Ingrese correctamente sus datos");
            }
            else
            {
                query = "SELECT id FROM users WHERE username='******';";
                user  = SqlManager.getQuery(query, sacmeDbConn);

                if (!user.HasRows)
                {
                    MessageBox.Show("Ud no pertenece al Sistema");
                    user.Close();
                }
                else
                {
                    user.Close();

                    if (ultraCheckEditor_PrimeraVez.Checked)
                    {
                        DirectorioEspol.directorioEspolSoapClient wservice = new DirectorioEspol.directorioEspolSoapClient();
                        if (wservice.autenticacion(usuario, contrasenia))
                        {
                            flag = 1;
                        }
                        else
                        {
                            MessageBox.Show("Ud no pertenece a la ESPOL, no podrá ingresar a SACME");
                        }
                    }
                    else
                    {
                        query = "SELECT id FROM users WHERE username='******' AND password='******';";
                        user  = SqlManager.getQuery(query, sacmeDbConn);

                        if (!user.HasRows)
                        {
                            MessageBox.Show("El usuario o contraseña es inválido. Intente nuevamente");
                            user.Close();
                        }
                        else
                        {
                            user.Close();
                            Form_main formmain = new Form_main(this, sacmeDbConn, this.usuario);
                            this.Hide();
                            formmain.Show();
                        }
                        user.Close();
                    }

                    if (flag == 1)
                    {
                        fm = new Form_usersPassword(ultraTextEditor_Usuario.Text, sacmeDbConn, this);
                        this.Hide();
                        fm.Show();
                    }
                }
            }
        }