public static String SearchProductByPagination(int index, String value) { DataTable dt = new DataTable(); ProductDAL dal = new ProductDAL(); dt = dal.SearchProductByPagination(index, AppConstants.PRODUCT_PAGE_SIZE, value); return getProductJsonIncludePage(dt, index); }
public static String SingleProduct(String value) { DataTable dt = new DataTable(); ProductDAL dal = new ProductDAL(); dt = dal.GetProduct(value); return getProductJsonIncludePage(dt,0); }
public static String RandomProduct() { DataTable dt = new DataTable(); ProductDAL dal = new ProductDAL(); dt = dal.GetRandomProduct(); return getProductJsonIncludePage(dt, 0); }
public void updateProducts(MyCategory category) { FlipkartProductModel exm = JsonConvert.DeserializeObject<FlipkartProductModel>(HttpGet(category.availableVariants.version.get)); ProductModel prdModel = new ProductModel(); ProductDAL dal = new ProductDAL(); while (exm.nextUrl != null) { foreach (ProductInfoList item in exm.productInfoList) { ProductAttributes att = new ProductAttributes(); ProductIdentifier idt = new ProductIdentifier(); att = item.productBaseInfo.productAttributes; idt = item.productBaseInfo.productIdentifier; prdModel.UniqueId = Guid.NewGuid().ToString().Substring(0, 8); prdModel.PrdId = idt.productId; prdModel.Name = att.title; if (att.productDescription == null) { att.productDescription = FlipkartConstants.INVALID_DESCRIPTION; } prdModel.Description = att.productDescription; prdModel.PrdUrl = att.productUrl; prdModel.PrdRedirectUrl = att.productUrl; if (att.imageUrls._275x275 == null) { att.imageUrls._275x275 = FlipkartConstants.DEFAULT_IMAGE; } prdModel.Img = att.imageUrls._275x275; prdModel.Width = FlipkartConstants.DEFAULT_IMAGE_WIDTH_AND_HEIGHT_275PX; prdModel.Height = FlipkartConstants.DEFAULT_IMAGE_WIDTH_AND_HEIGHT_275PX; prdModel.Storeid = FlipkartConstants.FLIPKART_STORE_ID_FOKATDEALS; prdModel.RegularPrice = att.maximumRetailPrice.amount + " Rs."; prdModel.OfferPrice = att.sellingPrice.amount + " Rs."; prdModel.SubCatId = category.apiName; prdModel.CreatedOn = System.DateTime.Now + ""; prdModel.ExpireOn = ""; String status = ""; if (att.inStock) { status = "A"; } else { status = "D"; } prdModel.Status = status; prdModel.Custom1 = att.productBrand; prdModel.Custom2 = att.codAvailable + ""; int i = dal.InsertProducts(prdModel); } exm = JsonConvert.DeserializeObject<FlipkartProductModel>(HttpGet(exm.nextUrl)); } }
public static String GetSubCategory(String baseCategory) { SubCategoryModel obj = new SubCategoryModel(); DataTable dt = new DataTable(); ProductDAL dal = new ProductDAL(); List<SubCategoryModel> details = new List<SubCategoryModel>(); dt = dal.GetChildCategory(baseCategory); if (dt != null) { foreach (DataRow dtrow in dt.Rows) { obj = new SubCategoryModel(); obj.CatId = dtrow["subcatid"].ToString(); obj.CatName = dtrow["subcatname"].ToString(); obj.CatDesc = dtrow["subcatdesc"].ToString(); obj.CatImages = dtrow["subcatimage"].ToString(); obj.CatTagList = dtrow["subcattaglist"].ToString(); obj.Status = dtrow["subcatstatus"].ToString(); obj.CatHotStatus = dtrow["subcathotstatus"].ToString(); obj.CatAlias = dtrow["scatAlias"].ToString(); obj.ParentCatId = dtrow["catid"].ToString(); obj.CatUrl = Properties.Settings.Default.Domain + "/!/" + dtrow["scatAlias"].ToString(); obj.errorCode = (int)Errors.CategorySuccess; obj.errorMessage = "Successfully Retrival"; details.Add(obj); } } else { obj.errorCode = (int)Errors.CategoryError; obj.errorMessage = "Error while Retrival"; } JavaScriptSerializer ser = new JavaScriptSerializer(); return ser.Serialize(details); }
public static String GetUserWishList(int index) { DataTable dt = new DataTable(); ProductDAL dal = new ProductDAL(); dt = dal.GetUserWishList(index, AppConstants.PRODUCT_PAGE_SIZE, HttpContext.Current.Session[AppConstants.SESSION_USER_ID].ToString()); return getProductJsonIncludePage(dt, index); }
public static String RemoveFromWishList(String prdid) { WishList wl = new WishList(); ProductDAL dal = new ProductDAL(); int i = dal.DeleteWishList(prdid, HttpContext.Current.Session[AppConstants.SESSION_USER_ID].ToString()); return ""; }