예제 #1
0
 public void Create(GalleryImage image)
 {
     if (image != null)
     {
         Context.GalleryImages.Add(image);
     }
 }
예제 #2
0
 public ActionResult AddToGallery(CreateImageViewModel model)
 {
     if (SaveScreenshot(model))
     {
         var product = ProductManager.FindById(model.ProductId);
         var img = new GalleryImage
         {
             Product = product,
             ImageLocation = model.ImageUrl,
             ImageThumb = model.ImageThumbUrl
         };
         product.GalleryImages.Add(img);
         MultimediaManager.Create(img);
         MultimediaManager.Save();
     }
     return ManageImages(model.ProductId);
 }