Esempio n. 1
0
        public ActionResult AddImageToGallery(int galleryID, string imageSrc)
        {
            string src = imageSrc.Substring(imageSrc.IndexOf("/upload/"));
              FileInfo fi = new FileInfo(imageSrc);

              if (fi.Extension == ".jpg" || fi.Extension == ".gif" || fi.Extension == ".png")
              {

            GalleryImage gi = new GalleryImage();
            gi.GalleryID = galleryID;
            gi.Src = src;
            gi.Position = db.GalleryImages.Count(i => i.GalleryID == galleryID);
            db.GalleryImages.InsertOnSubmit(gi);
            db.SubmitChanges();

            return View("GalleryImage", gi);
              }

              return null;
        }
Esempio n. 2
0
 partial void DeleteGalleryImage(GalleryImage instance);
Esempio n. 3
0
 partial void UpdateGalleryImage(GalleryImage instance);
Esempio n. 4
0
 partial void InsertGalleryImage(GalleryImage instance);
Esempio n. 5
0
		private void detach_GalleryImages(GalleryImage entity)
		{
			this.SendPropertyChanging();
			entity.Gallery = null;
		}
Esempio n. 6
0
		private void attach_GalleryImages(GalleryImage entity)
		{
			this.SendPropertyChanging();
			entity.Gallery = this;
		}
Esempio n. 7
0
 private void AddImage(Gallery g, FileInfo f)
 {
     GalleryImage gi = new GalleryImage();
       gi.Gallery = g;
       gi.Src = FileInfoToSrc(f);
       gi.Position = g.GalleryImages.Count();
       db.GalleryImages.InsertOnSubmit(gi);
       db.SubmitChanges();
 }