コード例 #1
0
 public Correntista Obter(int codigo)
 {
     using (IUnitOfWork uow = new UnitOfWork())
     {
         dal = new CorrentistaDal(uow);
         return(dal.Find(i => i.Codigo.Equals(codigo)).FirstOrDefault());
     }
 }
コード例 #2
0
 public IList <Correntista> Listar()
 {
     using (IUnitOfWork uow = new UnitOfWork())
     {
         dal = new CorrentistaDal(uow);
         return(dal.GetAll());
     }
 }
コード例 #3
0
 public void Excluir(Correntista correntista)
 {
     using (IUnitOfWork uow = new UnitOfWork())
     {
         dal = new CorrentistaDal(uow);
         dal.Delete(correntista);
         uow.Commit();
     }
 }
コード例 #4
0
 public void Alterar(Correntista correntista)
 {
     using (IUnitOfWork uow = new UnitOfWork())
     {
         dal = new CorrentistaDal(uow);
         correntista.Senha = criptografia.Criptografa(correntista.Senha);
         dal.Update(correntista);
         uow.Commit();
     }
 }
コード例 #5
0
        public int Incluir(Correntista correntista)
        {
            using (IUnitOfWork uow = new UnitOfWork())
            {
                dal = new CorrentistaDal(uow);
                correntista.Senha = criptografia.Criptografa(correntista.Senha);
                correntista       = dal.Add(correntista);

                uow.Commit();
            }
            return(correntista.Codigo);
        }
コード例 #6
0
 public void Excluir(int codigo)
 {
     using (IUnitOfWork uow = new UnitOfWork())
     {
         dal = new CorrentistaDal(uow);
         var correntista = dal.Find(i => i.Codigo.Equals(codigo)).FirstOrDefault();
         if (correntista != null)
         {
             dal.Delete(correntista);
             uow.Commit();
         }
     }
 }