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

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