private void frmPerfilTec_Load(object sender, EventArgs e) { try { List <probDto> ListDto = new List <probDto>(); ListDto = new probBll().notificacao(dtovar); notiComeco = dtovar.noti; List <advertenciaDTO> ListDtoAdv = new List <advertenciaDTO>(); ListDtoAdv = new advertenciaBLL().notificacaAdv(dtoVarAdv); notiComecoAdv = dtoVarAdv.noti; } catch (Exception erro) { throw erro; } lblNome.Text = Convert.ToString(information.nome); pcbFotoTec.ImageLocation = information.foto; notifyIcon1.Visible = false; timer1.Enabled = true; timer2.Enabled = true; }
private void carregaGrid() { dataGridProb.AutoGenerateColumns = false; try { List <advertenciaDTO> ListDto = new List <advertenciaDTO>(); ListDto = new advertenciaBLL().listarProbProProf(); dataGridProb.DataSource = ListDto; CurrencyManager cm = (CurrencyManager)BindingContext[dataGridProb.DataSource]; cm.EndCurrentEdit(); cm.ResumeBinding(); cm.SuspendBinding(); foreach (DataGridViewRow row in dataGridProb.Rows) { if (Convert.ToString(row.Cells["advertido"].Value) == "") { row.Visible = true; } else { row.Visible = false; } } } catch (Exception erro) { MessageBox.Show("Falha na conexão com o banco de dados, favor entrar em contato com o T.I." + erro, "Erro de conexão", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void timer2_Tick(object sender, EventArgs e) { try { List <advertenciaDTO> ListDto = new List <advertenciaDTO>(); ListDto = new advertenciaBLL().notificacaAdv(dtoVarAdv); notiAdv = dtoVarAdv.noti; } catch (Exception erro) { MessageBox.Show("Falha de conexão, entre em contato com o T.I.\n" + erro + "", "Falha de conexão", MessageBoxButtons.OK, MessageBoxIcon.Error); } if (notiAdv - notiComecoAdv == 1) { btnAdve.Iconimage_right = Properties.Resources.noti12; if (mostrarADv == true) { notifyIcon2.Visible = true; notifyIcon2.Icon = SystemIcons.Exclamation; notifyIcon2.BalloonTipTitle = "Novo aviso"; notifyIcon2.BalloonTipText = "Foi registrado um novo aviso"; notifyIcon2.ShowBalloonTip(30000); mostrarADv = false; } } else if (notiAdv - notiComecoAdv > 1) { btnAdve.Iconimage_right = Properties.Resources.notiMais; } }
private void carregaGrid() { dataGridAdvert.AutoGenerateColumns = false; try { List <advertenciaDTO> ListDto = new List <advertenciaDTO>(); ListDto = new advertenciaBLL().listarProbProTec(); dataGridAdvert.DataSource = ListDto; CurrencyManager cm = (CurrencyManager)BindingContext[dataGridAdvert.DataSource]; cm.EndCurrentEdit(); cm.ResumeBinding(); cm.SuspendBinding(); foreach (DataGridViewRow row in dataGridAdvert.Rows) { if (Convert.ToString(row.Cells["justificativa"].Value) == "") { row.Visible = true; } else { row.Visible = false; } } } catch (Exception erro) { MessageBox.Show("Erro Inexperado, contate o T.I.", "Erro de conexão", MessageBoxButtons.OK, MessageBoxIcon.Error); } }