示例#1
0
        protected override void Parse(System.Data.DataRow row)
        {
            var value = 0;

            if (row.HasValue("Image_height") && int.TryParse(row["Image_height"].ToString(), out value))
            {
                this.Height = value;
            }
            if (row.HasValue("Image_width") && int.TryParse(row["Image_width"].ToString(), out value))
            {
                this.Width = value;
            }

            var list = new List <string>();

            list.Add(row.GetValue("Image_filename_Big"));
            list.Add(row.GetValue("Image_filename"));
            list.Add(row.GetValue("Image_filename_2"));
            list.Add(row.GetValue("Image_filename_3"));
            list.Add(row.GetValue("Image_filename_4"));
            list.Add(row.GetValue("Image_filename_5"));
            ImageUrls = list.Where(img => !string.IsNullOrWhiteSpace(img)).Distinct().ToArray();
        }
示例#2
0
        protected override void Parse(System.Data.DataRow row)
        {
            if (row == null)
            {
                return;
            }

            base.Parse(row);

            if (row.HasValue("CP_Wiper_Baffler"))
            {
                Stand = row.GetValue("CP_Wiper_Baffler") == "1";
            }
            OriginalNo = row.GetValue("CP_Wiper_OriginalNo");
            Series     = row.GetValue("CP_Wiper_Series");
            Joint      = row.GetValue("CP_Wiper_SI_Joint");
            Silent     = row.GetValue("CP_Wiper_SI_Silent");
            Wearable   = row.GetValue("CP_Wiper_SI_Wearable");
            Size       = row.GetValue("CP_Wiper_Size");
            if (row.HasValue("CP_Wiper_Stand"))
            {
                Stand = row.GetValue("CP_Wiper_Stand") == "1";
            }
        }
示例#3
0
        protected override void Parse(System.Data.DataRow row)
        {
            base.Parse(row);

            if (row.HasValue("AdditionalProperties"))
            {
                try
                {
                    AdditionalProperties = JsonConvert.DeserializeObject <IDictionary <string, string> >(row.GetValue("AdditionalProperties"));
                }
                catch { }
            }
            if (AdditionalProperties == null)
            {
                AdditionalProperties = new Dictionary <string, string>();
            }
        }
示例#4
0
        public ArticleCommentModel(System.Data.DataRow row) : base(row)
        {
            if (row.HasValue("CreatorInfo"))
            {
                var createInfo = row["CreatorInfo"];
                if (createInfo != null && string.IsNullOrEmpty(createInfo.ToString()) == false)
                {
                    var createInfoDic = Newtonsoft.Json.JsonConvert.DeserializeObject <Dictionary <string, string> >(createInfo.ToString());
                    UserHead  = createInfoDic["UserHead"];
                    UserName  = createInfoDic["UserName"];
                    UserGrade = createInfoDic["UserGrade"];
                }
            }

            if (string.IsNullOrEmpty(UserHead))
            {
                UserHead = Component.Activity.BusinessData.UserHeadHelper.GetUserDefaultHead(UserGrade);
            }
        }
示例#5
0
        protected override void Parse(System.Data.DataRow row)
        {
            if (row == null)
            {
                return;
            }

            base.Parse(row);

            Size        = new TireSizeModel(row);
            LoadIndex   = row.GetValue("CP_Tire_LoadIndex");
            SpeedRating = row.GetValue("CP_Tire_SpeedRating");
            ROF         = row.GetValue("CP_Tire_ROF") == "防爆";
            Type        = row.GetValue("CP_Tire_Type");
            Pattern     = row.GetValue("CP_Tire_Pattern");
            TextColor   = row.GetValue("CP_Tire_TextColor");
            Remark      = row.GetValue("CP_Tire_Remark");
            int result;

            if (int.TryParse(row.GetValue("ProductRefer"), out result))
            {
                ProductRefer = result;
            }
            if (row.HasValue("cy_marketing_price"))
            {
                MarketingPrice = Convert.ToDecimal(row["cy_marketing_price"]);
            }
            CorneringStability     = row.GetValue("CP_Tire_SI_CorneringStability");
            DeepSnowTraction       = row.GetValue("CP_Tire_SI_DeepSnowTraction");
            DryTraction            = row.GetValue("CP_Tire_SI_DryTraction");
            HydroplaningResistance = row.GetValue("CP_Tire_SI_HydroplaningResistance");
            IceTraction            = row.GetValue("CP_Tire_SI_IceTraction");
            LightSnowTraction      = row.GetValue("CP_Tire_SI_LightSnowTraction");
            NoiseComfort           = row.GetValue("CP_Tire_SI_NoiseComfort");
            RideComfort            = row.GetValue("CP_Tire_SI_RideComfort");
            SteeringResponse       = row.GetValue("CP_Tire_SI_SteeringResponse");
            WetTraction            = row.GetValue("CP_Tire_SI_WetTraction");
        }
示例#6
0
        protected override void Parse(System.Data.DataRow row)
        {
            if (row == null)
            {
                return;
            }

            if (row.HasValue("oid"))
            {
                Oid = Convert.ToInt32(row["oid"]);
            }

            ProductID      = row.GetValue("ProductID");
            Category       = row.GetValue("Category");
            DefinitionName = row.GetValue("DefinitionName");
            DisplayName    = row.GetValue("DisplayName");
            Description    = row.GetValue("Description");

            int result;

            if (int.TryParse(row.GetValue("isOE"), out result) && result > 0)
            {
                IsOE = true;
            }

            if (int.TryParse(row.GetValue("ProductRefer"), out result))
            {
                ProductRefer = result;
            }

            if (row.HasValue("invoice") && string.Compare(row["invoice"].ToString(), "Yes", true) == 0)
            {
                Invoice = true;
            }

            if (row.HasValue("cy_list_price"))
            {
                Price = Convert.ToDecimal(row["cy_list_price"]);
            }
            if (row.HasValue("cy_marketing_price"))
            {
                MarketingPrice = Convert.ToDecimal(row["cy_marketing_price"]);
            }

            Brand = row.GetValue("CP_Brand");
            Unit  = row.GetValue("CP_Unit");
            Place = row.GetValue("CP_Place");

            ProductCode  = row.GetValue("ProductCode");
            ProductColor = row.GetValue("ProductColor");
            ProductSize  = row.GetValue("ProductSize");

            if (row.HasValue("Onsale"))
            {
                Onsale = Convert.ToBoolean(row.GetValue("Onsale"));
            }
            else
            {
                Onsale = true;
            }
            Onsale = Onsale && (Price.GetValueOrDefault() > 0);

            if (row.HasValue("stockout"))
            {
                Stockout = Convert.ToBoolean(row.GetValue("stockout"));
            }

            Image = new ProductImageModel(row);
        }