コード例 #1
0
        public string GetItemBaseData(string pRequest)
        {
            var rp = pRequest.DeserializeJSONTo <APIRequest <GetItemBaseDataRP> >();
            var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo;
            var rd = new GetItemBaseDataRD();//返回值
            /// Prop_Type属性类型 1=组,2=属性,3=属性明细';
            var propService = new JIT.CPOS.BS.BLL.PropService(loggingSessionInfo);
            var ItemDomain  = "ITEM";
            var grouplist   = propService.GetPropListFirstByDomain(ItemDomain);//获取商品属性组

            foreach (var group in grouplist)
            {
                var propList = propService.GetPropListByParentId(ItemDomain, group.Prop_Id);//获取属性
                //Prop_Default_Value,每个属性上有默认的属性值
                foreach (var prop in propList)
                {
                    var propDetailList = propService.GetPropListByParentId(ItemDomain, prop.Prop_Id);//获取属性明细 (即属性的选项值)
                    prop.Children = propDetailList;
                }

                if (propList == null)
                {
                    throw new APIException(string.Format("{0}不允许为null", "ItemNewHandler.GetItemBaseData.group.Children"))
                          {
                              ErrorCode = ERROR_CODES.INVALID_REQUEST_CAN_NOT_FIND_ACTION_HANDLER
                          };
                }

                group.Children = propList;
            }
            rd.ItemPropGroupList = grouplist;
            //sku部分
            var SKUDomain      = "SKU";
            var skuPropService = new JIT.CPOS.BS.BLL.SkuPropServer(loggingSessionInfo);
            var skuList        = skuPropService.GetSkuPropList();//获取了所有的规格(T_SKU_PROPerty a  和  T_Prop关联有数据的),T_SKU_PROPerty只存T_Prop表里prop_type为2(即属性级别的)并且domain为sku的

            foreach (var sku in skuList)
            {
                sku.Children = propService.GetPropListByParentId(SKUDomain, sku.prop_id);//sku的明细项
            }
            rd.SKUPropList = skuList;

            //获取价格类型
            var priceTypeService = new JIT.CPOS.BS.BLL.ItemPriceTypeService(loggingSessionInfo);
            var priceTypeList    = priceTypeService.GetItemPriceTypeList();

            rd.ItemPriceTypeList = priceTypeList;

            var rsp = new SuccessResponse <IAPIResponseData>(rd);

            return(rsp.ToJSON());
        }
コード例 #2
0
        private void LoadSkuProp()
        {
            CustomerBasicSettingBLL customerBasicSettingBLL = new CustomerBasicSettingBLL(CurrentUserInfo);

            SKUExist = customerBasicSettingBLL.CheckSKUExist();

            var skuPropService = new JIT.CPOS.BS.BLL.SkuPropServer(CurrentUserInfo);
            var source         = skuPropService.GetSkuPropList();

            SkuProInfos = source;

            //价格类型集合(jifeng.cao 20140221)
            var itemPriceTypeService = new JIT.CPOS.BS.BLL.ItemPriceTypeService(CurrentUserInfo);
            var list = itemPriceTypeService.GetItemPriceTypeList();

            ItemPriceTypeInfos = list;
        }