Example #1
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();
        }
        private void agendaAdd_Load(object sender, EventArgs e)
        {
            //SystemSounds.Hand.Play();
            playmusic.Hide();
            stopmusic.Hide();

            activobox.Hide();
            labelactivo.Hide();
            AgendaClass add   = new AgendaClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
            string      orden = "SELECT distinct `SONIDO` FROM " + UserAccessForm.getusername() + "_events_table;";

            add.Fillcombo(melodybox, orden);

            if (DireccionGestor.getorigen() == "modificar")
            {
                activobox.Show();
                labelactivo.Show();
                titlelabel.Text = "EDITAR TAREAS";
                motivoBox.Text  = DireccionGestor.getnombrestatic();
                fecha           = DireccionGestor.getotrostatic();

                if (fecha != "00/00/0000")
                {
                    datebox.Text = fecha;
                }
                else
                {
                    datebox.Enabled = false;
                }


                AgendaClass mod = new AgendaClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
                orden = "SELECT * FROM " + UserAccessForm.getusername() + "_events_table WHERE DESCRIPCION= '" + DireccionGestor.getnombrestatic() + "' and FECHA = '" + DireccionGestor.getotrostatic() + "';";
                mod.filleverything(activobox, priority, shortdate, hora, lunescheck, martescheckBox, miercolescheckBox, juevescheckBox, viernescheckbox, sabadocheckBox, domingocheckBox, comborepeticion, melodybox, orden);

                if (hora != "00:00:00")
                {
                    timeBox.Text = hora;
                }
                else
                {
                    timeBox.Enabled = false;
                }

                //MessageBox.Show("LUNES "+lunes+", MARTES "+martes+", MIERCOLES "+miercoles+", JUEVES "+jueves+", VIERNES "+viernes+", SABADO "+sabado+", DOMINGO "+domingo)



                if (lunescheck.Checked == false && martescheckBox.Checked == false && miercolescheckBox.Checked == false && juevescheckBox.Checked == false && viernescheckbox.Checked == false && sabadocheckBox.Checked == false && domingocheckBox.Checked == false)
                {
                    //comborepeticion.Text = "NO";
                    paneldias.Hide();
                    datebox.Enabled = true;
                }
                else if (lunescheck.Checked == false && martescheckBox.Checked == false && miercolescheckBox.Checked == false && juevescheckBox.Checked == false && viernescheckbox.Checked == false && sabadocheckBox.Checked == false && domingocheckBox.Checked == false)
                {
                    //comborepeticion.Text = "ELEGIR";
                    paneldias.Show();

                    datebox.Enabled = false;
                    fecha           = "00/00/0000";
                }
                else if (lunescheck.Checked == true && martescheckBox.Checked == true && miercolescheckBox.Checked == true && juevescheckBox.Checked == true && viernescheckbox.Checked == true && sabadocheckBox.Checked == false && domingocheckBox.Checked == false)
                {
                    //comborepeticion.Text = "DIARIO";
                    paneldias.Show();

                    datebox.Enabled = false;
                    fecha           = "00/00/0000";
                }
                else if (lunescheck.Checked == true && martescheckBox.Checked == true && miercolescheckBox.Checked == true && juevescheckBox.Checked == true && viernescheckbox.Checked == true && sabadocheckBox.Checked == true && domingocheckBox.Checked == true)
                {
                    //comborepeticion.Text = "TODOS LOS DIAS";
                    paneldias.Show();
                    fecha           = "00/00/0000";
                    datebox.Enabled = false;
                }
            }
            else
            {
                priority.Text        = "NORMAL";
                comborepeticion.Text = "NO";
            }


            OKbutton.BackColor        = Color.Green;
            cancelbutton.BackColor    = Color.Red;
            tareasverbutton.BackColor = Color.Blue;
        }