// GET: zillalinkbuildings/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } zillalinkbuilding zillalinkbuilding = db.zillalinkbuildings.Find(id); if (User.IsInRole("Admin")) { if (zillalinkbuilding == null) { return(HttpNotFound()); } ViewBag.orderID = new SelectList(db.orders, "ID", "orderno", zillalinkbuilding.orderID); return(View(zillalinkbuilding)); } else { if (zillalinkbuilding == null) { return(HttpNotFound()); } return(View(zillalinkbuilding)); } }
public ActionResult DeleteConfirmed(int id) { zillalinkbuilding zillalinkbuilding = db.zillalinkbuildings.Find(id); db.zillalinkbuildings.Remove(zillalinkbuilding); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,plan,url1,url2,url3,keyword1a,keyword1b,keyword2a,keyword2b,keyword3a,keyword3b,cloudurl,orderID")] zillalinkbuilding zillalinkbuilding) { int orderid = zillalinkbuilding.orderID; if (ModelState.IsValid) { db.Entry(zillalinkbuilding).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Details", "orders", new { @id = orderid })); } return(View(zillalinkbuilding)); }
// GET: zillalinkbuildings/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } zillalinkbuilding zillalinkbuilding = db.zillalinkbuildings.Find(id); if (zillalinkbuilding == null) { return(HttpNotFound()); } return(View(zillalinkbuilding)); }