Example #1
0
        /*
         * Recebe o objeto com os dados completos dos gastos e apresenta na tela
         */
        private void PreencherValoresTela(TipoGastosTO objTipoGastosTO)
        {
            txtDescricao.Text = objTipoGastosTO.TIPO.Trim();

            if (objTipoGastosTO.EXCLUIDO != null)
            {
                chkExcluir.Checked = (objTipoGastosTO.EXCLUIDO == 0 ? false : true);
            }
        }
Example #2
0
        /*
         * Alteração de gastos
         */
        public void Alterar(TipoGastosTO objTipoGastosTO)
        {
            TipoGastosBLL gastoBLL = new TipoGastosBLL();

            this.tipoGastoTO = gastoBLL.SelectScalar(objTipoGastosTO.ID_TIPO_GASTOS);

            if (tipoGastoTO != null)
            {
                PreencherValoresTela(tipoGastoTO);
                tipoGastoTO.StatusBD = StatusTransacao.Update;
            }

            this.ShowDialog();
        }
Example #3
0
        public void Excluir(TipoGastosTO objTipoGastoTO)
        {
            TipoGastosBLL gastoBLL = new TipoGastosBLL();

            this.tipoGastoTO = gastoBLL.SelectScalar(objTipoGastoTO.ID_TIPO_GASTOS);

            if (tipoGastoTO != null)
            {
                PreencherValoresTela(tipoGastoTO);
                tipoGastoTO.StatusBD = StatusTransacao.Delete;
            }

            DesabilitarComponentes();
            this.ShowDialog();
        }
Example #4
0
        private void btnAlterar_Click(object sender, EventArgs e)
        {
            frmCadTipoGasto frmCadTipoGasto = new frmCadTipoGasto();

            TipoGastosTO tipoGastosTO = new TipoGastosTO();

            if (dgvListaTipoGastos.CurrentRow != null)
            {
                DataGridViewRow row          = this.dgvListaTipoGastos.SelectedRows[0];
                int             idTipoGastos = (int)row.Cells["codlIdTipoGastos"].Value;

                tipoGastosTO.ID_TIPO_GASTOS = idTipoGastos;
                frmCadTipoGasto.Alterar(tipoGastosTO);
            }
            else
            {
                MessageBox.Show("Selecionar um item na lista :)");
            }

            BuscarDados();
        }
Example #5
0
 /*
  * Limpa a tela para uma nova inclusão
  */
 private void LimparTela()
 {
     txtDescricao.Text = "";
     tipoGastoTO       = new TipoGastosTO();
 }
Example #6
0
 public void Incluir()
 {
     tipoGastoTO          = new TipoGastosTO();
     tipoGastoTO.StatusBD = StatusTransacao.Insert;
     this.ShowDialog();
 }