public ActionResult DeleteConfirmed(int id) { ProducerModels producerModels = db.Producers.Find(id); db.Producers.Remove(producerModels); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,CompanyName,Value,HQPlace")] ProducerModels producerModels) { if (ModelState.IsValid) { db.Entry(producerModels).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(producerModels)); }
public ActionResult Create([Bind(Include = "ID,CompanyName,Value,HQPlace")] ProducerModels producerModels) { if (ModelState.IsValid) { db.Producers.Add(producerModels); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(producerModels)); }
// GET: ProducerModels/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ProducerModels producerModels = db.Producers.Find(id); if (producerModels == null) { return(HttpNotFound()); } return(View(producerModels)); }