Esempio n. 1
0
        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;
        }
Esempio n. 2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            try
            {
                List <probDto> ListDto = new List <probDto>();
                ListDto = new probBll().notificacao(dtovar);
                noti    = dtovar.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 (noti - notiComeco == 1)
            {
                btnErro.Iconimage_right = Properties.Resources.noti12;

                if (mostrar == true)
                {
                    notifyIcon2.Visible         = true;
                    notifyIcon2.Icon            = SystemIcons.Information;
                    notifyIcon2.BalloonTipTitle = "Novo problema";
                    notifyIcon2.BalloonTipText  = "Foi registrado um novo problema";
                    notifyIcon2.ShowBalloonTip(30000);
                    mostrar = false;
                }
            }
            else if (noti - notiComeco > 1)
            {
            }
        }
Esempio n. 3
0
        private void dgvProb_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            int sel = dgvProb.CurrentRow.Index;

            if (Convert.ToBoolean(dgvProb["check", sel].Value) == true)
            {
                dgvProb.CurrentRow.DefaultCellStyle.BackColor = Color.ForestGreen;
                dtoVar.Check  = "1";
                dtoVar.idProb = Convert.ToInt32(dgvProb["id", sel].Value);
            }


            else
            {
                dgvProb.CurrentRow.DefaultCellStyle.BackColor = Color.Maroon;
                dtoVar.Check  = "0";
                dtoVar.idProb = Convert.ToInt32(dgvProb["id", sel].Value);
            }
            try
            {
                try
                {
                    probBll bll = new probBll();
                    bll.alteraSituacao(dtoVar);
                }
                catch (Exception erro)
                {
                    MessageBox.Show("Erro Inexperado, contate o T.I.", "Erro de conexão", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro Inexperado, contate o T.I.", "Erro de conexão", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 4
0
        private void carregaGrid()
        {
            dgvProb.AutoGenerateColumns = false;

            try
            {
                List <probDto> ListDto = new List <probDto>();
                ListDto            = new probBll().listarTec();
                dgvProb.DataSource = ListDto;

                CurrencyManager cm = (CurrencyManager)BindingContext[dgvProb.DataSource];
                cm.EndCurrentEdit();
                cm.ResumeBinding();
                cm.SuspendBinding();

                foreach (DataGridViewRow row in dgvProb.Rows)
                {
                    if (Convert.ToString(row.Cells["cheka"].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);
            }
        }
Esempio n. 5
0
        private void carregaGrid()
        {
            bunifuCustomDataGrid1.AutoGenerateColumns = false;
            try
            {
                List <probDto> ListDto = new List <probDto>();
                ListDto = new probBll().listarProb();
                bunifuCustomDataGrid1.DataSource = ListDto;

                CurrencyManager cm = (CurrencyManager)BindingContext[bunifuCustomDataGrid1.DataSource];
                cm.EndCurrentEdit();
                cm.ResumeBinding();
                cm.SuspendBinding();

                foreach (DataGridViewRow row in bunifuCustomDataGrid1.Rows)
                {
                    if (Convert.ToString(row.Cells["checado"].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 de conexão", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }