Beispiel #1
0
        public OrderData(umbraco.DataLayer.IRecordsReader reader)
        {
            DatabaseId = reader.GetInt("id");
            UniqueId   = reader.GetGuid("uniqueID");
            StoreAlias = reader.GetString("storeAlias");
            if (!reader.IsNull("storeOrderReferenceID"))
            {
                StoreOrderReferenceId = reader.GetInt("storeOrderReferenceID");
            }
            OrderReferenceNumber = reader.GetString("orderNumber");

            OrderXML    = reader.GetString("orderInfo");
            OrderStatus = reader.GetString("orderStatus");

            if (!reader.IsNull("createDate"))
            {
                CreateDate = reader.GetDateTime("createDate");
            }
            if (!reader.IsNull("updateDate"))
            {
                UpdateDate = reader.GetDateTime("updateDate");
            }

            if (!reader.IsNull("customerID"))
            {
                CustomerId = reader.GetInt("customerID");
            }
            CustomerUsername  = reader.GetString("customerUsername");
            CustomerEmail     = reader.GetString("customerEmail");
            CustomerFirstName = reader.GetString("customerFirstName");
            CustomerLastName  = reader.GetString("customerLastName");

            TransactionId = reader.GetString("transactionID");
        }
Beispiel #2
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();
        }
Beispiel #3
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();
        }
Beispiel #4
0
        public static Topic GetFromReader(umbraco.DataLayer.IRecordsReader reader)
        {
            var topic = new Topic
            {
                Id                = reader.GetInt("id"),
                ParentId          = reader.GetInt("parentId"),
                MemberId          = reader.GetInt("memberId"),
                Replies           = reader.GetInt("replies"),
                Title             = CleanInvalidXmlChars(reader.GetString("title")),
                Body              = CleanInvalidXmlChars(reader.GetString("body")),
                LatestReplyAuthor = reader.GetInt("latestReplyAuthor"),
                Created           = reader.GetDateTime("created"),
                Updated           = reader.GetDateTime("updated"),
                UrlName           = reader.GetString("urlName"),
                Locked            = reader.GetBoolean("locked")
            };

            return(topic);
        }
Beispiel #5
0
        public static List <int> GetProjectContributors(int projectId)
        {
            List <int> projects = new List <int>();

            umbraco.DataLayer.IRecordsReader dr = Data.SqlHelper.ExecuteReader("SELECT * FROM projectContributors WHERE projectId = " + projectId);

            while (dr.Read())
            {
                projects.Add(dr.GetInt("memberId"));
            }
            return(projects);
        }
Beispiel #6
0
        public static List <WikiFile> CurrentFiles(int nodeId)
        {
            List <WikiFile> wfl = new List <WikiFile>();


            umbraco.DataLayer.IRecordsReader dr = Data.SqlHelper.ExecuteReader("SELECT id FROM wikiFiles WHERE nodeId = @nodeid", Data.SqlHelper.CreateParameter("@nodeId", nodeId));

            while (dr.Read())
            {
                wfl.Add(new WikiFile(dr.GetInt("id")));
            }

            return(wfl);
        }
Beispiel #7
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);
        }
Beispiel #8
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);
        }