Exemple #1
0
        public async Task <ActionResult> Detail(int id)
        {
            CreditApproval creditApproval = await _creditApprovalRepository.GetOne(id);

            List <string> products = creditApproval.TrCaProducts.Select(e => e.Product.MaterialName).ToList();

            ViewBag.Credit = creditApproval;
            //ViewBag.QuantitativeAspects = creditApproval.QuantitativeAspects.FirstOrDefault();
            ViewBag.CustomerDetail    = creditApproval.CaCustomerDetails.Count();
            ViewBag.CustomerDetailObj = creditApproval.CaCustomerDetails.FirstOrDefault();
            ViewBag.Nota     = creditApproval.TrCaNotes.FirstOrDefault();
            ViewBag.Products = string.Join(", ", products.ToArray());
            return(View());
        }
        public async Task <ActionResult> CreditApprovalPdf(int id)
        {
            CreditApproval creditApproval = await _creditApprovalRepository.GetOne(id);

            Signature     signature = _signatureRepository.GetAll().Where(e => e.DocumentType == "CA").FirstOrDefault();
            List <string> products  = creditApproval.TrCaProducts.Select(e => e.Product.MaterialName).ToList();

            ViewBag.Kredit = creditApproval;
            ViewBag.Produk = string.Join(", ", products.ToArray());
            ViewBag.Ttd    = signature;
            return(new ViewAsPdf("~/Views/Pdf/creditApproval.cshtml"));
        }