예제 #1
0
 public VoucherType GetVoucherType(long id) => vou_repo.GetFirst(a => a.VoucherTypeId == id);
예제 #2
0
        public IEnumerable <UnpostedVoucherViewModel> GetUnpostedVouchers()
        {
            IList <UnpostedVoucherViewModel> ViewModels = new List <UnpostedVoucherViewModel>();

            foreach (UnpostedVoucher UV in UnpostedVou_repo.GetAll())
            {
                UnpostedVoucherViewModel UVVM = new UnpostedVoucherViewModel()
                {
                    UnpostedVoucherId = UV.UnpostedVoucherId,
                    VoucherId         = UV.VoucherId,
                    Date              = UV.Date,
                    Description       = UV.Description,
                    TotalCreditAmount = UV.TotalCreditAmount,
                    TotalDebitAmount  = UV.TotalDebitAmount,
                    FinancialYear     = FinancialYear_Repo.GetFirst(a => a.FinancialYearId == UV.FinancialYearId),
                    VoucherType       = VoucherType_Repo.GetFirst(a => a.VoucherTypeId == UV.VoucherTypeId),
                    VoucherDetails    = VouDetail_repo.GetList(a => a.VoucherId == UV.VoucherId, b => b.Account)
                };
                ViewModels.Add(UVVM);
            }
            return(ViewModels);
        }