public ActionResult DeleteConfirmed(int id) { RelCatAndSor relCatAndSor = db.RelCatAndSors.Find(id); db.RelCatAndSors.Remove(relCatAndSor); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,kateqoriya_id,topic_id")] RelCatAndSor relCatAndSor) { if (ModelState.IsValid) { db.Entry(relCatAndSor).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.kateqoriya_id = new SelectList(db.Categories, "id", "kateqoriya_name", relCatAndSor.kateqoriya_id); ViewBag.topic_id = new SelectList(db.Sources, "id", "title", relCatAndSor.topic_id); return(View(relCatAndSor)); }
// GET: Hidden/RelCatAndSors/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } RelCatAndSor relCatAndSor = db.RelCatAndSors.Find(id); if (relCatAndSor == null) { return(HttpNotFound()); } if (Session["admin"] != null) { return(View(relCatAndSor)); } else { return(RedirectToAction("login", "admin")); } }
// GET: Hidden/RelCatAndSors/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } RelCatAndSor relCatAndSor = db.RelCatAndSors.Find(id); if (relCatAndSor == null) { return(HttpNotFound()); } ViewBag.kateqoriya_id = new SelectList(db.Categories, "id", "kateqoriya_name", relCatAndSor.kateqoriya_id); ViewBag.topic_id = new SelectList(db.Sources, "id", "title", relCatAndSor.topic_id); if (Session["admin"] != null) { return(View(relCatAndSor)); } else { return(RedirectToAction("login", "admin")); } }