private void edadbox_SelectedIndexChanged(object sender, EventArgs e)
        {
            string        userDataName = UserAccessForm.getusername() + "_student_table";
            StudentsClass show         = new StudentsClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
            string        orden        = "select `NOMBRE COMPLETO`,EDAD, `FECHA DE NACIMIENTO`, CURSO, HORARIO, NACIONALIDAD, SEXO, TELEFONO, DIRECCION, `NOMBRE DEL TUTOR` from " + userDataName + " where estudiando = '" + inscritobox.Text + "' and EDAD='" + edadbox.Text + "'; ";

            show.ShowDataGridFound(findinggrid, orden);
            encontradoslabel.Text = show.getcuenta().ToString();

            edadbox.BackColor = Color.White;
            if (namebox.Text == "" || edadbox.Text == "" || gradebox.Text == "" || inscritobox.Text == "NO")
            {
                eliminarbutton.Enabled = false;
            }
            else
            {
                eliminarbutton.Enabled = true;
            }

            if (namebox.Text == "" || edadbox.Text == "" || gradebox.Text == "")
            {
                editbutton.Enabled = false;
            }
            else
            {
                editbutton.Enabled = true;
            }
        }
        private void timer_Tick(object sender, EventArgs e)
        {
            TimeClass timeobject = new TimeClass();

            hourlabelstrip.Text = timeobject.clockshape();
            datelabelstrip.Text = timeobject.dateshape();


            AgendaClass ev = new AgendaClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());

            string hora       = DateTime.Now.Hour.ToString() + ":" + DateTime.Now.Minute.ToString() + ":" + DateTime.Now.Second.ToString();
            string fechal     = DateTime.Now.Day.ToString() + "/" + DateTime.Now.Month.ToString() + "/" + DateTime.Now.Year.ToString();;
            string fechashort = DateTime.Now.Day.ToString() + "/" + DateTime.Now.Month.ToString();



            string orden = "SELECT DESCRIPCION, HORA, PRIORIDAD FROM " + UserAccessForm.getusername() + "_events_table WHERE (HORA='" + hora + "' AND ( FECHA='" + fechal + "' or `FECHA DE RECORDATORIO`='" + fechashort + "'))AND ACTIVO='SI';";

            if (ev.getnametarea(orden))
            {
                DireccionGestor.setsombrestatic(ev.getname());
                DireccionGestor.setotrostatic(ev.gettime());
                DireccionGestor.setprioridadstatic(ev.getprioridad());
                DireccionGestor.setestadostatic(true);

                SystemSounds.Hand.Play();
                MessageBox.Show("SON LAS " + ev.gettime() + " ES HORA DE " + ev.getname());
            }
            cuenta++;
            if (cuenta == 5000)
            {
                cuenta = 0;
                backbuttonstrip.PerformClick();
            }
        }
        public StudentFormSearch()
        {
            InitializeComponent();
            StudentsClass show = new StudentsClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());

            datecontrol.Hide();
            inscritobox.Text = "SI";
            string userDataName = UserAccessForm.getusername() + "_student_table";

            string allorden = "select `NOMBRE COMPLETO`,EDAD, `FECHA DE NACIMIENTO`, CURSO, HORARIO, NACIONALIDAD, SEXO, TELEFONO, DIRECCION, `NOMBRE DEL TUTOR` from " + userDataName + " where estudiando = '" + inscritobox.Text + "'; ";

            show.ShowDataGrid(findinggrid, allorden);
            encontradoslabel.Text = show.getcuenta().ToString();

            string curso = "select distinct CURSO from " + userDataName + "";

            show.Fillcombo(gradebox, curso);

            string nombre = "select distinct `NOMBRE COMPLETO` from " + userDataName + "";

            show.Fillcombo(namebox, nombre);

            string edad = "select distinct EDAD from " + userDataName + "";

            show.Fillcombo(edadbox, edad);
        }
        private void AddSubject_Load(object sender, EventArgs e)
        {
            OKbutton.BackColor         = Color.Green;
            cancelbutton.BackColor     = Color.Red;
            subjectverbutton.BackColor = Color.Blue;

            EmployeeClass ver   = new EmployeeClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
            string        orden = "SELECT `NOMBRE COMPLETO` FROM " + UserAccessForm.getusername() + "_employee_table;";

            ver.FillNameBox(comboasignado, orden);


            if (DireccionGestor.getorigen() == "inicio")
            {
                titlelabel.Text = "AGREGAR ASIGNATURA";
            }
            else if (DireccionGestor.getorigen() == "editor")
            {
                titlelabel.Text = "MODIFICAR ASIGNATURA";
                try {
                    asignaturatextbox.Text   = ShowSubjects.getinfo()[0];
                    comboasignado.Text       = ShowSubjects.getinfo()[1];
                    descripcionbox.Text      = ShowSubjects.getinfo()[2];
                    subjectverbutton.Enabled = false;
                } catch (NullReferenceException epd) { epd.ToString(); }
            }
            else if (DireccionGestor.getorigen() == "buscador")
            {
                titlelabel.Text          = "AGREGAR ASIGNATURA";
                subjectverbutton.Enabled = false;
            }

            ver.FillNameBox(comboasignado, orden);
        }
        private void EmployeeOutForm_Load(object sender, EventArgs e)
        {
            outbutton.Enabled = false;

            EmployeeClass emp = new EmployeeClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());

            //string orden = "SELECT * FROM " + UserAccessForm.getusername() + "_employee_table WHERE `NOMBRE COMPLETO` = '" + namelabel.Text + "';";
            emp.filleverylabel(namelabel, getintimelabel, gottendegreelabel, idbox, fechanacimientolabel, telephonelabel, schedulelabel, joblabel, nacionalitylabel, agelabel, tipomonedalabel, sueldolabel, referenciapersonallabel, telefonoreferencialabel, referencialabel, alergialabel, dolencialabel, medicinalabel, razonmedicinalabel, trabajandolabel, fechasalidalabel, sexolabel, direccionlabel, picturetextbox, emaillabel, DireccionGestor.getordensql());
            if (fechasalidalabel.Text == "" || fechasalidalabel.Text == "00/00/0000")
            {
                fechasalidalabel.Hide();
                titlesalida.Hide();
            }
            else
            {
                fechasalidalabel.Show();
                titlesalida.Show();
            }


            if (picturetextbox.Text != "")
            {
                string path        = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);
                string combinacion = System.IO.Path.Combine(path, UserAccessForm.getusername());

                string fotopath = System.IO.Path.Combine(combinacion, picturetextbox.Text);

                pictureBox.ImageLocation = fotopath;
            }
        }
        private void dataGrid_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try {
                LoginClass show         = new LoginClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
                string     userDataName = UserAccessForm.getusername() + "_subject_table";
                string     dato         = this.dataGrid.CurrentCell.Value.ToString();

                string orden = "select ASIGNATURA from " + userDataName + " where ASIGNATURA = '" + dato + "' or ASIGNADO='" + dato + "';";
                if (show.takedatatable(orden, "ASIGNATURA") != "")
                {
                    orden = "select ASIGNATURA from " + userDataName + " where ASIGNATURA = '" + dato + "' or ASIGNADO='" + dato + "';";
                    asignaturabox.Text = show.takedatatable(orden, "ASIGNATURA");
                    orden            = "select ASIGNADO from " + userDataName + " where ASIGNATURA = '" + dato + "' or ASIGNADO='" + dato + "';";
                    asignadobox.Text = show.takedatatable(orden, "ASIGNADO");
                    orden            = "SELECT DESCRIPCION FROM " + userDataName + " where ASIGNATURA = '" + asignaturabox.Text + "' AND ASIGNADO='" + asignadobox.Text + "';";
                    string descripcion = show.takedatatable(orden, "DESCRIPCION");

                    info    = new string[3];
                    info[0] = asignaturabox.Text;
                    info[1] = asignadobox.Text;
                    info[2] = descripcion;

                    editbutton.PerformClick();
                }
                else
                {
                    eliminarbutton.Enabled = false;
                    editbutton.Enabled     = false;
                    MessageBox.Show("DEBERIA SELECCIONAR EL CAMPO [ASIGNATURA] O ALMENOS EL CAMPO ASIGNADO [ASIGNADO]");
                }
            }
            catch (NullReferenceException pafh) { pafh.ToString(); }
        }
        private void namecombo_SelectedIndexChanged(object sender, EventArgs e)
        {
            LoginClass     AP = new LoginClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
            MovementsClass P  = new MovementsClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());

            if (DireccionGestor.getorigen() == "_payfor_table")
            {
                string orden = "SELECT COBRADOR,FECHA,CANTIDAD FROM  " + UserAccessForm.getusername() + "_payfor_table WHERE `TIPO MONEDA`='" + tipobox.Text + "' AND COBRADOR='" + namecombo.Text + "';";

                AP.ShowDataGridfound(datagrid, orden);
                AP.getcuenta();
                encontradolabel.Text = AP.getcuenta().ToString();
                titlepanel.Text      = "AGREGAR COBRADOR";
                orden = "SELECT SUM(CANTIDAD) FROM  " + UserAccessForm.getusername() + "_payfor_table WHERE `TIPO MONEDA`='" + tipobox.Text + "' AND COBRADOR='" + namecombo.Text + "';";
                P.getsuma(totalalbel, tipobox.Text, orden, "CANTIDAD");
            }
            else if (DireccionGestor.getorigen() == "_askfor_table")
            {
                string orden = "SELECT DEUDOR,FECHA,CANTIDAD FROM  " + UserAccessForm.getusername() + "_askfor_table WHERE `TIPO MONEDA`='" + tipobox.Text + "' AND DEUDOR='" + namecombo.Text + "';";

                AP.ShowDataGridfound(datagrid, orden);
                AP.getcuenta();
                encontradolabel.Text = AP.getcuenta().ToString();
                titlepanel.Text      = "AGREGAR COBRADOR";
                orden = "SELECT SUM(CANTIDAD) FROM  " + UserAccessForm.getusername() + "_askfor_table WHERE `TIPO MONEDA`='" + tipobox.Text + "' AND DEUDOR='" + namecombo.Text + "';";
                P.getsuma(totalalbel, tipobox.Text, orden, "CANTIDAD");


                ////////////////////////////////////////////////////////////
            }
        }
        private void buscarbutton_Click(object sender, EventArgs e)
        {
            LoginClass show  = new LoginClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
            string     orden = "SELECT ASIGNATURA,ASIGNADO,DESCRIPCION FROM " + UserAccessForm.getusername() + "_subject_table;";

            if (asignaturabox.Text == "" && asignadobox.Text == "")
            {
                orden = "SELECT ASIGNATURA,ASIGNADO,DESCRIPCION FROM " + UserAccessForm.getusername() + "_subject_table;";
            }
            if (asignaturabox.Text != "" && asignadobox.Text == "")
            {
                orden = "SELECT ASIGNATURA,ASIGNADO,DESCRIPCION FROM " + UserAccessForm.getusername() + "_subject_table WHERE ASIGNATURA='" + asignaturabox.Text + "';";
            }
            if (asignaturabox.Text == "" && asignadobox.Text != "")
            {
                orden = "SELECT ASIGNATURA,ASIGNADO,DESCRIPCION FROM " + UserAccessForm.getusername() + "_subject_table WHERE ASIGNADO='" + asignadobox.Text + "';";
            }
            if (asignaturabox.Text != "" && asignadobox.Text != "")
            {
                orden = "SELECT ASIGNATURA,ASIGNADO,DESCRIPCION FROM " + UserAccessForm.getusername() + "_subject_table WHERE ASIGNADO='" + asignadobox.Text + "' AND ASIGNATURA='" + asignaturabox.Text + "';";
            }



            show.ShowDataGridFound(dataGrid, orden);
            cuentalabel.Text = show.getcuenta().ToString();
        }
        private void outbutton_Click(object sender, EventArgs e)
        {
            StudentsClass  clas = new StudentsClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
            MovementsClass cas  = new MovementsClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());

            string user = UserAccessForm.getusername() + "_student_table";
            string orden;
            string control = datecontrol.Value.Day.ToString() + "/" + datecontrol.Value.Month.ToString() + "/" + datecontrol.Value.Year.ToString();

            if (actionbox.Text == "INSCRIBIR")
            {
                salida = "00/00/0000";
            }
            else
            {
                salida = birthDateBox.Value.Day.ToString() + "/" + birthDateBox.Value.Month.ToString() + "/" + birthDateBox.Value.Year.ToString();
            }
            string deuda;


            clas.ModifyData(user, namelabel.Text, salida, inscrito);

            StudentFormSearch menu = new StudentFormSearch();

            menu.WindowState = FormWindowState.Maximized;
            menu.Show();
            this.Close();
        }
        private void ShowSubjects_Load(object sender, EventArgs e)
        {
            texta.Hide();
            OKbutton.BackColor     = Color.Green;
            cancelbutton.BackColor = Color.Red;
            seguridadpanel.Hide();
            LoginClass show  = new LoginClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
            string     orden = "SELECT ASIGNATURA,ASIGNADO,DESCRIPCION FROM " + UserAccessForm.getusername() + "_subject_table";

            show.ShowDataGridFound(dataGrid, orden);
            cuentalabel.Text = show.getcuenta().ToString();
            /////////////////////////

            userlabel.Text = UserAccessForm.getusername();
            orden          = "select * from  USERS_TABLE where USER_NAME = '" + userlabel.Text + "';";
            show.fillpic(texta, orden);


            if (texta.Text != "")
            {
                string path        = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);
                string combinacion = System.IO.Path.Combine(path, "users");
                string fotopath    = System.IO.Path.Combine(combinacion, texta.Text);
                picture.ImageLocation = fotopath;
            }

            ////////////////////////
            orden = "SELECT DISTINCT ASIGNATURA FROM " + UserAccessForm.getusername() + "_subject_table";
            show.Fillcombo(asignaturabox, orden);
            orden = "SELECT DISTINCT ASIGNADO FROM " + UserAccessForm.getusername() + "_subject_table";
            show.Fillcombo(asignadobox, orden);
            editbutton.Enabled     = false;
            eliminarbutton.Enabled = false;
        }
Beispiel #11
0
        private void buscarbutton_Click(object sender, EventArgs e)
        {
            string      fechacontrol      = control.Value.Day.ToString() + "/" + control.Value.Month.ToString() + "/" + control.Value.Year.ToString();
            string      horacontrol       = control.Value.Hour.ToString() + ":" + control.Value.Minute.ToString() + ":" + control.Value.Second.ToString();
            string      fechacontrolshort = control.Value.Day.ToString() + "/" + control.Value.Month.ToString();
            string      fecha             = fechabox.Value.Day.ToString() + "/" + fechabox.Value.Month.ToString() + "/" + fechabox.Value.Year.ToString();
            string      fechashort        = fechabox.Value.Day.ToString() + "/" + fechabox.Value.Month.ToString();
            string      hora         = timebox.Value.Hour.ToString() + ":" + timebox.Value.Minute.ToString() + ":" + timebox.Value.Second.ToString();
            AgendaClass show         = new AgendaClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
            string      userDataName = UserAccessForm.getusername() + "_events_table";
            string      orden        = "select DESCRIPCION, `FECHA DE RECORDATORIO`, HORA from " + userDataName + " where (`DESCRIPCION` = '" + comboeventoname.Text + "' or FECHA ='" + fecha + "' or HORA ='" + hora + "' or `FECHA DE RECORDATORIO`='" + fechashort + "')AND ACTIVO ='" + activobox.Text + "'  ORDER BY PRIORIDAD ASC;";

            if (fecha == fechacontrol || fechashort == fechacontrolshort)
            {
                orden = "select DESCRIPCION, `FECHA DE RECORDATORIO`, HORA from " + userDataName + " where (`DESCRIPCION` = '" + comboeventoname.Text + "'  or HORA ='" + hora + "' )AND ACTIVO ='" + activobox.Text + "'  ORDER BY PRIORIDAD ASC;";
            }
            else if (hora == horacontrol)
            {
                orden = "select DESCRIPCION, `FECHA DE RECORDATORIO`, HORA from " + userDataName + " where (`DESCRIPCION` = '" + comboeventoname.Text + "' or FECHA ='" + fecha + "' or `FECHA DE RECORDATORIO`='" + fechashort + "')AND ACTIVO ='" + activobox.Text + "'  ORDER BY PRIORIDAD ASC;";
            }
            else if (fecha == fechacontrol || fechashort == fechacontrolshort || hora == horacontrol)
            {
                orden = "select DESCRIPCION, `FECHA DE RECORDATORIO`, HORA from " + userDataName + " where (`DESCRIPCION` = '" + comboeventoname.Text + "')AND ACTIVO ='" + activobox.Text + "' ORDER BY PRIORIDAD ASC;";
            }
            else
            {
                orden = "select DESCRIPCION, `FECHA DE RECORDATORIO`, HORA from " + userDataName + " where (`DESCRIPCION` = '" + comboeventoname.Text + "' or FECHA ='" + fecha + "' or HORA ='" + hora + "' or `FECHA DE RECORDATORIO`='" + fechashort + "')AND ACTIVO ='" + activobox.Text + "'  ORDER BY PRIORIDAD ASC;";
            }

            show.ShowDataGridfound(dataGridView1, orden);

            cuentalabel.Text = show.getcuenta().ToString();
        }
Beispiel #12
0
        private void dataGridView1_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try {
                AgendaClass show         = new AgendaClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
                string      userDataName = UserAccessForm.getusername() + "_events_table";
                string      dato         = this.dataGridView1.CurrentCell.Value.ToString();
                comboeventoname.Text = dato;
                string orden = "select * from " + userDataName + " where `DESCRIPCION` = '" + comboeventoname.Text + "' ORDER BY PRIORIDAD ASC;";
                show.fillboxes(comboeventoname, fechabox, activobox, timebox, orden);

                if (activobox.Text == "NO")
                {
                    quitarbutton.Enabled = false;
                }
                else
                {
                    quitarbutton.Enabled = true;
                }

                if (comboeventoname.Text != "")
                {
                    editbutton.Enabled = true;
                }
                else
                {
                    editbutton.Enabled = false;
                }

                DireccionGestor.setsombrestatic(comboeventoname.Text);
                DireccionGestor.setotrostatic(fechabox.Value.Day.ToString() + "/" + fechabox.Value.Month.ToString() + "/" + fechabox.Value.Year.ToString());
            }
            catch (NullReferenceException pafh) { pafh.ToString(); }
        }
        private void dataGrid_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            try {
                dataout = new string[5];
                LoginClass ver  = new LoginClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
                string     dato = this.dataGrid.CurrentCell.Value.ToString();

                string orden = "SELECT * FROM " + UserAccessForm.getusername() + "_contacts_table WHERE NOMBRE='" + dato + "';";
                if (ver.fillcombos(namecombo, telefonocombo, orden))
                {
                    editbutton.Enabled   = true;
                    quitarbutton.Enabled = true;
                    dataout[0]           = namecombo.Text;
                    dataout[1]           = telefonocombo.Text;
                    dataout[2]           = LoginClass.getdata()[0];
                    dataout[3]           = LoginClass.getdata()[1];
                    dataout[4]           = LoginClass.getdata()[2];
                }
                else
                {
                    editbutton.Enabled   = false;
                    quitarbutton.Enabled = false;
                }
            } catch (NullReferenceException pafh) { pafh.ToString(); }
        }
        private void searchbutton_Click(object sender, EventArgs e)
        {
            LoginClass show  = new LoginClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
            string     orden = "SELECT ID, USER_NAME,USERTIPO,FECHA_CREACION,FECHA_LAST_CONECTION,HORA_LAST_CONECTION FROM users.users_table;";

            if ((tipobox.Text == "" || tipobox.Text == "TODOS") && (namebox.Text == "" || namebox.Text == "TODOS"))
            {
                orden = "SELECT ID, USER_NAME,USERTIPO,FECHA_CREACION,FECHA_LAST_CONECTION,HORA_LAST_CONECTION FROM users.users_table;";
            }
            else if ((tipobox.Text == "" && namebox.Text != "") || (tipobox.Text == "TODOS" && namebox.Text != "TODOS"))
            {
                orden = "SELECT ID, USER_NAME,USERTIPO,FECHA_CREACION,FECHA_LAST_CONECTION,HORA_LAST_CONECTION FROM users.users_table where USER_NAME='" + namebox.Text + "';";
            }
            else if ((tipobox.Text != "" && namebox.Text == "") || (tipobox.Text != "TODOS" && namebox.Text == "TODOS"))
            {
                orden = "SELECT ID, USER_NAME,USERTIPO,FECHA_CREACION,FECHA_LAST_CONECTION,HORA_LAST_CONECTION FROM users.users_table where USERTIPO='" + tipobox.Text + "';";
            }
            else
            {
                orden = "SELECT ID, USER_NAME,USERTIPO,FECHA_CREACION,FECHA_LAST_CONECTION,HORA_LAST_CONECTION FROM users.users_table where USERTIPO='" + tipobox.Text + "' AND  USER_NAME='" + namebox.Text + "';";
            }



            show.ShowDataGridFound(findinggrid, orden);
            encontradoslabel.Text = show.getcuenta().ToString();
        }
        private void asignadobox_SelectedIndexChanged(object sender, EventArgs e)
        {
            LoginClass show  = new LoginClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
            string     orden = "SELECT ASIGNATURA,ASIGNADO,DESCRIPCION FROM " + UserAccessForm.getusername() + "_subject_table WHERE ASIGNADO='" + asignadobox.Text + "';";

            show.ShowDataGridFound(dataGrid, orden);
            cuentalabel.Text = show.getcuenta().ToString();
        }
        private void telefonocombo_SelectedIndexChanged(object sender, EventArgs e)
        {
            string     orden = "SELECT NOMBRE,TELEFONO,DIRECCION,EMAIL FROM " + UserAccessForm.getusername() + "_contacts_table WHERE TELEFONO='" + telefonocombo.Text + "'; ";
            LoginClass ver   = new LoginClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());

            ver.ShowDataGridFound(dataGrid, orden);
            cuentalabel.Text = ver.getcuenta().ToString();
        }
 private void OKbutton_Click(object sender, EventArgs e)
 {
     if (passwordbox.Text == "" || repettextbox.Text == "")
     {
         MessageBox.Show("HAY DATOS CLAVES VACIOS, RECTIFIQUE");
         if (passwordbox.Text == "")
         {
             passwordbox.BackColor = Color.Red;
         }
         else
         {
             passwordbox.BackColor = Color.Green;
         }
         if (repettextbox.Text == "")
         {
             repettextbox.BackColor = Color.Red;
         }
         else
         {
             repettextbox.BackColor = Color.Green;
         }
     }
     else if (passwordbox.Text != repettextbox.Text)
     {
         repettextbox.BackColor = Color.Red;
         MessageBox.Show("LOS CAMPOS SON DIFERENTES, DEBERIAN SER IGUALES PARA VALIDARLOS ");
     }
     else
     {
         LoginClass show = new LoginClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
         try {
             if (show.setConection(userlabel.Text, passwordbox.Text))
             {
                 string complete = "`" + UserAccessForm.getusername() + "_subject_table`";
                 MessageBox.Show("LA ASIGNATURA " + asignaturabox.Text + " DE " + asignadobox.Text + " HA SIDO ELIMINADA");
                 repettextbox.Text      = "";
                 passwordbox.Text       = "";
                 repettextbox.BackColor = Color.White;
                 passwordbox.BackColor  = Color.White;
                 limpiarbutton.PerformClick();
                 seguridadpanel.Hide();
             }
             else
             {
                 MessageBox.Show("ERROR AL INTRODUCIR LAS CONTRASEÑAS");
                 repettextbox.Text      = "";
                 passwordbox.Text       = "";
                 repettextbox.BackColor = Color.White;
                 passwordbox.BackColor  = Color.White;
                 limpiarbutton.PerformClick();
                 seguridadpanel.Hide();
             }
         } catch (NullReferenceException OPR) {
             OPR.ToString();
             limpiarbutton.PerformClick();
         }
     }
 }
        private void changelabel_Click(object sender, EventArgs e)
        {
            panelpad.Hide();
            tipobox.Text = "DOP";
            tipo.Text    = "DOP";
            LoginClass AP = new LoginClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());

            editbutton.Enabled   = false;
            quitarbutton.Enabled = false;



            if (DireccionGestor.getorigen() == "_payfor_table")
            {
                namecombo.Text   = "";
                cantidadbox.Text = "";
                palpad.BackColor = Color.Red;
                DireccionGestor.setorigen("_askfor_table");
                titlelabel.Text  = "CUENTAS POR COBRAR";
                changelabel.Text = "CUENTAS POR PAGAR";
                string orden = "SELECT DEUDOR,FECHA,CANTIDAD FROM  " + UserAccessForm.getusername() + "_askfor_table WHERE `TIPO MONEDA`='" + tipobox.Text + "';";
                AP.ShowDataGridfound(datagrid, orden);
                encontradolabel.Text = AP.getcuenta().ToString();
                titlepanel.Text      = "AGREGAR DEUDOR";
                orden = "SELECT SUM(CANTIDAD) FROM  " + UserAccessForm.getusername() + "_askfor_table WHERE `TIPO MONEDA`='" + tipobox.Text + "';";
                MovementsClass Ad = new MovementsClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());

                Ad.getsuma(totalalbel, tipobox.Text, orden, "CANTIDAD");
                AP = new LoginClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
                string orden2 = "SELECT DEUDOR FROM  " + UserAccessForm.getusername() + "_askfor_table ;";

                AP.Fillcombo(namecombo, orden2);
                panelpad.BackColor = Color.DarkRed;
            }
            else if (DireccionGestor.getorigen() == "_askfor_table")
            {
                namecombo.Text   = "";
                cantidadbox.Text = "";
                palpad.BackColor = Color.Blue;
                DireccionGestor.setorigen("_payfor_table");
                titlelabel.Text  = "CUENTAS POR PAGAR";
                changelabel.Text = "CUENTAS POR COBRAR";
                string orden = "SELECT COBRADOR,FECHA,CANTIDAD FROM  " + UserAccessForm.getusername() + "_payfor_table WHERE `TIPO MONEDA`='" + tipobox.Text + "';";
                AP.ShowDataGridfound(datagrid, orden);
                encontradolabel.Text = AP.getcuenta().ToString();
                titlepanel.Text      = "AGREGAR COBRADOR";
                panelpad.BackColor   = Color.MidnightBlue;
                orden = "SELECT SUM(CANTIDAD) FROM  " + UserAccessForm.getusername() + "_payfor_table WHERE `TIPO MONEDA`='" + tipobox.Text + "';";
                MovementsClass Ad = new MovementsClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());

                Ad.getsuma(totalalbel, tipobox.Text, orden, "CANTIDAD");
                AP = new LoginClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
                string orden2 = "SELECT COBRADOR FROM  " + UserAccessForm.getusername() + "_payfor_table ;";

                AP.Fillcombo(namecombo, orden2);
            }
        }
        private void cargobox_SelectedIndexChanged(object sender, EventArgs e)
        {
            string        userDataName = UserAccessForm.getusername() + "_employee_table";
            EmployeeClass show         = new EmployeeClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
            string        orden        = "select `NOMBRE COMPLETO`, CEDULA, `FECHA DE NACIMIENTO`,SEXO , `TITULO UNIVERSITARIO`, PUESTO , EDAD, HORARIO, TELEFONO, DIRECCION from " + userDataName + " where PUESTO like '%" + cargobox.Text + "%' AND TRABAJANDO='" + workingbox.Text + "';";

            show.ShowDataGridFound(findinggrid, orden);
            encontradoslabel.Text = show.getcuenta().ToString();
        }
        public UsersShowForm()
        {
            InitializeComponent();
            LoginClass show = new LoginClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());

            show.ShowDataGrid(findinggrid);
            encontradoslabel.Text = show.getcuenta().ToString();
            show.FillFieldsForm(namebox);
        }
        public StudentOutForm()
        {
            InitializeComponent();
            rutafoto.Hide();
            actionbox.Text = "DESINSCRIBIR";

            namelabel.Text = StudentsClass.getstaticname().ToString();
            StudentsClass student = new StudentsClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
            string        orden   = "SELECT * FROM " + UserAccessForm.getusername() + "_student_table WHERE `NOMBRE COMPLETO` = '" + namelabel.Text + "';";

            student.filleverylabel(agelabel, gradelabel, horariolabel, birthdatelabel, nacionalitylabel, telephonelabel, adresslabel, sexolabel, inscritolabel, fechaentradalabel, fechasalidalabel, numeroactalabel, foliolabel, librolabel, yearlabel, oficialialabel, municipiolabel, alergialabel, medicinalabel, razonmedicinalabel, sindromelabel, tutorlabel, cedulalabel, mensualidadlabel, tipomoneda, rutafoto, parentescolabel, emaillabel, orden);


            if (inscritolabel.Text == "SI")
            {
                actionbox.Text = "DESINSCRIBIR";
                fechasalidalabel.Show();
                titulofechasalida.Show();
                //birthDateBox.Text = fechasalidalabel.Text;
                birthDateBox.Show();
                titulosalidaopen.Show();
            }
            if (inscritolabel.Text == "NO")
            {
                fechasalidalabel.Hide();
                titulofechasalida.Hide();
                birthDateBox.Hide();
                titulosalidaopen.Hide();
                actionbox.Text = "INSCRIBIR";
            }

            if (inscritolabel.Text == "NO")
            {
                actionbox.Text = "INSCRIBIR";
            }
            if (inscritolabel.Text == "SI")
            {
                actionbox.Text = "DESINSCRIBIR";
                fechasalidalabel.Hide();
                titulofechasalida.Hide();
            }



            if (rutafoto.Text != "")
            {
                string path        = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);
                string combinacion = System.IO.Path.Combine(path, UserAccessForm.getusername());

                string fotopath = System.IO.Path.Combine(combinacion, rutafoto.Text);

                pictureBox.ImageLocation = fotopath;
            }
            datecontrol.Hide();
            datecontrol.Enabled = false;
        }
        private void limpiarbutton_Click(object sender, EventArgs e)
        {
            LoginClass show  = new LoginClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
            string     orden = "SELECT ASIGNATURA,ASIGNADO,DESCRIPCION FROM " + UserAccessForm.getusername() + "_subject_table";

            show.ShowDataGridFound(dataGrid, orden);
            cuentalabel.Text   = show.getcuenta().ToString();
            asignaturabox.Text = "TODOS";
            asignadobox.Text   = "TODOS";
        }
Beispiel #23
0
        private void pictureBox4_Click(object sender, EventArgs e)
        {
            LoginClass create = new LoginClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());

            create.CreateEmployeeTable(UserAccessForm.getusername());
            EmployeeFormSearch searchemployee = new EmployeeFormSearch();

            searchemployee.WindowState = FormWindowState.Normal;
            searchemployee.Show();
            this.Close();
        }
Beispiel #24
0
        private void pictureBox6_Click(object sender, EventArgs e)
        {
            LoginClass create = new LoginClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());

            create.CreateMovementsTable(UserAccessForm.getusername());
            origen = "inicio";
            GastosForm gastosobject = new GastosForm();

            gastosobject.WindowState = FormWindowState.Normal;
            gastosobject.Show();
        }
        private void cleanbuttonstrip_Click(object sender, EventArgs e)
        {
            LoginClass show = new LoginClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());

            namebox.Text = "TODOS";
            tipobox.Text = "TODOS";
            string orden = "SELECT ID, USER_NAME,USERTIPO,FECHA_CREACION,FECHA_LAST_CONECTION,HORA_LAST_CONECTION FROM users.users_table;";

            show.ShowDataGridFound(findinggrid, orden);
            encontradoslabel.Text = show.getcuenta().ToString();
        }
Beispiel #26
0
        private void pictureBox8_Click(object sender, EventArgs e)
        {
            LoginClass create = new LoginClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());

            create.CreateMovementsTable(UserAccessForm.getusername());
            MovementsForms moveobject = new MovementsForms();

            moveobject.WindowState = FormWindowState.Normal;
            moveobject.Show();
            this.Close();
        }
Beispiel #27
0
        private void aSIGNATURASToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            LoginClass create = new LoginClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());

            create.CreateSubjectTable(UserAccessForm.getusername());
            origen = "inicio";
            ShowSubjects agendaobjectl = new ShowSubjects();

            agendaobjectl.WindowState = FormWindowState.Normal;
            agendaobjectl.Show();
        }
Beispiel #28
0
        private void cUENTASPORPAGARToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LoginClass create = new LoginClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());

            create.CreateCountPayForTable(UserAccessForm.getusername());
            origen = "_payfor_table";
            PendientesForm agendaobjectl = new PendientesForm();

            agendaobjectl.WindowState = FormWindowState.Normal;
            agendaobjectl.Show();
        }
        private void UserSecurityForm_Load(object sender, EventArgs e)
        {
            picturetext.Hide();
            string dbserver   = "";
            string dbname     = "";
            string dbuser     = "";
            string dbpassword = "";
            string dbport     = "";

            string       path       = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
            string       targetPath = System.IO.Path.Combine(path, "users");
            FuncionClass f          = new FuncionClass();

            try
            {
                dbserver   = f.readperfil(targetPath)[0];
                dbname     = f.readperfil(targetPath)[1];
                dbuser     = f.readperfil(targetPath)[2];
                dbpassword = f.readperfil(targetPath)[3];
                dbport     = f.readperfil(targetPath)[4];
            }
            catch (NullReferenceException er)
            {
                er.ToString();
            }

            f = new FuncionClass(dbserver, dbname, dbuser, dbpassword, dbport);



            LoginClass show = new LoginClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());

            try
            {
                string orden = "select * from users_table WHERE USER_NAME = '" + UsersShowForm.getdatum()[0] + "' AND USERTIPO = '" + UsersShowForm.getdatum()[1] + "' AND ID = '" + UsersShowForm.getdatum()[2] + "' AND FECHA_CREACION = '" + UsersShowForm.getdatum()[3] + "'; ";

                show.fillsecurity(userlabel, asklabel1, asklabel2, asklabel3, asklabel4, asklabel5, picturetext, orden);
                if (picturetext.Text != "")
                {
                    path = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);
                    string combinacion = System.IO.Path.Combine(path, UserAccessForm.getusername());

                    string fotopath = System.IO.Path.Combine(combinacion, picturetext.Text);
                    pictureBox.ImageLocation = fotopath;
                }
                problempanel.Hide();
                picturetext.Hide();
            }
            catch (NullReferenceException pad) {
                problempanel.Hide();
                picturetext.Hide();
                pad.ToString();
            }
        }
Beispiel #30
0
        private void comboeventoname_SelectedIndexChanged(object sender, EventArgs e)
        {
            AgendaClass show         = new AgendaClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
            string      userDataName = UserAccessForm.getusername() + "_events_table";
            string      orden        = "select DESCRIPCION, `FECHA DE RECORDATORIO`, HORA from " + userDataName + " where  DESCRIPCION= '" + comboeventoname.Text + "' AND ACTIVO ='" + activobox.Text + "'  ORDER BY PRIORIDAD ASC;";

            show.ShowDataGridfound(dataGridView1, orden);


            cuentalabel.Text = show.getcuenta().ToString();
        }