Exemple #1
0
 public ActionResult Edit(OutLink outlink)
 {
     if (ModelState.IsValid)
     {
         db.Entry(outlink).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(outlink));
 }
Exemple #2
0
 public ActionResult Edit(Sitemap sitemap)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sitemap).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(sitemap));
 }
Exemple #3
0
 public ActionResult Edit(Document documnet, HttpPostedFileBase ImageFile)
 {
     if (ModelState.IsValid)
     {
         if (ImageFile != null)
         {
             documnet.ImageMimeType = ImageFile.ContentType;
             documnet.ImageData     = new byte[ImageFile.ContentLength];
             ImageFile.InputStream.Read(documnet.ImageData, 0, ImageFile.ContentLength);
         }
         else
         {
             //var tempDoc = db.Document.FirstOrDefault(d => d.Id == documnet.Id);
             //documnet.ImageData = tempDoc.ImageData;
             //documnet.ImageMimeType = tempDoc.ImageMimeType;
         }
         db.Entry(documnet).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(documnet));
 }