public static TagLink GetTagLink(LoginUser loginUser, int tagLinkID)
        {
            TagLinks tagLinks = new TagLinks(loginUser);

            tagLinks.LoadByTagLinkID(tagLinkID);
            if (tagLinks.IsEmpty)
            {
                return(null);
            }
            else
            {
                return(tagLinks[0]);
            }
        }
Example #2
0
        public static int GetLinkCount(LoginUser loginUser, int tagID)
        {
            TagLinks tagLinks = new TagLinks(loginUser);

            using (SqlCommand command = new SqlCommand())
            {
                command.CommandText = "SELECT COUNT(*) FROM TagLinks WHERE TagID = @TagID";
                command.CommandType = CommandType.Text;
                command.Parameters.AddWithValue("TagID", tagID);
                Object o = tagLinks.ExecuteScalar(command);
                if (o == null || o == DBNull.Value)
                {
                    return(0);
                }
                return((int)o);
            }
        }
Example #3
0
        public static TagLink GetTagLink(LoginUser loginUser, ReferenceType refType, int refID, int tagID)
        {
            TagLinks tagLinks = new TagLinks(loginUser);

            using (SqlCommand command = new SqlCommand())
            {
                command.CommandText = "SELECT * FROM TagLinks WHERE RefType = @RefType AND RefID = @RefID AND TagID = @TagID";
                command.CommandType = CommandType.Text;
                command.Parameters.AddWithValue("RefType", refType);
                command.Parameters.AddWithValue("RefID", refID);
                command.Parameters.AddWithValue("TagID", tagID);
                tagLinks.Fill(command);
            }

            if (tagLinks.IsEmpty)
            {
                return(null);
            }
            else
            {
                return(tagLinks[0]);
            }
        }
 public TagLink(DataRow row, TagLinks tagLinks) : base(row, tagLinks)
 {
     _tagLinks = tagLinks;
 }
Example #5
0
 public int GetLinkCount()
 {
     return(TagLinks.GetLinkCount(Collection.LoginUser, TagID));
 }