private void FillShoppingCartSpecialData() { try { FacadeManager facade = new FacadeManager(); List <IShoppingCart> sCart = new List <IShoppingCart>(); sCart = facade.GetShoppingCart(sessionid, ItemTypeEnum.SPECIAL, UserType.ADMIN); if (sCart.Count > 0) { gvShoppingSpecial.DataSource = sCart; gvShoppingSpecial.DataBind(); } else { sCart.Add(new ShoppingCartManager()); gvShoppingSpecial.DataSource = sCart; gvShoppingSpecial.DataBind(); int colCount = gvShoppingSpecial.Columns.Count; gvShoppingSpecial.Rows[0].Cells.Clear(); gvShoppingSpecial.Rows[0].Cells.Add(new TableCell()); gvShoppingSpecial.Rows[0].Cells[0].ColumnSpan = colCount; gvShoppingSpecial.Rows[0].Cells[0].Text = gvShoppingSpecial.EmptyDataText; } } catch (Exception ex) { } }
private void FillShoppingCartStandardData() { try { FacadeManager facade = new FacadeManager(); List <IShoppingCart> itemList = null; if ((UserType)ViewState[userType] == UserType.ANONYMOUS) { itemList = facade.GetShoppingCart(sessionid, ItemTypeEnum.STANDARD, UserType.ANONYMOUS); } if ((UserType)ViewState[userType] == UserType.REGISTERED) { itemList = facade.GetShoppingCart(sessionid, ItemTypeEnum.STANDARD, UserType.REGISTERED); } if ((UserType)ViewState[userType] == UserType.ADMIN) { itemList = facade.GetShoppingCart(sessionid, ItemTypeEnum.STANDARD, UserType.ADMIN); } gvSpCart.DataSource = itemList; gvSpCart.DataBind(); ManageAuthorizedFields(); if (itemList.Count > 0 && ViewState["OrderID"] == null) { ViewState["OrderID"] = itemList[0].OrderID; if (Session["orderid"] == null) { Session.Add("orderid", itemList[0].OrderID); } } PopulateOrderDetail(); } catch (Exception ex) { } }