public ActionResult Edit([Bind(Include = "ID,Name,UserName,Password")] Customer customer) { if (ModelState.IsValid) { db.Entry(customer).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(customer)); }
public ActionResult Edit([Bind(Include = "ID,Name,Telephone,CustomerID")] Distributer distributer) { if (ModelState.IsValid) { db.Entry(distributer).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CustomerID = new SelectList(db.Customers, "ID", "Name", distributer.CustomerID); return(View(distributer)); }
public ActionResult Edit([Bind(Include = "ID,Name,CustomerID")] Location location) { if (ModelState.IsValid) { db.Entry(location).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CustomerID = new SelectList(db.Customers, "ID", "Name", location.CustomerID); return(View(location)); }
public ActionResult Edit([Bind(Include = "ID,Name,Active,reOrder,CustomerID")] Item item) { if (ModelState.IsValid) { db.Entry(item).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CustomerID = new SelectList(db.Customers, "ID", "Name", item.CustomerID); return(View(item)); }
public ActionResult Edit([Bind(Include = "ID,name,address,company,telephone,CustomerID")] Supplier supplier) { if (ModelState.IsValid) { db.Entry(supplier).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CustomerID = new SelectList(db.Customers, "ID", "Name", supplier.CustomerID); return(View(supplier)); }
public ActionResult Edit([Bind(Include = "ID,Description,Qty,BatchID,CustomerID")] Damage damage) { if (ModelState.IsValid) { db.Entry(damage).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.BatchID = new SelectList(db.Batch, "ID", "ID", damage.BatchID); ViewBag.CustomerID = new SelectList(db.Customers, "ID", "Name", damage.CustomerID); return(View(damage)); }
public bool ItemUpdate(int id, Item item) { OpenQbitInventoryContext db = new OpenQbitInventoryContext(); Item newItem = db.Item.Find(id); if (newItem == null) { return(false); } db.Entry(newItem).State = EntityState.Modified; db.SaveChanges(); return(true); }
public bool DamageUpdate(int id, Damage damage) { OpenQbitInventoryContext db = new OpenQbitInventoryContext(); Damage newDamage = db.Damage.Find(id); if (newDamage == null) { return(false); } db.Entry(newDamage).State = EntityState.Modified; db.SaveChanges(); return(true); }
public ActionResult Edit([Bind(Include = "ID,Date,Qty,UnitPrice,ItemID,SupplierID,CustomerID")] Batch batch) { if (ModelState.IsValid) { db.Entry(batch).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CustomerID = new SelectList(db.Customers, "ID", "Name", batch.CustomerID); ViewBag.ItemID = new SelectList(db.Item, "ID", "Name", batch.ItemID); ViewBag.SupplierID = new SelectList(db.Supplier, "ID", "name", batch.SupplierID); return(View(batch)); }
public bool TransferDetailUpdate(int id, TransferDetail transferDetail) { OpenQbitInventoryContext db = new OpenQbitInventoryContext(); TransferDetail newTransferDetail = db.TransferDetail.Find(id); if (newTransferDetail == null) { return(false); } db.Entry(newTransferDetail).State = EntityState.Modified; db.SaveChanges(); return(true); }
public bool ReturnUpdate(int id, Return re) { OpenQbitInventoryContext db = new OpenQbitInventoryContext(); Return newReturn = db.Return.Find(id); if (newReturn == null) { return(false); } db.Entry(newReturn).State = EntityState.Modified; db.SaveChanges(); return(true); }
public ActionResult Edit([Bind(Include = "ID,Description,Qty,CustomerID,BatchID,SupplierID")] Return @return) { if (ModelState.IsValid) { db.Entry(@return).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.BatchID = new SelectList(db.Batch, "ID", "ID", @return.BatchID); ViewBag.CustomerID = new SelectList(db.Customers, "ID", "Name", @return.CustomerID); ViewBag.SupplierID = new SelectList(db.Supplier, "ID", "name", @return.SupplierID); return View(@return); }
public bool LocationUpdate(int id, Location item) { OpenQbitInventoryContext db = new OpenQbitInventoryContext(); Location newLocation = db.Location.Find(id); if (newLocation == null) { return(false); } db.Entry(newLocation).State = EntityState.Modified; db.SaveChanges(); return(true); }
public bool BatchUpdate(int id, Batch batch) { OpenQbitInventoryContext db = new OpenQbitInventoryContext(); Batch newBatch = db.Batch.Find(id); if (newBatch == null) { return(false); } db.Entry(newBatch).State = EntityState.Modified; db.SaveChanges(); return(true); }
public bool SupplierUpdate(int id, Supplier supplier) { OpenQbitInventoryContext db = new OpenQbitInventoryContext(); Supplier newSupplier = db.Supplier.Find(id); if (newSupplier == null) { return(false); } db.Entry(newSupplier).State = EntityState.Modified; db.SaveChanges(); return(true); }
public ActionResult Edit([Bind(Include = "ID,CustomerID,BatchID,LocationID,DistributerID")] TransferDetail transferDetail) { if (ModelState.IsValid) { db.Entry(transferDetail).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.BatchID = new SelectList(db.Batch, "ID", "ID", transferDetail.BatchID); ViewBag.CustomerID = new SelectList(db.Customers, "ID", "Name", transferDetail.CustomerID); ViewBag.DistributerID = new SelectList(db.Distributer, "ID", "Name", transferDetail.DistributerID); ViewBag.LocationID = new SelectList(db.Location, "ID", "Name", transferDetail.LocationID); return(View(transferDetail)); }
public bool DistributerUpdate(int id, Distributer distributer) { OpenQbitInventoryContext db = new OpenQbitInventoryContext(); Distributer newDistributer = db.Distributer.Find(id); if (newDistributer == null) { return(false); } db.Entry(newDistributer).State = EntityState.Modified; db.SaveChanges(); return(true); }