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

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