public ActionResult DeleteConfirmed(int id) { Clients_Packages clients_Packages = db.Clients_Packages.Find(id); db.Clients_Packages.Remove(clients_Packages); try { db.SaveChanges(); } catch (DbEntityValidationException ex) { } return(RedirectToAction("Index")); }
// GET: Clients_Packages/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Clients_Packages clients_Packages = db.Clients_Packages.Find(id); if (clients_Packages == null) { return(HttpNotFound()); } return(View(clients_Packages)); }
// GET: Clients_Packages/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Clients_Packages clients_Packages = db.Clients_Packages.Find(id); if (clients_Packages == null) { return(HttpNotFound()); } ViewBag.id_client = new SelectList(db.Clients, "id", "first_name", clients_Packages.id_client); ViewBag.id_domain = new SelectList(db.Domains, "id", "name", clients_Packages.id_domain); ViewBag.id_package = new SelectList(db.Packages, "id", "name", clients_Packages.id_package); return(View(clients_Packages)); }
public ActionResult Edit([Bind(Include = "id_client,id_domain,id_package,payment_method,timestamp")] Clients_Packages clients_Packages) { if (ModelState.IsValid) { db.Entry(clients_Packages).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbEntityValidationException ex) { } return(RedirectToAction("Index")); } ViewBag.id_client = new SelectList(db.Clients, "id", "first_name", clients_Packages.id_client); ViewBag.id_domain = new SelectList(db.Domains, "id", "name", clients_Packages.id_domain); ViewBag.id_package = new SelectList(db.Packages, "id", "name", clients_Packages.id_package); return(View(clients_Packages)); }