コード例 #1
0
        /// <summary>
        /// Gets the place tag.
        /// </summary>
        /// <param name="placeTag">The place tag.</param>
        /// <returns></returns>
        private Model.TagPlace.TagPlace getPlaceTag(place_tag_in_publication placeTag)
        {
            Model.TagPlace.TagPlace newTagPlace = new XareuServices.Model.TagPlace.TagPlace();

            newTagPlace.Id   = placeTag.place_tag_id;
            newTagPlace.Name = placeTag.place_tag.place_tag_name;
            try
            {
                newTagPlace.ParentId = (long)placeTag.place_tag.place_tag_parent;
            }
            catch { newTagPlace.ParentId = 0; }

            return(newTagPlace);
        }
コード例 #2
0
 /// <summary>
 /// Adds the place tag in publication.
 /// </summary>
 /// <param name="publicationId">The publication id.</param>
 /// <param name="placeTagId">The place tag id.</param>
 /// <returns>True if it was OK, false otherwise</returns>
 public bool AddPlaceTagInPublication(long publicationId, long placeTagId)
 {
     try
     {
         place_tag_in_publication newPlaceTagInPublication = new place_tag_in_publication();
         newPlaceTagInPublication.publication_id = publicationId;
         newPlaceTagInPublication.place_tag_id   = placeTagId;
         data.place_tag_in_publications.InsertOnSubmit(newPlaceTagInPublication);
         data.SubmitChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }