public ActionResult DeleteConfirmed(int id) { WarhouseModel warhouseModel = db.Warhousies.Find(id); db.Warhousies.Remove(warhouseModel); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Name,Addres")] WarhouseModel warhouseModel) { if (ModelState.IsValid) { db.Entry(warhouseModel).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(warhouseModel)); }
public ActionResult Create([Bind(Include = "Id,Name,Addres")] WarhouseModel warhouseModel) { if (ModelState.IsValid) { db.Warhousies.Add(warhouseModel); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(warhouseModel)); }
// GET: Warhouse/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } WarhouseModel warhouseModel = db.Warhousies.Find(id); if (warhouseModel == null) { return(HttpNotFound()); } return(View(warhouseModel)); }