public void mostrarNotificaciones(int idNotficacion, string titulo, string mensaje, string prioridad, string tipo, string hora, string fecha, int idPerfil) { this.perfil = idPerfil; this.idnotificacion = idNotficacion; this.Opacity = 0.0; this.StartPosition = FormStartPosition.Manual; string fnombre; for (int i = 1; i < 10; i++) { fnombre = "alerta" + i.ToString(); FrmNotificaciones frm = (FrmNotificaciones)Application.OpenForms[fnombre]; if (frm == null) { this.Name = fnombre; this.x = Screen.PrimaryScreen.WorkingArea.Width - this.Width + 15; this.y = Screen.PrimaryScreen.WorkingArea.Height - this.Height * i - 5 * i; this.Location = new Point(this.x, this.y); break; } } this.x = Screen.PrimaryScreen.WorkingArea.Width - base.Width - 5; this.lblTitulo.Text = generarTituloNotificacion(tipo); generarMensajeYBackground(tipo, prioridad, "dennis"); var fechaConvertida = DateTime.ParseExact(fecha, "dd-MM-yyyy", new CultureInfo("es-ES")); this.lblHora.Text = $"{fechaConvertida.ToString("dd MMM", new CultureInfo("es-ES"))} {hora}"; this.Show(); this.accion = enmAcciones.empezar; this.timer1.Interval = 1; timer1.Start(); }
private void btnClose_Click(object sender, EventArgs e) { CapaNegocio.notificaciones.Index obj = new CapaNegocio.notificaciones.Index(); bool result = obj.markAsRead(idnotificacion); //MessageBox.Show(perfil.ToString()); //MessageBox.Show(result.ToString()); timer1.Interval = 1; accion = enmAcciones.eliminar; }
private void btnVerPerfil_Click(object sender, EventArgs e) { CapaNegocio.notificaciones.Index obj = new CapaNegocio.notificaciones.Index(); bool result = obj.markAsRead(idnotificacion); if (result) { FrmRevisiones frm = new FrmRevisiones(perfil); frm.Show(); timer1.Interval = 1; accion = enmAcciones.eliminar; } //MessageBox.Show(perfil.ToString()); //MessageBox.Show(result.ToString()); }
private void timer1_Tick(object sender, EventArgs e) { switch (this.accion) { case enmAcciones.esperar: timer1.Interval = 10000; accion = enmAcciones.eliminar; break; case enmAcciones.empezar: timer1.Interval = 1; this.Opacity += 0.1; if (this.x < this.Location.X) { this.Left--; } else { if (this.Opacity == 1.0) { accion = enmAcciones.esperar; } } break; case enmAcciones.eliminar: timer1.Interval = 1; this.Opacity -= 0.1; this.Left -= 3; if (base.Opacity == 0.0) { base.Close(); } break; } }