public ActionResult Accounts() { var accounts = _financialService.GetAccounts(); var model = new Models.ViewModels.Financials.Accounts(); foreach(var account in accounts) { model.AccountsListLines.Add(new Models.ViewModels.Financials.AccountsListLine() { Id = account.Id, AccountCode = account.AccountCode, AccountName = account.AccountName, Balance = account.Balance }); } return View(model); }
public ActionResult Accounts() { var accounts = _financialService.GetAccounts(); var model = new Models.ViewModels.Financials.Accounts(); foreach (var account in accounts) { model.AccountsListLines.Add(new Models.ViewModels.Financials.AccountsListLine() { Id = account.Id, AccountCode = account.AccountCode, AccountName = account.AccountName, Balance = account.Balance }); } return(View(model)); }
public ActionResult ViewAccountsPDF() { var accounts = _financialService.GetAccounts(); var model = new Models.ViewModels.Financials.Accounts(); foreach (var account in accounts) { model.AccountsListLines.Add(new Models.ViewModels.Financials.AccountsListLine() { Id = account.Id, AccountCode = account.AccountCode, AccountName = account.AccountName, Balance = account.Balance }); } var html = base.RenderPartialViewToString("Accounts", model); HttpContext.Response.Clear(); HttpContext.Response.AddHeader("Content-Type", "application/pdf"); HttpContext.Response.Filter = new PdfFilter(HttpContext.Response.Filter, html); return Content(html); }
public ActionResult ViewAccountsPDF() { var accounts = _financialService.GetAccounts(); var model = new Models.ViewModels.Financials.Accounts(); foreach (var account in accounts) { model.AccountsListLines.Add(new Models.ViewModels.Financials.AccountsListLine() { Id = account.Id, AccountCode = account.AccountCode, AccountName = account.AccountName, Balance = account.Balance }); } var html = base.RenderPartialViewToString("Accounts", model); HttpContext.Response.Clear(); HttpContext.Response.AddHeader("Content-Type", "application/pdf"); HttpContext.Response.Filter = new PdfFilter(HttpContext.Response.Filter, html); return(Json(html, JsonRequestBehavior.AllowGet)); }