public void Save() { using (PhotoGalleryDataContext db = PhotoGalleryDataContext.GetDataContext()) { tblGallery gal = (from c in db.tblGalleries where c.GalleryID == this.GalleryID select c).FirstOrDefault(); if (gal == null || this.GalleryID == Guid.Empty) { gal = new tblGallery(); gal.SiteID = this.SiteID; gal.GalleryID = Guid.NewGuid(); } gal.GalleryTitle = this.GalleryTitle; if (gal.GalleryID != this.GalleryID) { db.tblGalleries.InsertOnSubmit(gal); } db.SubmitChanges(); this.GalleryID = gal.GalleryID; } }
internal GalleryGroup(tblGallery gal) { if (gal != null) { this.GalleryID = gal.GalleryID; this.SiteID = gal.SiteID.Value; this.GalleryTitle = gal.GalleryTitle; GalleryHelper gh = new GalleryHelper(SiteID); this.GalleryImages = gh.GalleryImageEntryListGetByGalleryID(this.GalleryID); } }
partial void DeletetblGallery(tblGallery instance);
partial void UpdatetblGallery(tblGallery instance);
partial void InserttblGallery(tblGallery instance);