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(); }
public SiteDetail Update(SiteDetail e) { DB.SiteDetails.Attach(e); //UpdateCategory(e); DB.ObjectStateManager.ChangeObjectState(e, System.Data.EntityState.Modified); Save(); return e; }
public SiteDetail Update(SiteDetail e) { DB.SiteDetails.Attach(e); //UpdateCategory(e); DB.ObjectStateManager.ChangeObjectState(e, System.Data.EntityState.Modified); Save(); return(e); }
//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; }
//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); }
/// <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; }
/// <summary> /// Deprecated Method for adding a new object to the SiteDetails EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToSiteDetails(SiteDetail siteDetail) { base.AddObject("SiteDetails", siteDetail); }