Example #1
0
 public ActionResult DeleteConfirmed(Guid id)
 {
     Repozytorium.Models.File file = db.File.Find(id);
     db.File.Remove(file);
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }
Example #2
0
 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));
 }
Example #3
0
        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));
        }
Example #4
0
 // 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));
 }