コード例 #1
0
        public ViewResult Index()
        {
            var model = new LedgersViewModel();

            model.Ledgers = _db.Query(new GetAllLedgersQuery());
            return(View(model));
        }
コード例 #2
0
        public LedgersViewModel GetLastTransactionDetail(int LedgerHeaderId)
        {
            LedgersViewModel LastTransactionDetail = (from L in db.LedgerLine
                                                      orderby L.LedgerLineId descending
                                                      where L.LedgerHeaderId == LedgerHeaderId
                                                      select new LedgersViewModel
            {
                LedgerAccountId = L.LedgerAccountId,
                LedgerAccountName = L.LedgerAccount.LedgerAccountName,
                CostCenterId = L.CostCenterId,
                CostCenterName = L.CostCenter.CostCenterName,
                Amount = L.Amount
            }).FirstOrDefault();

            return(LastTransactionDetail);
        }