public ActionResult DeleteConfirmed(Guid id) { Repozytorium.Models.File file = db.File.Find(id); db.File.Remove(file); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Name,DateInsert,DateUpdate,AccessId,Content,Path")] Repozytorium.Models.File file) { if (ModelState.IsValid) { db.Entry(file).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(file)); }
public ActionResult Create([Bind(Include = "Id,Name,DateInsert,DateUpdate,AccessId,Content,Path")] Repozytorium.Models.File file) { if (ModelState.IsValid) { file.Id = Guid.NewGuid(); db.File.Add(file); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(file)); }
// GET: Files/Delete/5 public ActionResult Delete(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Repozytorium.Models.File file = db.File.Find(id); if (file == null) { return(HttpNotFound()); } return(View(file)); }