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(); } }
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 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(); }
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(); }
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(); }
private void quitarbutton_Click(object sender, EventArgs e) { string userdataname = UserAccessForm.getusername() + "_events_table"; string orden = "UPDATE " + userdataname + " SET ACTIVO = 'NO' WHERE `DESCRIPCION`= '" + nombre + "' ;"; AgendaClass kit = new AgendaClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport()); kit.ordensql(orden); MessageBox.Show("TAREA " + nombre + " DESACTIVADA"); quitarbutton.Enabled = false; }
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 quitarbutton_Click(object sender, EventArgs e) { if (quitarbutton.Text == "NO") { MessageBox.Show("LA TAREA DEBE DE ESTAR ACTIVA"); } else if (comboeventoname.Text == "") { MessageBox.Show("DEBE SELECCIONAR UNA TAREA PARA DESACTIVAR"); } else { string userdataname = UserAccessForm.getusername() + "_events_table"; string orden = "UPDATE " + userdataname + " SET ACTIVO = 'NO' WHERE `DESCRIPCION`= '" + comboeventoname.Text + "';"; AgendaClass kit = new AgendaClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport()); kit.ordensql(orden); MessageBox.Show("TAREA DESACTIVADA"); kit.ShowDataGrid(dataGridView1, UserAccessForm.getusername()); } }
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 cancelbutton_Click(object sender, EventArgs e) { if (DireccionGestor.getorigen() == "buscador" || DireccionGestor.getorigen() == "modificar") { AgendaEvents agendaobject = new AgendaEvents(); agendaobject.WindowState = FormWindowState.Normal; agendaobject.Show(); } else if (DireccionGestor.getorigen() == "editor") { AgendaEvents agendaobject = new AgendaEvents(); agendaobject.WindowState = FormWindowState.Normal; agendaobject.Show(); } else { AgendaClass save = new AgendaClass(); } this.Close(); }
private void timera_Tick(object sender, EventArgs e) { if (refresh == "refresh") { refresh = ""; LoginClass show = new LoginClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport()); show.ShowDataGrid(findinggrid); namebox.Text = ""; tipobox.Text = ""; encontradoslabel.Text = show.getcuenta().ToString(); } 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(); cuenta++; if (cuenta == 4000) { cuenta = 0; backstripbutton.PerformClick(); } if (cuenta == 1000) { opcionpanel.Hide(); } }
private void savebuttonstrip_Click(object sender, EventArgs e) { carga man = new carga(); if (savebuttonstrip.Text == "GUARDAR") { man.WindowState = FormWindowState.Normal; if (gottendegree.Text == "" || nameEmployeeBox.Text == "" || idBox.Text == "" || telephoneNumberBox.Text == "" || schedule.Text == "" || cargobox.Text == "" || comboNacionalidad.Text == "" || ageBox.Text == "" || mensualitybox.Text == "" || personalReferenceBox.Text == "" || telephoneReferenceBox.Text == "" || relationReferenceBox.Text == "" || AlergyNmaeBox.Text == "" || DolenciaNameBox.Text == "" || nameMedicineBox.Text == "" || MotivoMedicineBox.Text == "") { MessageBox.Show("Hay datos importantes vacios, termine el formulario."); if (gottendegree.Text == "") { gottendegree.BackColor = Color.Red; } else { gottendegree.BackColor = Color.Green; } if (nameEmployeeBox.Text == "") { nameEmployeeBox.BackColor = Color.Red; } else { nameEmployeeBox.BackColor = Color.Green; } if (idBox.Text == "") { idBox.BackColor = Color.Red; } else { idBox.BackColor = Color.Green; } if (telephoneNumberBox.Text == "") { telephoneNumberBox.BackColor = Color.Red; } else { telephoneNumberBox.BackColor = Color.Green; } if (schedule.Text == "") { schedule.BackColor = Color.Red; } else { schedule.BackColor = Color.Green; } if (cargobox.Text == "") { cargobox.BackColor = Color.Red; } else { cargobox.BackColor = Color.Green; } if (comboNacionalidad.Text == "") { comboNacionalidad.BackColor = Color.Red; } else { comboNacionalidad.BackColor = Color.Green; } if (ageBox.Text == "") { ageBox.BackColor = Color.Red; } else { ageBox.BackColor = Color.Green; } if (mensualitybox.Text == "") { mensualitybox.BackColor = Color.Red; } else { mensualitybox.BackColor = Color.Green; } if (personalReferenceBox.Text == "") { personalReferenceBox.BackColor = Color.Red; } else { personalReferenceBox.BackColor = Color.Green; } if (telephoneReferenceBox.Text == "") { telephoneReferenceBox.BackColor = Color.Red; } else { telephoneReferenceBox.BackColor = Color.Green; } if (relationReferenceBox.Text == "") { relationReferenceBox.BackColor = Color.Red; } else { relationReferenceBox.BackColor = Color.Green; } if (AlergyNmaeBox.Text == "") { AlergyNmaeBox.BackColor = Color.Red; } else { AlergyNmaeBox.BackColor = Color.Green; } if (DolenciaNameBox.Text == "") { DolenciaNameBox.BackColor = Color.Red; } else { DolenciaNameBox.BackColor = Color.Green; } if (nameMedicineBox.Text == "") { nameMedicineBox.BackColor = Color.Red; } else { nameMedicineBox.BackColor = Color.Green; } if (MotivoMedicineBox.Text == "") { MotivoMedicineBox.BackColor = Color.Red; } else { MotivoMedicineBox.BackColor = Color.Green; } } else { try { string userDataName = UserAccessForm.getusername() + "_employee_table"; EmployeeClass employee = new EmployeeClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport()); employee.NameNoCopied(nameEmployeeBox.Text, userDataName); int age = int.Parse(ageBox.Text); double mensuality = double.Parse(mensualitybox.Text); DateTime birthdate = Convert.ToDateTime(birthDateBox.Value.Date); DateTime timegetin = Convert.ToDateTime(dategetin.Value.ToShortTimeString()); string access = userDataName; if (mensualitybox.BackColor == Color.Red) { MessageBox.Show("Arregle el campo no valido"); } else { if (employee.NameNoCopied(nameEmployeeBox.Text, userDataName) == true) { man.Close(); MessageBox.Show("El Empleado " + nameEmployeeBox.Text + " ya existe."); if (MessageBox.Show("Agregar a otro empleado?", "Agregar", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { employee = new EmployeeClass(); DireccionGestor menu = new DireccionGestor(); menu.WindowState = FormWindowState.Normal; menu.Show(); this.Close(); } else { employee = new EmployeeClass(); EmployeeForm menu = new EmployeeForm(); menu.WindowState = FormWindowState.Normal; menu.Show(); this.Close(); } } else if (employee.NameNoCopied(nameEmployeeBox.Text, userDataName) == false) { if (gottendegree.Text == "" || nameEmployeeBox.Text == "" || idBox.Text == "" || telephoneNumberBox.Text == "" || schedule.Text == "" || cargobox.Text == "" || comboNacionalidad.Text == "" || ageBox.Text == "" || mensualitybox.Text == "" || personalReferenceBox.Text == "" || telephoneReferenceBox.Text == "" || relationReferenceBox.Text == "" || AlergyNmaeBox.Text == "" || DolenciaNameBox.Text == "" || nameMedicineBox.Text == "" || MotivoMedicineBox.Text == "") { MessageBox.Show("Hay datos importantes vacios, termine el formulario."); } else { string date = birthDateBox.Value.Day.ToString() + "/" + birthDateBox.Value.Month.ToString() + "/" + birthDateBox.Value.Year.ToString(); string evento = birthDateBox.Value.Day.ToString() + "/" + birthDateBox.Value.Month.ToString(); string eventoname = "CUMPLEAÑOS DE " + nameEmployeeBox.Text; AgendaClass addevent = new AgendaClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport()); addevent.saveData(UserAccessForm.getusername(), eventoname, 1, date, "7:20:0", "NO", "NO", "NO", "NO", "NO", "NO", "NO", evento, "SI", ""); LoginClass add = new LoginClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport()); add.AddContact(nameEmployeeBox.Text, telephoneNumberBox.Text, direccionbox.Text, emailcombo.Text, UserAccessForm.getusername().ToString()); if (employee.SaveData(userDataName, dategetin, gottendegree.Text, nameEmployeeBox.Text, idBox.Text, birthDateBox, telephoneNumberBox.Text, schedule.Text, cargobox.Text, comboNacionalidad.Text, age, mensuality, personalReferenceBox.Text, telephoneReferenceBox.Text, relationReferenceBox.Text, AlergyNmaeBox.Text, DolenciaNameBox.Text, nameMedicineBox.Text, MotivoMedicineBox.Text, picturetextbox.Text, monedatipo.Text, sexobox.Text, direccionbox.Text, emailcombo.Text)) { man.Close(); employee.NameNoCopied(nameEmployeeBox.Text, userDataName); employee.OrderID(userDataName); MessageBox.Show("NUEVO EMPLEADO " + nameEmployeeBox.Text + " HA SIDO AGREGADO."); if (MessageBox.Show("Agregar a otro empleado?", "Agregar", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { employee = new EmployeeClass(); DireccionGestor menu = new DireccionGestor(); menu.WindowState = FormWindowState.Normal; menu.Show(); this.Close(); } else { employee = new EmployeeClass(); EmployeeForm menu = new EmployeeForm(); menu.WindowState = FormWindowState.Normal; menu.Show(); this.Close(); } } else { man.Close(); MessageBox.Show("NUEVO EMPLEADO " + nameEmployeeBox.Text + "HA SIDO AGREGADO."); if (MessageBox.Show("Agregar a otro empleado?", "Agregar", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { employee = new EmployeeClass(); DireccionGestor menu = new DireccionGestor(); menu.WindowState = FormWindowState.Normal; menu.Show(); this.Close(); } else { employee = new EmployeeClass(); EmployeeForm menu = new EmployeeForm(); menu.WindowState = FormWindowState.Normal; menu.Show(); this.Close(); } } } } } } catch (FormatException datethis) { datethis.ToString(); } } } else if (savebuttonstrip.Text == "MODIFICAR") { man.WindowState = FormWindowState.Normal; if (referenciaopcionbox.Text == "NO") { man.Close(); telephoneNumberBox.Text = "NINGUNA"; relationReferenceBox.Text = "NINGUNA"; personalReferenceBox.Text = "NINGUNA"; } try { man.Close(); string userDataName = UserAccessForm.getusername() + "_employee_table"; EmployeeClass save = new EmployeeClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport()); AgendaClass addevent = new AgendaClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport()); double mensuality = double.Parse(mensualitybox.Text); string nameevent = "CUMPLEAÑOS DE " + nameEmployeeBox.Text; string date = birthDateBox.Value.Day.ToString() + "/" + birthDateBox.Value.Month.ToString() + "/" + birthDateBox.Value.Year.ToString(); string momentdate = birthDateBox.Value.Day.ToString() + "/" + birthDateBox.Value.Month.ToString(); save.ModifyData(DireccionGestor.getnombrestatic(), trabajando.Text, userDataName, dategetin, salidapicker, gottendegree.Text, nameEmployeeBox.Text, idBox.Text, birthDateBox, telephoneNumberBox.Text, schedule.Text, cargobox.Text, comboNacionalidad.Text, int.Parse(ageBox.Text), mensuality, personalReferenceBox.Text, telephoneNumberBox.Text, relationReferenceBox.Text, AlergyNmaeBox.Text, DolenciaNameBox.Text, nameMedicineBox.Text, MotivoMedicineBox.Text, picturetextbox.Text, monedatipo.Text, sexobox.Text, direccionbox.Text, emailcombo.Text, EmployeeClass.getids()); addevent.modifydata(UserAccessForm.getusername(), DireccionGestor.getnombrestatic(), nameevent, 1, date, "7:20:0", "NO", "NO", "NO", "NO", "NO", "NO", "NO", momentdate, "SI"); LoginClass add = new LoginClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport()); add.editContact(nameEmployeeBox.Text, telephoneNumberBox.Text, direccionbox.Text, emailcombo.Text, DireccionGestor.getnombrestatic(), UserAccessForm.getusername().ToString()); MessageBox.Show("EL EMPLEADO " + nameEmployeeBox.Text + " HA SIDO MODIFICADO"); EmployeeClass studentobject = new EmployeeClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport()); EmployeeFormSearch buscar = new EmployeeFormSearch(); buscar.WindowState = FormWindowState.Maximized; buscar.Show(); this.Close(); } catch (FormatException datethis) { datethis.ToString(); } } }
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(); } }
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(); } }
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; }
private void OKbutton_Click(object sender, EventArgs e) { string fecharecordatorio = "00/00"; fecha = datebox.Value.Day.ToString() + "/" + datebox.Value.Month.ToString() + "/" + datebox.Value.Year.ToString(); string hora = timeBox.Value.Hour.ToString() + ":" + timeBox.Value.Minute.ToString() + ":" + timeBox.Value.Second.ToString(); AgendaClass agenda = new AgendaClass(UserAccessForm.getdbserver(), UserAccessForm.getdbname(), UserAccessForm.getdbuser(), UserAccessForm.getdbpassword(), UserAccessForm.getdbport()); string user = UserAccessForm.getusername(); if (lunescheck.Checked == true) { dias[0] = "SI"; } else { dias[0] = "NO"; } if (martescheckBox.Checked == true) { dias[1] = "SI"; } else { dias[1] = "NO"; } if (miercolescheckBox.Checked == true) { dias[2] = "SI"; } else { dias[2] = "NO"; } if (juevescheckBox.Checked == true) { dias[3] = "SI"; } else { dias[3] = "NO"; } if (viernescheckbox.Checked == true) { dias[4] = "SI"; } else { dias[4] = "NO"; } if (sabadocheckBox.Checked == true) { dias[5] = "SI"; } else { dias[5] = "NO"; } if (domingocheckBox.Checked == true) { dias[6] = "SI"; } else { dias[6] = "NO"; } int prioridad = 1; if (priority.Text == "MUY IMPORTANTE") { prioridad = 0; } else if (priority.Text == "NORMAL") { prioridad = 1; } else { prioridad = 2; } if (comborepeticion.Text == "NO") { fecharecordatorio = datebox.Value.Day.ToString() + "/" + datebox.Value.Month.ToString(); } else { fecharecordatorio = "00/00"; } // 0 - MUY IMPORTANTE // 1 - NORMAL // 2 - POCO IMPORTANTE if (DireccionGestor.getorigen() == "inicio" || DireccionGestor.getorigen() == "buscador") { string activo = "SI"; if (motivoBox.Text == "" || priority.Text == "") { MessageBox.Show("COMPLETE EL FORMULARIO"); if (motivoBox.Text == "") { motivoBox.BackColor = Color.Red; } else { motivoBox.BackColor = Color.Green; } if (priority.Text == "") { priority.BackColor = Color.Red; } else { motivoBox.BackColor = Color.Green; } } else { if (agenda.saveData(user, motivoBox.Text, prioridad, fecha, hora, dias[0], dias[1], dias[2], dias[3], dias[4], dias[5], dias[6], fecharecordatorio, activo, melodybox.Text)) { MessageBox.Show("TAREA GUARDADA"); if (MessageBox.Show("Agregar otra tarea?", "Agregar", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { agenda = new AgendaClass(); this.Close(); } else { agenda = new AgendaClass(); this.Close(); agendaAdd menu = new agendaAdd(); } } else { MessageBox.Show("TAREA GUARDADA" + " " + agenda.getmessageshow()); if (MessageBox.Show("Agregar otra tarea?", "Agregar", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { agenda = new AgendaClass(); this.Close(); } else { agenda = new AgendaClass(); this.Close(); agendaAdd menu = new agendaAdd(); menu.WindowState = FormWindowState.Normal; menu.Show(); } } } } else if (DireccionGestor.getorigen() == "modificar") { agenda.ordensql("UPDATE " + UserAccessForm.getusername() + "_events_table SET `DESCRIPCION`= '" + motivoBox.Text + "', `FECHA` ='" + fecha + "', `HORA` ='" + hora + "', `PRIORIDAD` = '" + prioridad + "', `LUNES`='" + dias[0] + "', `MARTES` ='" + dias[1] + "', `MIERCOLES` ='" + dias[2] + "', `JUEVES` ='" + dias[3] + "', `VIERNES` ='" + dias[4] + "', `SABADO` ='" + dias[5] + "', `DOMINGO` ='" + dias[6] + "', `FECHA DE RECORDATORIO` ='" + fecharecordatorio + "', `ACTIVO` ='" + activobox.Text + "',`SONIDO`='" + melodybox.Text + "' WHERE `DESCRIPCION`= '" + DireccionGestor.getnombrestatic() + "' AND FECHA ='" + DireccionGestor.getotrostatic() + "';"); MessageBox.Show("TAREA MODIFICADA"); AgendaEvents agendaobject = new AgendaEvents(); agendaobject.WindowState = FormWindowState.Normal; agendaobject.Show(); this.Close(); } }