Пример #1
0
        public ActionResult Approve(int id)
        {
            Invoice invoice = _db.Invoices.Find(id);

            invoice.InvoiceStatus    = 2;
            _db.Entry(invoice).State = EntityState.Modified;
            _db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
        public ActionResult Edit(Invoice invoice)
        {
            Initialize();

            if (ModelState.IsValid)
            {
                invoice.EmployeePUID     = _employeepuid;
                invoice.CompanyDomain    = _domain;
                _db.Entry(invoice).State = EntityState.Modified;
                _db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(invoice));
        }
Пример #3
0
        public ActionResult Edit(Item item)
        {
            var invoice = from k in _db.Invoices
                          from t in k.Items
                          where t.ItemID == item.ItemID
                          select k;


            if (ModelState.IsValid)
            {
                _db.Entry(item).State = EntityState.Modified;
                _db.SaveChanges();
                return(RedirectToAction("Details", "Invoice", new { id = invoice.First().InvoiceID }));
            }
            return(View(item));
        }