/// <summary>
 /// Deprecated Method for adding a new object to the v_jewel_items EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTov_jewel_items(v_jewel_items v_jewel_items)
 {
     base.AddObject("v_jewel_items", v_jewel_items);
 }
Esempio n. 2
0
        protected Jewel JewelClassFactory(v_jewel_items item)
        {
            var initObj = new ItemInitializerParameterObject
                              {
                ID = item.id,
                ItemNumber = item.ITEMNUMBER,
                CategoryID = item.CATEGORY_ID,
                SubCategoryID = item.SUBCATEGORY_ID,
                JewelryCategory = item.jeweltype,
                JewelryCategoryID = item.JEWELTYPE_ID,
                JewelrySubCategory = item.jewelsubtype,
                JewelrySubCategoryID = item.JEWELSUBTYPE_ID,
                SpecialPrice = item.SPECIAL_SELL_PRICE ?? 0,
                DealerPrice = item.DEALER_PRICE ?? 0,
                OnSpecial = item.ONSPECIAL ?? false,
                RegularPrice = item.price ?? 0,
                Metal = item.metal,
                Title = item.jeweltitle,
                OnBargain = item.ONBARGAIN ?? false
            };

            var initJewelExtra = new JewelryExtraInitializerParameterObject
                                     {
                                         CS_Clarity = item.clarity,
                                         CS_ClarityFreeText = item.clarity_freetxt,
                                         CS_Color = item.color,
                                         CS_ColorFreeText = item.color_freetxt,
                                         CS_Count = item.cs_count ?? 0,
                                         CS_Cut = item.cs_cut,
                                         CS_Description = item.cs_desc,
                                         CS_Type = item.cs_type,
                                         HasSideStones = item.has_sidestones ?? false,
                                         SS_Clarity = item.ss_clarity,
                                         SS_ClarityFreeText = "",
                                         SS_Color = item.ss_color,
                                         SS_ColorFreeText = "",
                                         SS_Count = item.ss_count ?? 0,
                                         SS_Cut = item.ss_cut,
                                         SS_Description = item.ss_desc,
                                         SS_Type = item.ss_type,
                                         TotalWeight = Convert.ToDouble(item.total_weight ?? 0),
                                         CS_Weight = Convert.ToDouble(item.cs_weight ?? 0),
                                         SS_Weight = Convert.ToDouble(item.ss_weight ?? 0)
                                     };

            var jewelryExtra = new JewelryExtra(initJewelExtra, initObj);

            initObj.Weight = Convert.ToDouble(item.WEIGHT);

            double tryParseJewelWidth;
            initObj.Width = double.TryParse(item.ITEM_SIZE.Trim(), out tryParseJewelWidth) ? tryParseJewelWidth : 0;

            initObj.Price = DecideWhichPriceToUseAsCurrent(initObj);

            var currrentJewelMediaType = WhichMediaDoesThisJewelHas(item.HAS_YELLOW_GOLD ?? false, item.HAS_WHITE_GOLD ?? false);

            var metal = new Metal(requestedJewelMediaTypeByUser, currrentJewelMediaType,item.metal);

            var mediaFactory = new MediaFactory(initObj.ItemNumber, settingManager);

            mediaFactory.ChangeMediaSet(requestedJewelMediaTypeByUser, currrentJewelMediaType);

            var media = mediaFactory.BuildMedia();

            var jewel = new Jewel(initObj, media, metal, jewelryExtra, currrentJewelMediaType);
            return jewel;
        }
 /// <summary>
 /// Create a new v_jewel_items object.
 /// </summary>
 /// <param name="id">Initial value of the id property.</param>
 /// <param name="jEWELTYPE_ID">Initial value of the JEWELTYPE_ID property.</param>
 /// <param name="jEWELSUBTYPE_ID">Initial value of the JEWELSUBTYPE_ID property.</param>
 /// <param name="cATEGORY_ID">Initial value of the CATEGORY_ID property.</param>
 /// <param name="sUBCATEGORY_ID">Initial value of the SUBCATEGORY_ID property.</param>
 public static v_jewel_items Createv_jewel_items(global::System.Int32 id, global::System.Int32 jEWELTYPE_ID, global::System.Int32 jEWELSUBTYPE_ID, global::System.Int32 cATEGORY_ID, global::System.Int32 sUBCATEGORY_ID)
 {
     v_jewel_items v_jewel_items = new v_jewel_items();
     v_jewel_items.id = id;
     v_jewel_items.JEWELTYPE_ID = jEWELTYPE_ID;
     v_jewel_items.JEWELSUBTYPE_ID = jEWELSUBTYPE_ID;
     v_jewel_items.CATEGORY_ID = cATEGORY_ID;
     v_jewel_items.SUBCATEGORY_ID = sUBCATEGORY_ID;
     return v_jewel_items;
 }