コード例 #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;
            }
        }
コード例 #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;
            }
        }
コード例 #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;
			}
		}
コード例 #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;
            }
        }
コード例 #5
0
 partial void DeletetblGalleryImage(tblGalleryImage instance);
コード例 #6
0
 partial void UpdatetblGalleryImage(tblGalleryImage instance);
コード例 #7
0
 partial void InserttblGalleryImage(tblGalleryImage instance);
コード例 #8
0
 private void detach_tblGalleryImages(tblGalleryImage entity)
 {
     this.SendPropertyChanging();
     entity.tblGallery = null;
 }
コード例 #9
0
 partial void DeletetblGalleryImage(tblGalleryImage instance);
コード例 #10
0
 partial void UpdatetblGalleryImage(tblGalleryImage instance);
コード例 #11
0
 partial void InserttblGalleryImage(tblGalleryImage instance);
コード例 #12
0
		private void detach_tblGalleryImages(tblGalleryImage entity)
		{
			this.SendPropertyChanging();
			entity.tblGallery = null;
		}