예제 #1
0
        public void MovePhoto(SitePhoto photo, SiteDetail sd)
        {
            //PicasaRepository picasaRepository = new PicasaRepository();

            //if (string.IsNullOrEmpty(sd.AlbumUrl))
            //{
            //    sd.AlbumUrl = picasaRepository.CreateAlbum("SD_" + sd.ID.ToString());
            //}

            //var createdEntry = picasaRepository.MovingPhoto(photo.Url, photo.AtomUrl, sd.AlbumUrl, photo.Note);

            //if (createdEntry != null)
            //{
            //    var p = new SiteDetailPhoto();

            //    p.Url = createdEntry.Media.Content.Url;
            //    p.AtomUrl = createdEntry.EditUri.Content;
            //    p.TakenDate = photo.TakenDate;
            //    p.Lng = photo.Lng;
            //    p.Lat = photo.Lat;
            //    p.Note = photo.Note;
            //    sd.SiteDetailPhotoes.Add(p);

            //    DB.DeleteObject(photo);
            //}

            //Save();
        }
예제 #2
0
        public SiteDetail Update(SiteDetail e)
        {
            DB.SiteDetails.Attach(e);
            //UpdateCategory(e);
            DB.ObjectStateManager.ChangeObjectState(e, System.Data.EntityState.Modified);
            Save();

            return e;
        }
예제 #3
0
        public SiteDetail Update(SiteDetail e)
        {
            DB.SiteDetails.Attach(e);
            //UpdateCategory(e);
            DB.ObjectStateManager.ChangeObjectState(e, System.Data.EntityState.Modified);
            Save();

            return(e);
        }
예제 #4
0
        //public void UpdateCategory(SiteDetail e)
        //{
        //    CategoryRepository catRepository = new CategoryRepository();
        //    catRepository.Set3LevelByFullname(e.NewCategoryFullName, e.UpdateCategory);
        //}
        public SiteDetail Add(int siteID)
        {
            var siteRepo = new SiteRepository() { DB = DB };
            var site = siteRepo.Get(siteID);

            var siteDetail = new SiteDetail();
            site.SiteDetails.Add(siteDetail);

            Save();

            return siteDetail;
        }
예제 #5
0
        //public void UpdateCategory(SiteDetail e)
        //{
        //    CategoryRepository catRepository = new CategoryRepository();
        //    catRepository.Set3LevelByFullname(e.NewCategoryFullName, e.UpdateCategory);
        //}



        public SiteDetail Add(int siteID)
        {
            var siteRepo = new SiteRepository()
            {
                DB = DB
            };
            var site = siteRepo.Get(siteID);

            var siteDetail = new SiteDetail();

            site.SiteDetails.Add(siteDetail);

            Save();

            return(siteDetail);
        }
예제 #6
0
 /// <summary>
 /// Create a new SiteDetail object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 public static SiteDetail CreateSiteDetail(global::System.Int32 id)
 {
     SiteDetail siteDetail = new SiteDetail();
     siteDetail.ID = id;
     return siteDetail;
 }
예제 #7
0
 /// <summary>
 /// Deprecated Method for adding a new object to the SiteDetails EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToSiteDetails(SiteDetail siteDetail)
 {
     base.AddObject("SiteDetails", siteDetail);
 }