Ejemplo n.º 1
0
        public ActionResult ViewInvoice(int invoiceId)
        {
            var vm      = new ViewInvoiceViewModel();
            var invoice = _repo.GetInvoice(invoiceId);

            vm.Invoice      = invoice;
            vm.PersianDate  = new PersianDateTime(invoice.AddedDate).ToString();
            vm.InvoiceItems = new List <InvoiceItemWithMainFeatureViewModel>();
            // Getting Invoice Item SubFeatures
            foreach (var invoiceItem in invoice.InvoiceItems)
            {
                var invoiceItemWithMainFeature = new InvoiceItemWithMainFeatureViewModel
                {
                    InvoiceItem = invoiceItem, MainFeature = _repo.GetInvoiceItemsMainFeature(invoiceItem.Id)
                };
                vm.InvoiceItems.Add(invoiceItemWithMainFeature);
            }
            return(View(vm));
        }