public void Save() { if (listItem.Count > 0) { ObjectCookies <List <CartItem> > .SetValue(cKey, listItem); } else { ObjectCookies <List <CartItem> > .Remove(cKey); } }
public Cart(string service_name) { cKey += service_name; if (ObjectCookies <List <CartItem> > .Exists(cKey)) { listItem = ObjectCookies <List <CartItem> > .GetValue(cKey); } if (listItem == null) { listItem = new List <CartItem>(); } }