コード例 #1
0
        public virtual List <JioSubSubCategory> GetJioSubSubCategories(JioSubCategory SubCategory)
        {
            var subCats = new List <JioSubSubCategory>();

            var lookupHierarchy = new MDMReferenceData.LookupHierarchicalValueRequest();

            lookupHierarchy.parentLookupValue         = new MDMReferenceData.LookUpValue();
            lookupHierarchy.parentLookupValue.lovType = JioConstants.SUBCATEGORYCONSTANT;
            lookupHierarchy.parentLookupValue.lovCode = SubCategory.SubCategoryCode;
            lookupHierarchy.lookupValue         = new MDMReferenceData.LookUpValue();
            lookupHierarchy.lookupValue.lovType = JioConstants.SUBSUBCATEGORYCONSTANT;

            var serviceClient = new MDMReferenceData.ReferenceDataInquiryV1dot2Client();
            var result        = serviceClient.lookupHierarchicalValue(lookupHierarchy);

            foreach (var item in result.valueList)
            {
                subCats.Add(new JioSubSubCategory()
                {
                    Name = item.lovName,
                    SubSubCategoryCode = item.lovCode,
                    Description        = item.lovDesc
                });
            }

            return(subCats);
        }
コード例 #2
0
        public List <JioSubSubCategory> GetJioSubSubCategories(JioSubCategory SubCategory)
        {
            if (Constants.Constants.DEBUG)
            {
                string text = File.ReadAllText("subsubcategories.json");
                return(RestSharp.SimpleJson.DeserializeObject <List <JioSubSubCategory> >(text));
            }
            else
            {
                var subCats = new List <JioSubSubCategory>();

                var lookupHierarchy = new MDMReferenceData.LookupHierarchicalValueRequest();
                lookupHierarchy.parentLookupValue         = new MDMReferenceData.LookUpValue();
                lookupHierarchy.parentLookupValue.lovType = "CUSTOMERPROBLEMSUBCATG";
                lookupHierarchy.parentLookupValue.lovCode = SubCategory.SubCategoryCode;
                lookupHierarchy.lookupValue         = new MDMReferenceData.LookUpValue();
                lookupHierarchy.lookupValue.lovType = "CUSTOMERPROBLEMSUB_SUBCATG";

                var serviceClient = new MDMReferenceData.ReferenceDataInquiryV1dot2Client();
                var result        = serviceClient.lookupHierarchicalValue(lookupHierarchy);

                foreach (var item in result.valueList)
                {
                    subCats.Add(new JioSubSubCategory()
                    {
                        Name = item.lovName,
                        SubSubCategoryCode = item.lovCode,
                        Description        = item.lovDesc
                    });
                }


                //var ssubCats = RestSharp.SimpleJson.SerializeObject(subCats);
                //File.WriteAllText("subsubcategories.json", ssubCats);

                return(subCats);
            }
        }