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 timer_Tick(object sender, EventArgs e) { TimeClass timeobject = new TimeClass(); //hourlabel.Text = timeobject.clockshapeshort(); //datelabel.Text = timeobject.dateshape(); cuenta++; if (cuenta == 3000) { cuenta = 0; backbuttonstrip.PerformClick(); } }
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 timepanel_Paint(object sender, PaintEventArgs e) { TimeClass objecttime = new TimeClass(); if (objecttime.inthour() >= 5 && objecttime.inthour() < 12) { clocklabel.BackColor = Color.DeepSkyBlue; datelabel.BackColor = Color.DeepSkyBlue; timepanel.BackColor = Color.DeepSkyBlue; nightpictureBox.Hide(); morningpictureBox.Show(); nightpictureBox.Hide(); } if (objecttime.inthour() >= 12 && objecttime.inthour() < 19) { clocklabel.BackColor = Color.Gold; datelabel.BackColor = Color.Gold; timepanel.BackColor = Color.Gold; morningpictureBox.Hide(); afnernoonpictureBox.Show(); nightpictureBox.Hide(); } if (objecttime.inthour() >= 19 || objecttime.inthour() < 5) { clocklabel.BackColor = Color.BlueViolet; datelabel.BackColor = Color.BlueViolet; timepanel.BackColor = Color.BlueViolet; afnernoonpictureBox.Hide(); nightpictureBox.Show(); morningpictureBox.Hide(); } }
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(); } }