public ActionResult Edit(Supplier supplier)
 {
     if (ModelState.IsValid)
     {
         //db.Entry(supplier).State = EntityState.Modified;
         // db.SaveChanges();
         SuppMgr.UpdateSupplier(supplier);
         return(RedirectToAction("Index"));
     }
     ViewBag.ParishID = new SelectList(db.Parish, "ParishID", "name", supplier.ParishID);
     return(View(supplier));
 }
示例#2
0
        public void UpdateSupplierTest()
        {
            SupplierMgr target   = new SupplierMgr(); // TODO: Initialize to an appropriate value
            Supplier    supplier = new Supplier();    // TODO: Initialize to an appropriate value

            supplier.SupplierCode  = "ROB-100";
            supplier.SupplierName  = "Robert's Poultry & Dary Farm";
            supplier.StreetAddress = "2 Hope Road Kingston";
            supplier.ParishID      = 1;

            try
            {
                target.UpdateSupplier(supplier);
            }
            catch (SupplierMgrException e)
            {
                Assert.Fail(e.ToString());//force fail of test
            }
        }