예제 #1
0
        public ActionResult AutoLoad(int p_lastIndex, int p_itemStatus)
        {
            decimal p_begin = SessionData.TotalRecord + 1;
            decimal p_end   = CommonSystem.defaultEnd * p_lastIndex;
            var     _lst    = new List <ItemInfo>();

            try
            {
                _lst = ItemBL.ItemLoad(p_itemStatus, p_begin, p_end);
                if (_lst.Count() == 0)
                {
                    p_lastIndex = 0;
                }
                SessionData.TotalRecord = p_end;
            }
            catch (Exception ex)
            {
            }
            return(Json(new
            {
                success = -2,
                _lastpage = p_lastIndex,
                _html = RenderViewHelper.RenderRazorViewToString("~/Views/Home/_ItemList.cshtml", _lst, this.ViewData, this.ControllerContext, this.TempData)
            }));
        }
예제 #2
0
        public ActionResult  ItemInCart()
        {
            var lstItems = new List <ItemInfo>();

            try
            {
                lstItems = ItemBL.ItemLoad(Convert.ToInt32(ItemStatus.InCart), CommonSystem.defaultBegin, CommonSystem.defaultEnd);
                SessionData.TotalRecord = CommonSystem.defaultEnd;
                SessionData.CurrentSession.TotalItemInCart = ItemBL.ItemInCartCount();
            }
            catch (Exception ex)
            {
            }
            return(View(lstItems));
        }
예제 #3
0
        public ActionResult Index()
        {
            if (SessionData.CurrentSession == null)
            {
                SessionData.CurrentSession             = new SessionInfo();
                SessionData.CurrentSession.ListItemAdd = new List <decimal>();
            }
            var lstItems = new List <ItemInfo>();

            try
            {
                lstItems = ItemBL.ItemLoad(Convert.ToInt32(ItemStatus.Normal), CommonSystem.defaultBegin, CommonSystem.defaultEnd);
                SessionData.TotalRecord = CommonSystem.defaultEnd;
                SessionData.CurrentSession.ListItemAdd = ItemBL.ItemIdInCart().Select(d => d.Item_Id).ToList();
            }
            catch (Exception ex)
            {
            }
            return(View(lstItems));
        }