public ActionResult DeleteConfirmed(int id) { Archieve archieve = db.Archieves.Find(id); db.Archieves.Remove(archieve); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,ProductId,UserId,DateTime,Ip")] Archieve archieve) { if (ModelState.IsValid) { db.Entry(archieve).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ProductId = new SelectList(db.Products, "Id", "Name", archieve.ProductId); ViewBag.UserId = new SelectList(db.Userses, "Id", "Name", archieve.UserId); return(View(archieve)); }
// GET: /Archeive/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Archieve archieve = db.Archieves.Find(id); if (archieve == null) { return(HttpNotFound()); } return(View(archieve)); }
public ActionResult Create([Bind(Include = "Id,ProductId,UserId,DateTime,Ip")] Archieve archieve) { if (Session["type"] == null || Session["type"] == "") { Session["dv"] = "Create"; Session["dc"] = "Archieve"; return(RedirectToAction("Login", "Users")); } if (ModelState.IsValid) { db.Archieves.Add(archieve); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ProductId = new SelectList(db.Products, "Id", "Name", archieve.ProductId); ViewBag.UserId = new SelectList(db.Userses, "Id", "Name", archieve.UserId); return(View(archieve)); }
// GET: /Archeive/Delete/5 public ActionResult Delete(int?id) { if (Session["type"] == null || Session["type"] == "") { Session["dv"] = "Delete"; Session["dc"] = "Archieve"; return(RedirectToAction("Login", "Users")); } if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Archieve archieve = db.Archieves.Find(id); if (archieve == null) { return(HttpNotFound()); } return(View(archieve)); }
// GET: /Archeive/Edit/5 public ActionResult Edit(int?id) { if (Session["type"] == null || Session["type"] == "") { Session["dv"] = "Edit"; Session["dc"] = "Archieve"; return(RedirectToAction("Login", "Users")); } if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Archieve archieve = db.Archieves.Find(id); if (archieve == null) { return(HttpNotFound()); } ViewBag.ProductId = new SelectList(db.Products, "Id", "Name", archieve.ProductId); ViewBag.UserId = new SelectList(db.Userses, "Id", "Name", archieve.UserId); return(View(archieve)); }