示例#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");
        }
示例#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();
        }