Example #1
0
        public WikiFile(int id)
        {
            umbraco.DataLayer.IRecordsReader dr = Data.SqlHelper.ExecuteReader("SELECT * FROM wikiFiles WHERE id = " + id.ToString());

            if (dr.Read())
            {
                Id          = dr.GetInt("id");
                Path        = dr.GetString("path");
                Name        = dr.GetString("name");
                FileType    = dr.GetString("type");
                RemovedBy   = dr.GetInt("removedBy");
                CreatedBy   = dr.GetInt("createdBy");
                NodeVersion = dr.GetGuid("version");
                NodeId      = dr.GetInt("nodeId");
                CreateDate  = dr.GetDateTime("createDate");
                Current     = dr.GetBoolean("current");
                Downloads   = dr.GetInt("downloads");
                Archived    = dr.GetBoolean("archived");
                Verified    = dr.GetBoolean("verified");
                Versions    = GetVersionsFromString(dr.GetString("umbracoVersion"));
                Version     = Versions.Any() ? GetVersionsFromString(dr.GetString("umbracoVersion"))[0] : UmbracoVersion.DefaultVersion();
            }
            else
            {
                throw new ArgumentException(string.Format("No node exists with id '{0}'", Id));
            }

            dr.Close();
        }
Example #2
0
        public Forum(int forumID)
        {
            umbraco.DataLayer.IRecordsReader dr = Data.SqlHelper.ExecuteReader("SELECT * FROM forumForums WHERE ID = @id", Data.SqlHelper.CreateParameter("@id", forumID));

            if (dr.Read())
            {
                Node n = new Node(dr.GetInt("id"));

                Forum f = new Forum();
                Id    = dr.GetInt("id");
                Title = n.Name;

                if (n.GetProperty("forumDescription") != null)
                {
                    Description = n.GetProperty("forumDescription").Value;
                }

                Exists        = true;
                TotalComments = dr.GetInt("totalComments");
                TotalTopics   = dr.GetInt("totalTopics");

                //Latest private vals
                _latestAuthorID  = dr.GetInt("latestAuthor");
                _latestCommentID = dr.GetInt("latestComment");
                _latestTopicID   = dr.GetInt("latestTopic");
                LatestPostDate   = dr.GetDateTime("latestPostDate");
            }
            else
            {
                Exists = false;
            }

            dr.Close();
            dr.Dispose();
        }
 private void FillGrid()
 {
     umbraco.DataLayer.IRecordsReader dr = Data.SqlHelper.ExecuteReader("SELECT * FROM forumComments WHERE memberId = " + memberId.Text);
     commentsGrid.DataSource = dr;
     commentsGrid.DataBind();
     dr.Close();
     dr.Dispose();
 }
Example #4
0
        public static List <Topic> GetSubscribedTopics(int memberId)
        {
            List <Topic> lt = new List <Topic>();

            umbraco.DataLayer.IRecordsReader dr = Data.SqlHelper.ExecuteReader(
                "SELECT topicId FROM forumTopicSubscribers WHERE memberId = " + memberId.ToString()
                );

            while (dr.Read())
            {
                lt.Add(Topic.GetTopic(dr.GetInt("topicId"), true));
            }
            dr.Close();
            return(lt);
        }
Example #5
0
        public static List <uForum.Businesslogic.Forum> GetSubscribedForums(int memberId)
        {
            List <uForum.Businesslogic.Forum> lt = new List <uForum.Businesslogic.Forum>();

            umbraco.DataLayer.IRecordsReader dr = Data.SqlHelper.ExecuteReader(
                "SELECT forumId FROM forumSubscribers WHERE memberId = " + memberId.ToString()
                );

            while (dr.Read())
            {
                lt.Add(new uForum.Businesslogic.Forum(dr.GetInt("forumId")));
            }
            dr.Close();
            dr.Dispose();

            return(lt);
        }