Esempio n. 1
0
        private void GetProduct(Guid guid)
        {
            using (IDataReader reader = DBProduct.Get(guid))
            {
                if (reader.Read())
                {
                    this.guid         = new Guid(reader["Guid"].ToString());
                    this.storeGuid    = new Guid(reader["StoreGuid"].ToString());
                    this.taxClassGuid = new Guid(reader["TaxClassGuid"].ToString());
                    //this.sku = reader["Sku"].ToString();
                    this.name            = reader["Name"].ToString();
                    this.description     = reader["Description"].ToString();
                    this.modelNumber     = reader["ModelNumber"].ToString();
                    this.status          = Convert.ToByte(reader["Status"]);
                    this.fulfillmentType = Convert.ToByte(reader["FullfillmentType"]);
                    this.weight          = Convert.ToDecimal(reader["Weight"]);
                    this.quantityOnHand  = Convert.ToInt32(reader["QuantityOnHand"]);
                    this.imageFileName   = reader["ImageFileName"].ToString();
                    // TODO:
                    //this.imageFileBytes = Byte[]
                    this.created       = Convert.ToDateTime(reader["Created"]);
                    this.createdBy     = new Guid(reader["CreatedBy"].ToString());
                    this.lastModified  = Convert.ToDateTime(reader["LastModified"]);
                    this.lastModifedBy = new Guid(reader["LastModifedBy"].ToString());

                    this.url               = reader["Url"].ToString();
                    this.teaser            = reader["Abstract"].ToString();
                    this.showInProductList = Convert.ToBoolean(reader["ShowInProductList"]);
                    this.enableRating      = Convert.ToBoolean(reader["EnableRating"]);

                    this.sortRank1       = Convert.ToInt32(reader["SortRank1"]);
                    this.sortRank2       = Convert.ToInt32(reader["SortRank2"]);
                    this.teaserFile      = reader["TeaserFile"].ToString();
                    this.teaserFileLink  = reader["TeaserFileLink"].ToString();
                    this.metaDescription = reader["MetaDescription"].ToString();
                    this.metaKeywords    = reader["MetaKeywords"].ToString();
                    this.compiledMeta    = reader["CompiledMeta"].ToString();
                    if (reader["ShippingAmount"] != DBNull.Value)
                    {
                        this.shippingAmount = Convert.ToDecimal(reader["ShippingAmount"]);
                    }
                }
            }
        }
 public Product Get(int id)
 {
     return(dbProduct.Get(id));
 }