public ActionResult DeleteConfirmed(int id) { manufacturers manufacturers = db.manufacturers.Find(id); db.manufacturers.Remove(manufacturers); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "mid,manufacturerName,addressLine1,city,postcode,tel,email,site")] manufacturers manufacturers) { if (ModelState.IsValid) { db.Entry(manufacturers).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(manufacturers)); }
public ActionResult Create([Bind(Include = "mid,manufacturerName,addressLine1,city,postcode,tel,email,site")] manufacturers manufacturers) { if (ModelState.IsValid) { db.manufacturers.Add(manufacturers); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(manufacturers)); }
public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } manufacturers manufacturers = db.manufacturers.Find(id); if (manufacturers == null) { return(HttpNotFound()); } return(View(manufacturers)); }
public PhoneTypeChecker(manufacturers m) { manu = m; if (m.Equals(manufacturers.Samsung)) { factory = new SamsungFactory(); } else if (m.Equals(manufacturers.HTC)) { factory = new HTCFactory(); } else if (m.Equals(manufacturers.Nokia)) { factory = new NokiaFactory(); } }