示例#1
0
        public ActionResult List(int type)
        {
            ViewBag.Title = type == 0 ? "未完成订单" : (type == 1 ? "已完成订单" : "全部订单");

            if (System.Web.HttpContext.Current.Session["member"] == null)
            {
                LogHelper.Log.Write("Order List: member session is null");
            }
            else
            {
                LogHelper.Log.Write("session member:" + System.Web.HttpContext.Current.Session["member"].ToString());
            }
            Member member = _memberBLL.GetMemberByOpenId(System.Web.HttpContext.Current.Session["member"].ToString());

            // 临时的订单列表
            List <Order> orderList = new List <Order>();

            // 要提交的 OrderModel 列表
            List <OrderModel> omList = new List <OrderModel>();

            if (type != 2)
            {
                orderList = _orderBLL.GetOrdersByStatus(member.Id, type).ToList();
                omList    = CreateOrderModelList(orderList);
            }
            else
            {
                orderList = _orderBLL.GetAllOrders(member.Id).ToList();
                omList    = CreateOrderModelList(orderList);
            }

            ViewData["OrderList"] = omList;
            return(View());
        }