コード例 #1
0
        public ActionResult Create(MenuDrinkStarers menuDrinkStarersSingle)
        {
            db.menuDrinkStarers.Add(menuDrinkStarersSingle);
            db.SaveChanges();

            return(RedirectToAction("Index"));
        }
コード例 #2
0
        public ActionResult Create(MenuMainDesert menuMainDesertSingle)
        {
            db.MenuMainDeserts.Add(menuMainDesertSingle);
            db.SaveChanges();

            return(RedirectToAction("Index"));
        }
 public ActionResult Create(LatestBlog LatestBlogsingle)
 {
     if (LatestBlogsingle.ImgFile.ContentLength > 0)
     {
         var fileNm   = Path.GetFileName(LatestBlogsingle.ImgFile.FileName);
         var saveArea = Path.Combine(Server.MapPath("~/Public/images"), fileNm);
         LatestBlogsingle.ImgFile.SaveAs(saveArea);
         LatestBlogsingle.Image = fileNm;
         db.LatestBlogs.Add(LatestBlogsingle);
         db.SaveChanges();
     }
     return(RedirectToAction("Index"));
 }
コード例 #4
0
 public ActionResult Create(GalleryInteriorPhoto galleryInteriorPhotosingle)
 {
     if (galleryInteriorPhotosingle.ImgFile.ContentLength > 0)
     {
         var fileNm   = Path.GetFileName(galleryInteriorPhotosingle.ImgFile.FileName);
         var saveArea = Path.Combine(Server.MapPath("~/Public/images"), fileNm);
         galleryInteriorPhotosingle.ImgFile.SaveAs(saveArea);
         galleryInteriorPhotosingle.Image = fileNm;
         db.galleryInteriorPhotos.Add(galleryInteriorPhotosingle);
         db.SaveChanges();
     }
     return(RedirectToAction("Index"));
 }
コード例 #5
0
        public ActionResult Create(MenuImgAreaFirst menuImgAreaFirstSingle)
        {
            if (menuImgAreaFirstSingle.ImgFile.ContentLength > 0)
            {
                var fileNm   = Path.GetFileName(menuImgAreaFirstSingle.ImgFile.FileName);
                var saveArea = Path.Combine(Server.MapPath("~/Public/images"), fileNm);
                menuImgAreaFirstSingle.ImgFile.SaveAs(saveArea);
                menuImgAreaFirstSingle.Image = fileNm;
                db.menuImgAreaFirsts.Add(menuImgAreaFirstSingle);
                db.SaveChanges();
            }

            return(RedirectToAction("Index"));
        }
        public ActionResult Create(RomanticDeliciousRed romantic)
        {
            if (romantic.ImgFile.ContentLength > 0)
            {
                var fileNm   = Path.GetFileName(romantic.ImgFile.FileName);
                var saveArea = Path.Combine(Server.MapPath("~/Public/images"), fileNm);
                romantic.ImgFile.SaveAs(saveArea);
                romantic.Image = fileNm;
                db.RomanticDeliciousReds.Add(romantic);
                db.SaveChanges();
            }

            return(RedirectToAction("Index"));
        }
        public ActionResult Delete(int id)
        {
            var model = db.specialSignUps.FirstOrDefault(m => m.Id == id);

            db.specialSignUps.Remove(model);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #8
0
        public ActionResult Edit(ItalianResturant ıtalianResturant)
        {
            if (ıtalianResturant.ImgFile.ContentLength > 0)
            {
                var fileNm   = Path.GetFileName(ıtalianResturant.ImgFile.FileName);
                var saveArea = Path.Combine(Server.MapPath("~/Public/images"), fileNm);
                ıtalianResturant.ImgFile.SaveAs(saveArea);
                ıtalianResturant.ItalianRestaurantimg = fileNm;
                db.Entry(ıtalianResturant).State      = System.Data.Entity.EntityState.Modified;
                db.SaveChanges();
            }

            return(RedirectToAction("Index"));
        }
コード例 #9
0
        public ActionResult Edit(DeliciousReceipes receipes)
        {
            if (receipes.ImgFile.ContentLength > 0)
            {
                var fileNm   = Path.GetFileName(receipes.ImgFile.FileName);
                var saveArea = Path.Combine(Server.MapPath("~/Public/images"), fileNm);
                receipes.ImgFile.SaveAs(saveArea);
                receipes.Image           = fileNm;
                db.Entry(receipes).State = System.Data.Entity.EntityState.Modified;
                db.SaveChanges();
            }

            return(RedirectToAction("Index"));
        }
 public ActionResult Edit(ContactForm contactFormSingle)
 {
     db.Entry(contactFormSingle).State = System.Data.Entity.EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }
コード例 #11
0
 public ActionResult Edit(Settings seting)
 {
     db.Entry(seting).State = System.Data.Entity.EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }