public void LoadScreen(FuncionarioView dto)
        {
            try
            {
                this.dto              = dto;
                txtCidade.Text        = dto.Cidade;
                txtEmail.Text         = dto.Email;
                txtNome.Text          = dto.Nome;
                nudSalario.Value      = dto.Salario;
                mkbCEP.Text           = dto.Cep;
                txtEndereco.Text      = dto.Rua;
                txtNum.Text           = dto.Numero.ToString();
                mkbCPF.Text           = dto.Cpf;
                mkbRG.Text            = dto.Rg;
                mkbTelefone.Text      = dto.Telefone;
                cboDepto.SelectedItem = dto.Depto;
                cboUF.Text            = dto.Estado;
                txtComplemento.Text   = dto.Complemento;

                pbxFoto.Image = ImagemPlugIn.ConverterParaImagem(dto.Imagem);
            }
            catch (Exception ex)
            {
                string msg = "Ocorreu um erro: " + ex.Message;

                frmException tela = new frmException();
                tela.LoadScreen(msg);
                tela.ShowDialog();
            }
        }
Example #2
0
        void GerarCredenciais()
        {
            try
            {
                string          nome = cboFuncionario.Text;
                FuncionarioView dto  = cboFuncionario.SelectedItem as FuncionarioView;

                mkbCPF.Text     = dto.Cpf;
                txtSalario.Text = dto.Salario.ToString();
                txtDepto.Text   = dto.Depto.ToString();

                if (dto.Imagem == string.Empty)
                {
                    pbxImgFuncionario.Image = null;
                }
                else
                {
                    pbxImgFuncionario.Image = ImagemPlugIn.ConverterParaImagem(dto.Imagem);
                }
            }
            catch (Exception ex)
            {
                string msg = "Ocorreu um erro: " + ex.Message;

                frmException tela = new frmException();
                tela.LoadScreen(msg);
                tela.ShowDialog();
            }
        }
Example #3
0
        void GerarCredenciais()
        {
            try
            {
                string          nome = cboFuncionario.Text;
                ViewFuncionario dto  = cboFuncionario.SelectedItem as ViewFuncionario;

                mkbCPF.Text     = dto.Cpf;
                txtSalario.Text = dto.Salario.ToString();
                txtDepto.Text   = dto.Depto.ToString();

                if (dto.Imagem == string.Empty)
                {
                    pbxImgFuncionario.Image = null;
                }
                else
                {
                    pbxImgFuncionario.Image = ImagemPlugIn.ConverterParaImagem(dto.Imagem);
                }
            }
            catch (Exception)
            {
                frmException tela = new frmException();
                tela.LoadScreen("Ocorreu um erro.\nConsulte o administrador do sistema.");
                tela.ShowDialog();
            }
        }