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); }
public virtual List <JioCategory> GetJioCategories() { List <JioCategory> cats = new List <JioCategory>(); var lookupVal = new MDMReferenceData.LookUpValue(); lookupVal.lovType = JioConstants.CATEGORYCONSTANT; var req = new MDMReferenceData.LookupValueRequest(); req.lookupValue = lookupVal; var client = new MDMReferenceData.ReferenceDataInquiryV1dot2Client(); var response = client.lookupValue(req); var total = response.dataRecord.totalRecords; var pageSize = response.dataRecord.pagingSize; foreach (var item in response.valueList) { cats.Add(new JioCategory() { Name = item.lovName, CategoryCode = item.lovCode, Description = item.lovDesc }); } return(cats); }
public List <JioCategory> GetJioCategories() { if (Constants.Constants.DEBUG) { string text = File.ReadAllText("categories.json"); return(RestSharp.SimpleJson.DeserializeObject <List <JioCategory> >(text)); } else { List <JioCategory> cats = new List <JioCategory>(); var lookupVal = new MDMReferenceData.LookUpValue(); lookupVal.lovType = "CUSTOMERPROBLEMCATG"; var req = new MDMReferenceData.LookupValueRequest(); req.lookupValue = lookupVal; var client = new MDMReferenceData.ReferenceDataInquiryV1dot2Client(); var response = client.lookupValue(req); var total = response.dataRecord.totalRecords; var pageSize = response.dataRecord.pagingSize; foreach (var item in response.valueList) { cats.Add(new JioCategory() { Name = item.lovName, CategoryCode = item.lovCode, Description = item.lovDesc }); } //var sCats = RestSharp.SimpleJson.SerializeObject(cats); //File.WriteAllText("categories.json", sCats); return(cats); } }
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); } }