public void Save()
        {
            if (!string.IsNullOrEmpty(this.GalleryImage))
            {
                using (PhotoGalleryDataContext db = PhotoGalleryDataContext.GetDataContext()) {
                    tblGalleryImageMeta gal = (from c in db.tblGalleryImageMetas
                                               where c.GalleryImage.ToLower() == this.GalleryImage.ToLower()
                                               select c).FirstOrDefault();

                    if (gal == null || this.GalleryImageMetaID == Guid.Empty)
                    {
                        gal                    = new tblGalleryImageMeta();
                        gal.SiteID             = this.SiteID;
                        gal.GalleryImageMetaID = Guid.NewGuid();
                        gal.GalleryImage       = this.GalleryImage;
                    }

                    gal.ImageTitle    = this.ImageTitle;
                    gal.ImageMetaData = this.ImageMetaData;

                    if (gal.GalleryImageMetaID != this.GalleryImageMetaID)
                    {
                        db.tblGalleryImageMetas.InsertOnSubmit(gal);
                    }

                    db.SubmitChanges();

                    this.GalleryImageMetaID = gal.GalleryImageMetaID;
                }
            }
        }
		public void Save() {

			if (!string.IsNullOrEmpty(this.GalleryImage)) {
				using (PhotoGalleryDataContext db = PhotoGalleryDataContext.GetDataContext()) {
					tblGalleryImageMeta gal = (from c in db.tblGalleryImageMetas
											   where c.GalleryImage.ToLower() == this.GalleryImage.ToLower()
											   select c).FirstOrDefault();

					if (gal == null || this.GalleryImageMetaID == Guid.Empty) {
						gal = new tblGalleryImageMeta();
						gal.SiteID = this.SiteID;
						gal.GalleryImageMetaID = Guid.NewGuid();
						gal.GalleryImage = this.GalleryImage;
					}

					gal.ImageTitle = this.ImageTitle;
					gal.ImageMetaData = this.ImageMetaData;

					if (gal.GalleryImageMetaID != this.GalleryImageMetaID) {
						db.tblGalleryImageMetas.InsertOnSubmit(gal);
					}

					db.SubmitChanges();

					this.GalleryImageMetaID = gal.GalleryImageMetaID;
				}
			}
		}
		internal GalleryMetaData(tblGalleryImageMeta gal) {
			if (gal != null) {
				this.GalleryImageMetaID = gal.GalleryImageMetaID;
				this.SiteID = gal.SiteID.Value;

				this.GalleryImage = gal.GalleryImage;
				this.ImageTitle = gal.ImageTitle;
				this.ImageMetaData = gal.ImageMetaData;
			}
		}
        internal GalleryMetaData(tblGalleryImageMeta gal)
        {
            if (gal != null)
            {
                this.GalleryImageMetaID = gal.GalleryImageMetaID;
                this.SiteID             = gal.SiteID.Value;

                this.GalleryImage  = gal.GalleryImage;
                this.ImageTitle    = gal.ImageTitle;
                this.ImageMetaData = gal.ImageMetaData;
            }
        }
 partial void DeletetblGalleryImageMeta(tblGalleryImageMeta instance);
 partial void UpdatetblGalleryImageMeta(tblGalleryImageMeta instance);
 partial void InserttblGalleryImageMeta(tblGalleryImageMeta instance);
 partial void DeletetblGalleryImageMeta(tblGalleryImageMeta instance);
 partial void UpdatetblGalleryImageMeta(tblGalleryImageMeta instance);
 partial void InserttblGalleryImageMeta(tblGalleryImageMeta instance);