public static void EnQueue(int productId) { System.Collections.Generic.IList <int> list = BrowsedProductQueue.GetBrowedProductList(); int num = 0; foreach (int current in list) { if (productId == current) { list.RemoveAt(num); break; } num++; } if (list.Count <= 20) { list.Add(productId); } else { list.RemoveAt(0); list.Add(productId); } BrowsedProductQueue.SaveCookie(list); }
public static void EnQueue(int productId) { IList <int> list = BrowsedProductQueue.GetBrowedProductList(); int num = 0; foreach (int item in list) { if (productId == item) { list.RemoveAt(num); break; } num++; } if (list.Count <= 20) { list.Add(productId); } else { list.RemoveAt(0); list.Add(productId); } BrowsedProductQueue.SaveCookie(list); }
public static void ClearQueue() { BrowsedProductQueue.SaveCookie(null); }