示例#1
0
        public GalleryGroup GalleryGroupGetByID(Guid galleryID)
        {
            using (PhotoGalleryDataContext db = PhotoGalleryDataContext.GetDataContext()) {
                GalleryGroup ge = (from c in db.tblGalleries
                                   where c.SiteID == this.SiteID &&
                                   c.GalleryID == galleryID
                                   select new GalleryGroup(c)).FirstOrDefault();

                return(ge);
            }
        }
示例#2
0
        public GalleryGroup GalleryGroupGetByName(string galleryTitle)
        {
            GalleryGroup ge = null;

            using (PhotoGalleryDataContext db = PhotoGalleryDataContext.GetDataContext()) {
                if (!String.IsNullOrEmpty(galleryTitle))
                {
                    ge = (from c in db.tblGalleries
                          where c.SiteID == this.SiteID &&
                          c.GalleryTitle.ToLower() == galleryTitle.ToLower()
                          select new GalleryGroup(c)).FirstOrDefault();
                }
            }

            return(ge);
        }
示例#3
0
 public override bool Equals(Object obj)
 {
     //Check for null and compare run-time types.
     if (obj == null || GetType() != obj.GetType())
     {
         return(false);
     }
     if (obj is GalleryGroup)
     {
         GalleryGroup p = (GalleryGroup)obj;
         return((this.GalleryID == p.GalleryID) &&
                (this.SiteID == p.SiteID) &&
                (this.GalleryTitle == p.GalleryTitle));
     }
     else
     {
         return(false);
     }
 }