Exemple #1
0
        public TipoDePagamento CarregarTipoDePagamento(Guid TipoDePagamentoId)
        {
            TipoDePagamento ret = null;

            try
            {
                using (IDataContextAsync context = new PCFTIDataContext())
                    using (IUnitOfWorkAsync unitOfWork = new UnitOfWork(context))
                    {
                        IRepositoryAsync <TipoDePagamento> tipodepagamentoRepository = new Repository <TipoDePagamento>(context, unitOfWork);
                        ITipoDePagamentoService            tipodepagamentoService    = new TipoDePagamentoService(tipodepagamentoRepository);

                        ret = tipodepagamentoService.Find(TipoDePagamentoId);
                        unitOfWork.Dispose();
                    }
            }
            catch
            {
                ret = null;
            }
            return(ret);
        }
Exemple #2
0
        public bool ExisteTipoDePagamento(Guid TipoDePagamentoId)
        {
            bool ret = false;

            try
            {
                using (IDataContextAsync context = new PCFTIDataContext())
                    using (IUnitOfWorkAsync unitOfWork = new UnitOfWork(context))
                    {
                        IRepositoryAsync <TipoDePagamento> tipodepagamentoRepository = new Repository <TipoDePagamento>(context, unitOfWork);
                        ITipoDePagamentoService            tipodepagamentoService    = new TipoDePagamentoService(tipodepagamentoRepository);

                        ret = (!(tipodepagamentoService.Find(TipoDePagamentoId) == null));
                        unitOfWork.Dispose();
                    }
            }
            catch
            {
                ret = false;
            }
            return(ret);
        }