Beispiel #1
0
        public bool Excluir(CategoriaPagamento item)
        {
            //escreve a função de excluir, krl
            var objDAL = new DALVenda();

            if (objDAL != null)
            {
                objDAL.Excluir(item);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #2
0
 public bool Salvar(CategoriaPagamento item)
 {
     try
     {
         DALVenda DALobj = new DALVenda();
         if (DALobj.Salvar(item) == true)
         {
             DALobj = null;
             return(true);
         }
         else
         {
             DALobj = null;
             return(false);
         }
     }
     catch (Exception)
     {
         return(false);
     }
 }
Beispiel #3
0
        private void btnSalvar_Click(object sender, EventArgs e)
        {
            var cat    = new CategoriaPagamento();
            var BLLCat = new BLLVenda();

            if (txtDescricao.Text != "" && DALVenda.SelecionarCodTipoPagamento(txtDescricao.Text) == 0)
            {
                cat.nome = txtDescricao.Text;

                BLLCat.Salvar(cat);
                txtDescricao.Text         = "";
                cbCategoria.DataSource    = BLLVenda.listarCategoriaPagamento();
                cbCategoria.ValueMember   = "id";
                cbCategoria.DisplayMember = "descricao";
                MessageBox.Show("Salvo com sucesso !");
            }
            else
            {
                MessageBox.Show("Informe algum nome ! Lembre-se, não pode ser um que já existe !");
            }
        }