Exemplo n.º 1
0
        public ActionResult SavingsAcctHist(int id)
        {
            try
            {
                if (id == 0)
                {
                    return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
                }
                var getSavingsAccount = context.GetClientSavingsAccts(Global.AccountName).FirstOrDefault();
                ViewBag.AcctNo          = getSavingsAccount.AcctNo;
                ViewBag.ProdDescription = getSavingsAccount.ProdName;
                ViewBag.Balance         = getSavingsAccount.activeAcctBalance;
                ViewBag.Cifkey          = getSavingsAccount.CIFkey;
                string cifkey = getSavingsAccount.CIFkey;

                var getSavingAcctLedger = context.GetClientSavingsLedger(id, cifkey);
                ViewBag.totalDebit  = getSavingAcctLedger.Sum(i => i.Debit);
                ViewBag.totalCredit = getSavingAcctLedger.Sum(i => i.Credit);
                ViewBag.countDebit  = getSavingAcctLedger.Count(i => i.Debit != 0);
                ViewBag.countCredit = getSavingAcctLedger.Count(i => i.Credit != 0);
                return(View(getSavingAcctLedger));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }