Example #1
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 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();
            }
        }
Example #3
0
 private void editbutton_Click(object sender, EventArgs e)
 {
     if (comboeventoname.Text == "")
     {
         MessageBox.Show("DEBE SELECCIONAR UNA TAREA PARA EDITAR");
     }
     else
     {
         DireccionGestor.setsombrestatic(comboeventoname.Text);
         DireccionGestor.setotrostatic(fechabox.Value.Day.ToString() + "/" + fechabox.Value.Month.ToString() + "/" + fechabox.Value.Year.ToString());
         DireccionGestor.setorigen("modificar");
         agendaAdd agendaobject = new agendaAdd();
         agendaobject.WindowState = FormWindowState.Normal;
         agendaobject.Show();
     }
 }
        private void editbutton_Click(object sender, EventArgs e)
        {
            DireccionGestor.setorigen("editor");

            DireccionGestor.setsombrestatic(namelabel.Text);
            DireccionGestor.setotrostatic(joblabel.Text);
            string        userDataName = UserAccessForm.getusername() + "_employee_table";
            EmployeeClass student      = new EmployeeClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
            string        orden        = "SELECT * FROM " + userDataName + " WHERE `NOMBRE COMPLETO`= '" + namelabel.Text + "' and EDAD = '" + agelabel.Text + "';";

            DireccionGestor.setorigen("editor");
            DireccionGestor.setordensql(orden);
            EmployeeForm studentaddobject = new EmployeeForm();

            studentaddobject.WindowState = FormWindowState.Maximized;
            studentaddobject.Show();
            this.Close();
        }
        private void editbutton_Click(object sender, EventArgs e)
        {
            DireccionGestor.setsombrestatic(namelabel.Text);

            DireccionGestor.setotrostatic(gradelabel.Text);
            string        userDataName = UserAccessForm.getusername() + "_student_table";
            StudentsClass student      = new StudentsClass();
            string        orden        = "select * from " + userDataName + " where `NOMBRE COMPLETO` = '" + namelabel.Text + "' and CURSO= '" + gradelabel.Text + "';";

            DireccionGestor.setorigen("editor");
            DireccionGestor.setordensql(orden);

            StudentForm studentaddobject = new StudentForm();

            studentaddobject.WindowState = FormWindowState.Maximized;
            studentaddobject.Show();
            this.Close();
        }
        private void editbutton_Click(object sender, EventArgs e)
        {
            if (cargobox.Text == "" || edadbox.Text == "" || comboname.Text == "")
            {
                MessageBox.Show("Hay datos importantes faltantes.");

                if (cargobox.Text == "")
                {
                    cargobox.BackColor = Color.Red;
                }
                if (edadbox.Text == "")
                {
                    edadbox.BackColor = Color.Red;
                }
                if (comboname.Text == "")
                {
                    comboname.BackColor = Color.Red;
                }
            }
            else
            {
                DireccionGestor.setsombrestatic(comboname.Text);
                DireccionGestor.setedadstatic(int.Parse(edadbox.Text));
                DireccionGestor.setotrostatic(cargobox.Text);
                string        userDataName = UserAccessForm.getusername() + "_employee_table";
                EmployeeClass student      = new EmployeeClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
                string        orden        = "SELECT * FROM " + userDataName + " WHERE `NOMBRE COMPLETO`= '" + comboname.Text + "' and EDAD = '" + edadbox.Text + "' and ID='" + EmployeeClass.getids() + "';";

                DireccionGestor.setorigen("editor");
                DireccionGestor.setordensql(orden);


                if (student.fillcombos(comboname, edadbox, cargobox, orden) == true)
                {
                    EmployeeForm studentaddobject = new EmployeeForm();
                    studentaddobject.WindowState = FormWindowState.Maximized;
                    studentaddobject.Show();
                    this.Close();
                }
            }
        }
Example #7
0
 private void datainicio_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (nombre != "")
     {
         quitarbutton.Enabled = true;
     }
     else
     {
         quitarbutton.Enabled = false;
     }
     try {
         AgendaClass show         = new AgendaClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
         string      userDataName = UserAccessForm.getusername() + "_events_table";
         string      dato         = this.datainicio.CurrentCell.Value.ToString();
         nombre = dato;
         string orden = "select * from " + userDataName + " where `DESCRIPCION` = '" + nombre + "' ORDER BY PRIORIDAD ASC;";
         show.getname(nombre, fecha, prioridad, orden);
         DireccionGestor.setsombrestatic(nombre);
         DireccionGestor.setotrostatic(fecha);
     } catch (NullReferenceException pafh) { pafh.ToString(); }
 }
        private void editbutton_Click(object sender, EventArgs e)
        {
            if (gradebox.Text == "" || edadbox.Text == "" || namebox.Text == "")
            {
                MessageBox.Show("Hay datos importantes faltantes.");

                if (gradebox.Text == "")
                {
                    gradebox.BackColor = Color.Red;
                }
                if (edadbox.Text == "")
                {
                    edadbox.BackColor = Color.Red;
                }
                if (namebox.Text == "")
                {
                    namebox.BackColor = Color.Red;
                }
            }
            else
            {
                DireccionGestor.setsombrestatic(namebox.Text);
                DireccionGestor.setedadstatic(int.Parse(edadbox.Text));
                DireccionGestor.setotrostatic(gradebox.Text);
                string        userDataName = UserAccessForm.getusername() + "_student_table";
                StudentsClass student      = new StudentsClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
                string        orden        = "select * from " + userDataName + " where `NOMBRE COMPLETO` = '" + namebox.Text + "' and EDAD = '" + edadbox.Text + "' and CURSO= '" + gradebox.Text + "';";
                if (student.fillcombos(namebox, edadbox, gradebox, orden) == true)
                {
                    DireccionGestor.setorigen("editor");
                    DireccionGestor.setordensql(orden);

                    StudentForm studentaddobject = new StudentForm();
                    studentaddobject.WindowState = FormWindowState.Maximized;
                    studentaddobject.Show();
                    this.Close();
                }
            }
        }
Example #9
0
        private void addbuttonstrip_Click(object sender, EventArgs e)
        {
            if (DireccionGestor.getorigen() == "inicio")
            {
                if (reasonbox.Text == "" || cuantitybox.Text == "" || explanationbox.Text == "")
                {
                    MessageBox.Show("Hay datos importantes vacios, termine el formulario.");
                    if (reasonbox.Text == "")
                    {
                        reasonbox.BackColor = Color.Red;
                    }
                    else
                    {
                        reasonbox.BackColor = Color.Green;
                    }

                    if (cuantitybox.Text == "")
                    {
                        cuantitybox.BackColor = Color.Red;
                    }
                    else
                    {
                        cuantitybox.BackColor = Color.Green;
                    }

                    if (explanationbox.Text == "")
                    {
                        explanationbox.BackColor = Color.Red;
                    }
                    else
                    {
                        explanationbox.BackColor = Color.Green;
                    }
                }
                else
                {
                    try
                    {
                        string         userDataName = UserAccessForm.getusername() + "_movements_table";
                        MovementsClass save         = new MovementsClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
                        double         cuantity     = double.Parse(cuantitybox.Text);
                        string         date         = datebox.Value.Day.ToString() + "/" + datebox.Value.Month.ToString() + "/" + datebox.Value.Year.ToString();
                        string         hour         = horabox.Value.Hour.ToString() + ":" + horabox.Value.Minute.ToString() + ":" + horabox.Value.Second.ToString();



                        DireccionGestor.setotrostatic("refresh");
                        if (save.setProfit(date, hour, reasonbox.Text, cuantity, monedatipo.Text, datebox.Value.Day.ToString(), datebox.Value.Month.ToString()
                                           , datebox.Value.Year.ToString(), horabox.Value.Hour.ToString(), horabox.Value.Minute.ToString(), horabox.Value.Second.ToString(),
                                           explanationbox.Text, fondoorigen.Text, userDataName))
                        {
                            save.OrderID(userDataName);
                            MessageBox.Show("NUEVO INGRESO DE DINERO A LAS " + hour + " HA SIDO REGISTRADO");
                            if (MessageBox.Show("REGISTRAR OTRO INGRESO DE DINERO?", "REGISTRAR", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
                            {
                                save = new MovementsClass();
                                this.Close();
                                IngresosForm menu = new IngresosForm();
                                menu.WindowState = FormWindowState.Normal;
                                menu.Show();
                            }
                            else
                            {
                                save = new MovementsClass();
                                this.Close();
                            }
                        }
                        else
                        {
                            MessageBox.Show("INGRESO DE DINERO A LAS " + hour + " HA SIDO REGISTRADO");
                            if (MessageBox.Show("REGISTRAR OTRO INGRESO DE DINERO?", "REGISTRAR", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
                            {
                                save = new MovementsClass();
                                this.Close();
                                IngresosForm menu = new IngresosForm();
                                menu.WindowState = FormWindowState.Normal;
                                menu.Show();
                            }
                            else
                            {
                                save = new MovementsClass();
                                this.Close();
                            }
                        }
                    }
                    catch (FormatException datethis) { MessageBox.Show(datethis.ToString()); }
                    catch (InvalidCastException datethose) { MessageBox.Show(datethose.ToString()); }
                }
            }
            else if (DireccionGestor.getorigen() == "editor")
            {
                if (reasonbox.Text == "" || cuantitybox.Text == "" || explanationbox.Text == "")
                {
                    MessageBox.Show("Hay datos importantes vacios, termine el formulario.");
                    if (reasonbox.Text == "")
                    {
                        reasonbox.BackColor = Color.Red;
                    }
                    else
                    {
                        reasonbox.BackColor = Color.Green;
                    }

                    if (cuantitybox.Text == "")
                    {
                        cuantitybox.BackColor = Color.Red;
                    }
                    else
                    {
                        cuantitybox.BackColor = Color.Green;
                    }

                    if (explanationbox.Text == "")
                    {
                        explanationbox.BackColor = Color.Red;
                    }
                    else
                    {
                        explanationbox.BackColor = Color.Green;
                    }
                }
                else
                {
                    try
                    {
                        string         userDataName = UserAccessForm.getusername() + "_movements_table";
                        MovementsClass save         = new MovementsClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport());
                        double         cuantity     = double.Parse(cuantitybox.Text);
                        string         date         = datebox.Value.Day.ToString() + "/" + datebox.Value.Month.ToString() + "/" + datebox.Value.Year.ToString();
                        string         hour         = horabox.Value.Hour.ToString() + ":" + horabox.Value.Minute.ToString() + ":" + horabox.Value.Second.ToString();

                        //`FECHA DEL MOVIMIENTO` ,`HORA DEL MOVIMIENTO` ,MOTIVO ,INGRESO, `TIPO DE MONEDA`, DIA, MES, AÑO, HORA, MINUTO, SEGUNDO, EXPLICACION, `FORMA DE PAGO` ) values ('" + datemovement + "', '" + timemovement + "' , '" + reasonmovement + "', '" + profit + "','" + tipomoneda + "','" + dia + "','" + mes + "','" + anio + "','" + hora + "','" + minuto + "','" + segundo + "','" + explicacion + "','" + origenfondo + "'

                        DireccionGestor.setotrostatic("refresh");
                        string orden = "UPDATE " + userDataName + " SET `FECHA DEL MOVIMIENTO`='" + date + "',  `HORA DEL MOVIMIENTO`='" + hour + "', MOTIVO='" + reasonbox.Text + "', INGRESO='" + cuantity + "', `TIPO DE MONEDA`='" + monedatipo.Text + "',DIA='" + datebox.Value.Day.ToString() + "', MES='" + datebox.Value.Month.ToString() + "', AÑO='" + datebox.Value.Year.ToString() + "', HORA='" + datebox.Value.Hour.ToString() + "', MINUTO='" + datebox.Value.Minute.ToString() + "', SEGUNDO='" + datebox.Value.Second.ToString() + "', EXPLICACION='" + explanationbox.Text + "', `FORMA DE PAGO`='" + fondoorigen.Text + "' WHERE ID='" + MovementsClass.getdato()[0] + "' AND `FECHA DEL MOVIMIENTO`='" + MovementsClass.getdato()[2] + "' AND  `HORA DEL MOVIMIENTO`='" + MovementsClass.getdato()[3] + "';";
                        save.ordensql(orden);


                        MessageBox.Show("INGRESO DE LAS " + MovementsClass.getdato()[3] + " EL DIA " + MovementsClass.getdato()[2] + " HA SIDO EDITADO");
                        this.Close();
                    }
                    catch (FormatException datethis) { MessageBox.Show(datethis.ToString()); }
                    catch (InvalidCastException datethose) { MessageBox.Show(datethose.ToString()); }
                }
            }
        }