Example #1
0
        public void Save()
        {
            using (PhotoGalleryDataContext db = PhotoGalleryDataContext.GetDataContext()) {
                tblGalleryImage gal = (from c in db.tblGalleryImages
                                       where c.GalleryImageID == this.GalleryImageID
                                       select c).FirstOrDefault();

                if (gal == null || this.GalleryID == Guid.Empty)
                {
                    gal                = new tblGalleryImage();
                    gal.GalleryID      = this.GalleryID;
                    gal.GalleryImageID = Guid.NewGuid();
                }

                gal.GalleryImage = this.GalleryImage;
                gal.ImageOrder   = this.ImageOrder;

                if (gal.GalleryImageID != this.GalleryImageID)
                {
                    db.tblGalleryImages.InsertOnSubmit(gal);
                }

                db.SubmitChanges();

                this.GalleryImageID = gal.GalleryImageID;
            }
        }
		internal GalleryImageEntry(tblGalleryImage gal) {
			if (gal != null) {
				this.GalleryID = gal.GalleryID.Value;
				this.GalleryImageID = gal.GalleryImageID;

				this.GalleryImage = gal.GalleryImage;
				this.ImageOrder = gal.ImageOrder.Value;
			}
		}
Example #3
0
        internal GalleryImageEntry(tblGalleryImage gal)
        {
            if (gal != null)
            {
                this.GalleryID      = gal.GalleryID.Value;
                this.GalleryImageID = gal.GalleryImageID;

                this.GalleryImage = gal.GalleryImage;
                this.ImageOrder   = gal.ImageOrder.Value;
            }
        }
		public void Save() {
			using (PhotoGalleryDataContext db = PhotoGalleryDataContext.GetDataContext()) {
				tblGalleryImage gal = (from c in db.tblGalleryImages
									   where c.GalleryImageID == this.GalleryImageID
									   select c).FirstOrDefault();

				if (gal == null || this.GalleryID == Guid.Empty) {
					gal = new tblGalleryImage();
					gal.GalleryID = this.GalleryID;
					gal.GalleryImageID = Guid.NewGuid();
				}

				gal.GalleryImage = this.GalleryImage;
				gal.ImageOrder = this.ImageOrder;

				if (gal.GalleryImageID != this.GalleryImageID) {
					db.tblGalleryImages.InsertOnSubmit(gal);
				}

				db.SubmitChanges();

				this.GalleryImageID = gal.GalleryImageID;
			}
		}
 partial void DeletetblGalleryImage(tblGalleryImage instance);
 partial void UpdatetblGalleryImage(tblGalleryImage instance);
 partial void InserttblGalleryImage(tblGalleryImage instance);
 private void detach_tblGalleryImages(tblGalleryImage entity)
 {
     this.SendPropertyChanging();
     entity.tblGallery = null;
 }
 partial void DeletetblGalleryImage(tblGalleryImage instance);
 partial void UpdatetblGalleryImage(tblGalleryImage instance);
 partial void InserttblGalleryImage(tblGalleryImage instance);
		private void detach_tblGalleryImages(tblGalleryImage entity)
		{
			this.SendPropertyChanging();
			entity.tblGallery = null;
		}