Exemplo n.º 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;
            }
        }
Exemplo n.º 2
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;
			}
		}
Exemplo n.º 4
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;
            }
        }
Exemplo n.º 5
0
 partial void DeletetblGalleryImage(tblGalleryImage instance);
Exemplo n.º 6
0
 partial void UpdatetblGalleryImage(tblGalleryImage instance);
Exemplo n.º 7
0
 partial void InserttblGalleryImage(tblGalleryImage instance);
Exemplo n.º 8
0
 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;
		}