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); } }
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); }
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); } }