Esempio n. 1
0
 public ActionResult AddGallery()
 {
     Gallery g = new Gallery();
       g.GalleryID = 0;
       g.Title = "";
       g.Description = "";
       return View("BlankGallery", g);
 }
Esempio n. 2
0
		private void detach_Galleries(Gallery entity)
		{
			this.SendPropertyChanging();
			entity.Page = null;
		}
Esempio n. 3
0
		private void attach_Galleries(Gallery entity)
		{
			this.SendPropertyChanging();
			entity.Page = this;
		}
Esempio n. 4
0
 partial void DeleteGallery(Gallery instance);
Esempio n. 5
0
 partial void UpdateGallery(Gallery instance);
Esempio n. 6
0
 partial void InsertGallery(Gallery instance);
Esempio n. 7
0
 private void FolderToGallery(Gallery g, DirectoryInfo dir)
 {
     foreach(DirectoryInfo d in dir.GetDirectories())
     {
       FolderToGallery(g, d);
     }
     foreach (FileInfo f in dir.GetFiles())
     {
       if (f.Extension == ".jpg" || f.Extension == ".gif" || f.Extension == ".png")
       {
     AddImage(g, f);
       }
     }
 }
Esempio n. 8
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();
 }
Esempio n. 9
0
 public int SaveGallery( int GalleryID, int? pageid)
 {
     if (GalleryID != 0) //existing gallery
       {
     Gallery g = db.Galleries.FirstOrDefault(gl => gl.GalleryID == GalleryID);
     if (g != null)
     {
       TryUpdateModel(g);
       db.SubmitChanges();
     }
       }
       else //new gallery
       {
     Gallery g = new Gallery();
     TryUpdateModel(g);
     g.GalleryCategoryID = 0;
     db.Galleries.InsertOnSubmit(g);
     db.SubmitChanges();
     GalleryID = g.GalleryID;
       }
       return GalleryID;
 }