public static List <ProductModel> GetSortedProducts(string SortOrder, int PageIndex, long?ProductCatId) { var GetSortedProductList = new List <ProductModel>(); ProductModel objmodel = new ProductModel(); objmodel.Sortby = SortOrder; objmodel.PageIndex = PageIndex; if (ProductCatId != null) { objmodel.ProductCatId = Convert.ToInt64(ProductCatId); } //objmodel.ProductCatId = ProductCatId; var _request = JsonConvert.SerializeObject(objmodel); ResponseModel objresponse; if (SortOrder == "Popularity") { objresponse = CommonFile.GetApiResponse(Constant.ApiGetPopularProductId, _request); GetSortedProductList = JsonConvert.DeserializeObject <List <ProductModel> >(objresponse.Response); return(GetSortedProductList); } ResponseModel ObjResponse = CommonFile.GetApiResponse(Constant.ApiGetSortedProducts, _request); GetSortedProductList = JsonConvert.DeserializeObject <List <ProductModel> >(ObjResponse.Response); return(GetSortedProductList); }
public static List <DropDownModel> GetProfessionalKeyword() { var ProfessionalKeywordList = new List <DropDownModel>(); DropDownModel objUserProfile = new DropDownModel(); var _request = JsonConvert.SerializeObject(objUserProfile); ResponseModel objResponse = CommonFile.GetApiResponse(Constant.ApiGetProfessionalKeyword, _request); ProfessionalKeywordList = JsonConvert.DeserializeObject <List <DropDownModel> >(objResponse.Response); return(ProfessionalKeywordList); }
public static List <ProductModel> GetChildCategory(int id) { var Categories = new List <ProductModel>(); ProductModel objmodel = new ProductModel(); objmodel.ProductCatId = id; var _request = JsonConvert.SerializeObject(objmodel); ResponseModel objResponse = CommonFile.GetApiResponse(Constant.ApiGetChildCategory, _request); Categories = JsonConvert.DeserializeObject <List <ProductModel> >(objResponse.Response); return(Categories); }
public static List <ProductModel> GetPopularProduct(long Catid) { var GetPopularProductList = new List <ProductModel>(); ProductModel objmodel = new ProductModel(); objmodel.ProductCatId = Catid; var _request = JsonConvert.SerializeObject(objmodel); ResponseModel ObjResponse = CommonFile.GetApiResponse(Constant.ApiGetPopularProductId, _request); GetPopularProductList = JsonConvert.DeserializeObject <List <ProductModel> >(ObjResponse.Response); return(GetPopularProductList); }
public static bool IsParentCategory(long?id) { ProductModel ObjModel = new ProductModel(); ObjModel.ProductCatId = id; var _request = JsonConvert.SerializeObject(ObjModel); ResponseModel ObjResponse = CommonFile.GetApiResponse(Constant.ApiIsParentCategory, _request); ResponseModel ObjResponse2 = JsonConvert.DeserializeObject <ResponseModel>(ObjResponse.Response); if (ObjResponse2.Response == "Exist") { return(true); } else { return(false); } }
public static List <DropDownModel> GetProductCategory(long?ParentId) { var ProductCategoryList = new List <DropDownModel>(); DropDownModel objDropdown = new DropDownModel(); if (ParentId != null) { objDropdown.ParentCatId = ParentId; } var _request = JsonConvert.SerializeObject(objDropdown); ResponseModel ObjResponse = CommonFile.GetApiResponse(Constant.ApiGetProductCategory, _request); ProductCategoryList = JsonConvert.DeserializeObject <List <DropDownModel> >(ObjResponse.Response); //// var _request = JsonConvert.SerializeObject(objUserProfile); //ResponseModel ObjResponse = CommonFile.GetApiResponse(Constant.ApiGetProductCategory, ""); //ProductCategoryList = JsonConvert.DeserializeObject<List<DropDownModel>>(ObjResponse.Response); return(ProductCategoryList); }