// GET: Web/OrderEvaluation
        public ActionResult Index(long id)
        {
            var model           = CommentApplication.GetProductEvaluationByOrderId(id, CurrentUser.Id);
            var orderEvaluation = TradeCommentApplication.GetOrderComment(id, CurrentUser.Id);

            if (orderEvaluation != null)
            {
                ViewBag.Mark = Math.Round((orderEvaluation.PackMark + orderEvaluation.ServiceMark + orderEvaluation.DeliveryMark) / 3D);
            }
            else
            {
                ViewBag.Mark = 0;
            }
            ViewBag.OrderId = id;
            //检查当前产品是否产自官方自营店
            ViewBag.IsSellerAdminProdcut = OrderApplication.GetOrder(id).ShopId.Equals(1L);
            ViewBag.Keyword  = string.IsNullOrWhiteSpace(SiteSettings.SearchKeyword) ? SiteSettings.Keyword : SiteSettings.SearchKeyword;
            ViewBag.Keywords = SiteSettings.HotKeyWords;
            var orderInfo = OrderApplication.GetOrder(id);

            if (orderInfo != null)
            {
                ViewBag.IsVirtual = orderInfo.OrderType == Himall.Entities.OrderInfo.OrderTypes.Virtual ? 1 : 0;
            }
            return(View(model));
        }
        public ActionResult Details(long orderId)
        {
            var orderComment = TradeCommentApplication.GetOrderComment(orderId, CurrentUser.Id);

            ViewBag.PackMark     = orderComment != null ? orderComment.PackMark - 1 : -1;
            ViewBag.DeliveryMark = orderComment != null ? orderComment.DeliveryMark - 1 : -1;
            ViewBag.ServiceMark  = orderComment != null ? orderComment.ServiceMark - 1 : -1;
            var model = CommentApplication.GetProductEvaluationByOrderIdNew(orderId, CurrentUser.Id);

            ViewBag.IsSellerAdminProdcut = OrderApplication.GetOrder(orderId).ShopId.Equals(1L);
            return(View(model));
        }
        // GET: Web/OrderEvaluation
        public ActionResult Index(long id)
        {
            var model           = CommentApplication.GetProductEvaluationByOrderId(id, CurrentUser.Id);
            var orderEvaluation = TradeCommentApplication.GetOrderComment(id, CurrentUser.Id);

            if (orderEvaluation != null)
            {
                ViewBag.Mark = Math.Round((orderEvaluation.PackMark + orderEvaluation.ServiceMark + orderEvaluation.DeliveryMark) / 3D);
            }
            else
            {
                ViewBag.Mark = 0;
            }
            ViewBag.OrderId = id;
            //检查当前产品是否产自官方自营店
            ViewBag.IsSellerAdminProdcut = OrderApplication.GetOrder(id).ShopId.Equals(1L);
            return(View(model));
        }
        public ActionResult Details(long orderId)
        {
            var orderComment = TradeCommentApplication.GetOrderComment(orderId, CurrentUser.Id);

            ViewBag.PackMark     = orderComment != null ? orderComment.PackMark - 1 : -1;
            ViewBag.DeliveryMark = orderComment != null ? orderComment.DeliveryMark - 1 : -1;
            ViewBag.ServiceMark  = orderComment != null ? orderComment.ServiceMark - 1 : -1;
            var  model     = CommentApplication.GetProductEvaluationByOrderIdNew(orderId, CurrentUser.Id);
            var  orderInfo = OrderApplication.GetOrder(orderId);
            bool isVirtual = false;

            if (orderInfo != null)
            {
                ViewBag.IsSellerAdminProdcut = orderInfo.ShopId.Equals(1L);
                isVirtual = orderInfo.OrderType == Entities.OrderInfo.OrderTypes.Virtual;
            }
            ViewBag.IsVirtual = isVirtual;
            ViewBag.Keyword   = string.IsNullOrWhiteSpace(SiteSettings.SearchKeyword) ? SiteSettings.Keyword : SiteSettings.SearchKeyword;
            ViewBag.Keywords  = SiteSettings.HotKeyWords;
            return(View(model));
        }
        // GET: Mobile/Comment
        public ActionResult Index(long orderId)
        {
            var order         = OrderApplication.GetOrder(orderId);
            var orderComments = OrderApplication.GetOrderCommentCount(new[] { orderId });

            bool valid = false;

            if (order != null && (!orderComments.ContainsKey(orderId) || orderComments[orderId] == 0))
            {
                // 订单还未被评价过,有效
                valid = true;
                var model           = CommentApplication.GetProductEvaluationByOrderId(orderId, CurrentUser.Id);
                var orderEvaluation = TradeCommentApplication.GetOrderComment(orderId, CurrentUser.Id);

                ViewBag.Products = model;
                var orderItems = OrderApplication.GetOrderItemsByOrderId(orderId);
                ViewBag.OrderItemIds = orderItems.Select(item => item.Id);
            }
            ViewBag.Valid = valid;

            return(View());
        }