예제 #1
0
 public ActionResult Edit(int id)
 {
     IGalleryDAC dac = new GalleryDAC();
     var gallery = dac.GetGallery(id);
     var model = new GalleryEdit { Description = gallery.Description, GalleryID = gallery.GalleryID, Name = gallery.Name, SortOrder = gallery.SortOrder, MainImage = gallery.DisplayImage };
     return View(model);
 }
예제 #2
0
 public ActionResult Edit(GalleryEdit gallery)
 {
     if (!ModelState.IsValid)
         return View(gallery);
     IGalleryDAC dac = new GalleryDAC();
     dac.Update(gallery.GalleryID, gallery.Name, gallery.Description, gallery.SortOrder, gallery.MainImage);
     return RedirectToAction("Index");
 }
예제 #3
0
 public ActionResult GalleryImages(int id)
 {
     IGalleryDAC dac = new GalleryDAC();
     Gallery gallery = dac.GetGallery(id);
     ViewBag.GalleryTitle = gallery.Name;
     IImageDAC imageDAC = new ImageDAC();
     var images = imageDAC.Get(id);
     return View(images);
 }
예제 #4
0
        public ActionResult Create(GalleryCreate gallery)
        {
            if (!ModelState.IsValid)
                return View(gallery);

            IGalleryDAC dac = new GalleryDAC();
            dac.Add(gallery.Name, gallery.Description, gallery.SortOrder);
            return RedirectToAction("Index");
        }
예제 #5
0
 // GET: Admin666/Image
 public ActionResult Index(int galleryID)
 {
     IImageDAC dac = new ImageDAC();
     IGalleryDAC galleryDAC = new GalleryDAC();
     var gallery = galleryDAC.GetGallery(galleryID);
     ViewBag.Gallery = gallery.Name;
     ViewBag.GalleryID = gallery.GalleryID;
     ViewBag.DefaultImage = gallery.DisplayImage;
     var images = dac.Get(galleryID);
     return View(images);
 }
예제 #6
0
 public ActionResult UpdateDefaultImage(int galleryID,string image)
 {
     IGalleryDAC galleryDAC = new GalleryDAC();
     galleryDAC.SetDisplayImage(galleryID, image);
     return Json(new { Success = true });
 }
예제 #7
0
 public ActionResult Gallery()
 {
     IGalleryDAC dac = new GalleryDAC();
     IList<Gallery> galleries = dac.Get();
     return View(galleries);
 }
예제 #8
0
 public ActionResult Delete(int id)
 {
     IGalleryDAC dac = new GalleryDAC();
     dac.Delete(id);
     return RedirectToAction("Index");
 }