Exemplo n.º 1
0
 public ActionResult AddGallery()
 {
     Gallery g = new Gallery();
       g.GalleryID = 0;
       g.Title = "";
       g.Description = "";
       return View("BlankGallery", g);
 }
Exemplo n.º 2
0
		private void detach_Galleries(Gallery entity)
		{
			this.SendPropertyChanging();
			entity.Page = null;
		}
Exemplo n.º 3
0
		private void attach_Galleries(Gallery entity)
		{
			this.SendPropertyChanging();
			entity.Page = this;
		}
Exemplo n.º 4
0
 partial void DeleteGallery(Gallery instance);
Exemplo n.º 5
0
 partial void UpdateGallery(Gallery instance);
Exemplo n.º 6
0
 partial void InsertGallery(Gallery instance);
Exemplo 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);
       }
     }
 }
Exemplo 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();
 }
Exemplo 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;
 }