예제 #1
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();
        }
예제 #2
0
        private void limpiarbutton_Click(object sender, EventArgs e)
        {
            comboeventoname.Text = "";
            activobox.Text       = "";
            timebox.Text         = DateTime.Now.TimeOfDay.ToString();
            fechabox.Text        = DateTime.Now.TimeOfDay.ToString();
            AgendaClass show = new AgendaClass();

            show.ShowDataGrid(dataGridView1, UserAccessForm.getusername());
            cuentalabel.Text = show.getcuenta().ToString();
        }
예제 #3
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();
        }
예제 #4
0
        private void AgendaEvents_Load(object sender, EventArgs e)
        {
            control.Hide();
            editbutton.Enabled   = false;
            quitarbutton.Enabled = false;
            activobox.Text       = "SI";
            AgendaClass ver = new AgendaClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());

            ver.ShowDataGrid(dataGridView1, UserAccessForm.getusername());
            ver = new AgendaClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());

            string orden = "SELECT `DESCRIPCION` FROM " + UserAccessForm.getusername() + "_events_table ORDER BY PRIORIDAD ASC;";

            ver.Fillcombo(comboeventoname, orden);
            cuentalabel.Text = ver.getcuenta().ToString();
        }
예제 #5
0
        private void timer_Tick(object sender, EventArgs e)
        {
            //cont.Text = cuenta.ToString();
            cuenta++;
            cuentasonido++;

            TimeClass timeobject = new TimeClass();

            clocklabel.Text = timeobject.clockshape();
            datelabel.Text  = timeobject.dateshape();

            string day = DateTime.Now.DayOfWeek.ToString();

            switch (day)
            {
            case "Monday":
                daylabel.Text = "LUNES";
                break;

            case "Tuesday":
                daylabel.Text = "MARTES";
                break;

            case "Wednesday":
                daylabel.Text = "MIERCOLES";
                break;

            case "Thursday":
                daylabel.Text = "JUEVES";
                break;

            case "Friday":
                daylabel.Text = "VIERNES";
                break;

            case "Saturday":
                daylabel.Text = "SABADO";
                break;

            case "Sunday":
                daylabel.Text = "DOMINGO";
                break;
            }


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

            ev.ShowDataGridinicio(datainicio, UserAccessForm.getusername(), fecha, daylabel.Text);
            cuentalabel.Text = ev.getcuenta().ToString();

            if (cuenta == 600)
            {
                cuenta = 0;
                panel1.Hide();
                eventonamelabel.Text = "";
                eventohoralabel.Text = "";
                estadostatic         = false;
            }

            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();



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

            if (ev.getnametarea(eventonamelabel, eventohoralabel, prioridadbox, melodybox, orden))
            {
                SystemSounds.Hand.Play();

                panel1.Show();

                cuenta       = 0;
                cuentasonido = 0;



                setsombrestatic(eventonamelabel.Text);
                setotrostatic(eventohoralabel.Text);
                setprioridadstatic(prioridadbox.Text);
                setestadostatic(true);

                if (prioridadbox.Text == "0")
                {
                    panel1.BackColor = Color.Red;
                }
                else if (prioridadbox.Text == "1")
                {
                    panel1.BackColor = Color.Orange;
                }
                else if (prioridadbox.Text == "2")
                {
                    panel1.BackColor = Color.Yellow;
                }

                if (melodybox.Text != "")
                {
                    estatesong = false;
                    string path        = Environment.GetFolderPath(Environment.SpecialFolder.MyMusic);
                    string combinacion = System.IO.Path.Combine(path, UserAccessForm.getusername());

                    string melodypath = System.IO.Path.Combine(combinacion, melodybox.Text);

                    wplayer.URL = melodypath;
                    wplayer.controls.play();
                }
                else
                {
                    estatesong = true;
                }

                if (MessageBox.Show("SON LAS " + eventohoralabel.Text + " ES HORA DE " + eventonamelabel.Text, "PARAR", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                {
                    cuentasonido = 0;

                    estatesong = false;
                }
                else
                {
                    cuentasonido = 0;
                    estatesong   = true;
                }
            }

            if (cuentasonido == 300 && melodybox.Text != "" && estatesong == true)
            {
                if (MessageBox.Show("SON LAS " + eventohoralabel.Text + " ES HORA DE " + eventonamelabel.Text, "PARAR", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                {
                    cuentasonido = 0;
                    estatesong   = false;
                }
                else
                {
                    cuentasonido = 0;
                    estatesong   = true;
                }
            }

            if (estatesong == false)
            {
                wplayer.controls.stop();
            }
        }
예제 #6
0
        private void DireccionGestor_Load(object sender, EventArgs e)
        {
            pagolabel.Hide();
            cobrolabel.Hide();
            addstudentlabel.Hide();
            verstudentlabel.Hide();
            addempleadolabel.Hide();
            verempleadolabel.Hide();
            ingresolabel.Hide();
            gastolabel.Hide();
            movimientolabel.Hide();
            melodybox.Hide();
            if (estadostatic == true && cuenta < 400)
            {
                if (getestadostatic() == true)
                {
                    eventonamelabel.Text = getnombrestatic();
                    eventohoralabel.Text = getotrostatic();
                    prioridadbox.Text    = getprioridadstatic();
                    setestadostatic(true);

                    if (prioridadbox.Text == "0")
                    {
                        panel1.BackColor = Color.Red;
                    }
                    else if (prioridadbox.Text == "1")
                    {
                        panel1.BackColor = Color.Orange;
                    }
                    else if (prioridadbox.Text == "2")
                    {
                        panel1.BackColor = Color.Yellow;
                    }


                    panel1.Show();
                }
                else
                {
                    panel1.Hide();
                }
            }



            estadostatic = false;


            prioridadbox.Hide();
            quitarbutton.Enabled = false;



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

            ev.ShowDataGridinicio(datainicio, UserAccessForm.getusername(), fecha, daylabel.Text);
            cuentalabel.Text = ev.getcuenta().ToString();

            if (UserAccessForm.getusername() != "")
            {
                //nameuserlabel.Text = UserAccessForm.getusername();
                statelabel.Text   = "Conectado";
                databaseinfo.Text = "MySQL " + UserAccessForm.getdbserver();
            }
        }