コード例 #1
0
        private static dynamic LoadDynamic(DataSource ds, dynamic p)
        {
            p.ProductCart_Title = p.Product_Title;
            try { p.ProductCart_Image = p.Product_Image.Split('|')[0]; }
            catch (Exception) { }
            p.ProductCart_Attributes = ProductMapping.GetAttributes(ds, p.Product_Id);

            if (!(p.ProductAreaMapping_Price is DBNull) && p.ProductAreaMapping_Price > 0)
            {
                p.ProductCart_Price = p.ProductAreaMapping_Price;
            }
            else
            {
                p.ProductCart_Price = p.Product_Price;
            }
            DateTime now = DateTime.Now;

            if (p.Product_DiscountState == (int)DiscountState.Activated && (now >= p.Product_DiscountBeginTime && now < p.Product_DiscountEndTime))
            {
                p.ProductCart_SalePrice = p.Product_DiscountPrice;
            }
            else if (p.Product_Wholesale)
            {
                p.ProductCart_SalePrice = p.Product_WholesalePrice;
            }
            else if (!(p.ProductAreaMapping_Price is DBNull) && p.ProductAreaMapping_Price > 0)
            {
                p.ProductCart_SalePrice = p.ProductAreaMapping_Price;
            }
            else
            {
                p.ProductCart_SalePrice = p.Product_Price;
            }
            return(p);
        }
コード例 #2
0
 protected virtual DataStatus DeleteMapping(DataSource ds)
 {
     return(ProductMapping.DeleteBySerie(ds, Id));
 }
コード例 #3
0
 public IList <ProductMapping> GetMappings(DataSource ds)
 {
     return(ProductMapping.GetAllBySerie(ds, Id));
 }