Exemplo n.º 1
0
        // GET: Invoices
        public ActionResult Index()
        {
            var invoicesVM = new List <Invoice>();

            foreach (var invoice in invoicesRepositories.GetAll())
            {
                var invoiceVM = InvoiceMap.InvoiceToInvoiceVM(invoice);
            }

            return(View(invoicesVM));
        }
Exemplo n.º 2
0
        // GET: Invoices/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Invoice invoice = invoicesRepositories.GetById(id.Value);

            if (invoice == null)
            {
                return(HttpNotFound());
            }

            var invoiceVM = InvoiceMap.InvoiceToInvoiceVM(invoice);

            return(View(invoiceVM));
        }
Exemplo n.º 3
0
        // GET: Invoices/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Invoice invoice = invoicesRepositories.GetById(id.Value);

            if (invoice == null)
            {
                return(HttpNotFound());
            }
            ViewBag.PartnerId = new SelectList(db.Partners, "PartnerId", "Name", invoice.PartnerId);
            ViewBag.ProductId = new SelectList(db.Products, "ProductId", "Name", invoice.ProductId);

            var invoiceVM = InvoiceMap.InvoiceToInvoiceVM(invoice);

            return(View(invoiceVM));
        }