public ActionResult ExportsReports() { TrialBalanceController TBC = new TrialBalanceController(); List <TrialBalanceDto> lstRecords = TBC.GetAllTrialBalanceReport(); RefMaster rm = _dbContext.RefMasters.ToList().Find(r => r.RefMasterCode.ToUpper() == "AHTYPE"); RefValueMaster rvmAssets = _dbContext.RefValueMasters.ToList().Find(f => f.RefMasterID == rm.RefMasterID && f.RefCode.ToUpper() == "ASSETS"); RefValueMaster rvmLiabilities = _dbContext.RefValueMasters.ToList().Find(f => f.RefMasterID == rm.RefMasterID && f.RefCode.ToUpper() == "LIABILITIES"); List <TrialBalanceDto> lstAssets = lstRecords.FindAll(l => l.AhType == rvmAssets.RefID); List <TrialBalanceDto> lstLiabilities = lstRecords.FindAll(l => l.AhType == rvmLiabilities.RefID); var Debit1 = lstAssets.Sum(l => l.Debit3); var Credit1 = lstAssets.Sum(l => l.Credit3); var Debit2 = lstLiabilities.Sum(M => M.Debit3); var Credit2 = lstLiabilities.Sum(M => M.Credit3); BalanceSheetDto lst = new BalanceSheetDto(); lst.lstAssects = lstAssets; lst.lstLiabilities = lstLiabilities; lst.Debit1 = Debit1; lst.Credit1 = Credit1; lst.Debit2 = Debit2; lst.Credit2 = Credit2; ReportDocument rd = new ReportDocument(); rd.Load(Server.MapPath("~/Reports/FinancialRports/BalanceSheet.rpt")); rd.SetDataSource(lst); Response.Buffer = false; Response.ClearContent(); Response.ClearHeaders(); Stream stream = rd.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat); stream.Seek(0, SeekOrigin.Begin); return(File(stream, "application/pdf", "BalanceSheet.pdf")); }
private void UpdateNfTokenBalance(ExplorerDbContext context, Account account, BalanceSheetDto tokenBalance) { foreach (var tokenId in tokenBalance.Ids) { var existingToken = context.NonFungibleTokens.SingleOrDefault(p => p.Id.Equals(tokenId)); if (existingToken == null) { var nftoken = new NonFungibleToken { Chain = tokenBalance.ChainName, TokenSymbol = tokenBalance.Symbol, Id = tokenId, Account = account, }; account.NonFungibleTokens.Add(nftoken); } else { existingToken.Account = account; } } }