예제 #1
0
 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);
 }
예제 #2
0
        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));
        }
예제 #3
0
        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);
        }
예제 #4
0
        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));
        }