Exemplo n.º 1
0
        public void AutoCarregar()
        {
            Classes.ClassesDepto.DeptoBusiness   business = new Classes.ClassesDepto.DeptoBusiness();
            List <Classes.ClassesDepto.DeptoDTO> dto      = business.Listar();

            dgvDepto.AutoGenerateColumns = false;
            dgvDepto.DataSource          = dto;
        }
Exemplo n.º 2
0
        void CarregarCombos()
        {
            Classes.ClassesDepto.DeptoBusiness business = new Classes.ClassesDepto.DeptoBusiness();
            List <DeptoDTO> lista = business.Listar();

            cboDepto.ValueMember   = nameof(DeptoDTO.Id);
            cboDepto.DisplayMember = nameof(DeptoDTO.Departamento);
            cboDepto.DataSource    = lista;
        }
Exemplo n.º 3
0
        public void CarregarGrid()
        {
            string depto = txtProcurarDepto.Text;

            Classes.ClassesDepto.DeptoBusiness   business = new Classes.ClassesDepto.DeptoBusiness();
            List <Classes.ClassesDepto.DeptoDTO> dto      = business.Consultar(depto);

            dgvDepto.AutoGenerateColumns = false;
            dgvDepto.DataSource          = dto;
        }
Exemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                Classes.ClassesDepto.DeptoDTO dto = new Classes.ClassesDepto.DeptoDTO();
                dto.Departamento = txtDepto.Text;

                Classes.ClassesDepto.DeptoBusiness business = new Classes.ClassesDepto.DeptoBusiness();
                business.Salvar(dto);

                MessageBox.Show("Departamento cadastrado com suceso!!", "SIGMA", MessageBoxButtons.OK);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Ocorreu um erro: " + ex.Message);
            }
        }