예제 #1
0
        public ActionResult DoCancel(int orderId)
        {
            MemberModel    member  = this.getAuthMember();
            DataBiz        dataBiz = DataBiz.GetInstant();
            OrderModel     order   = BaseZdBiz.Load <OrderModel>(orderId);
            JsResultObject re      = dataBiz.cancelOrder(order, "", "");

            this.SetResult(re, true);
            IList <OrderModel> orders = BaseZdBiz.List <OrderModel>(Restrictions.Eq("memberFk", member.id));

            ViewData[typeof(OrderModel).Name] = orders;
            return(View("Index"));
        }
예제 #2
0
        public ActionResult DoCancelOrder(int cancelOrderId, string cancelCode, string cancelReason)
        {
            DataBiz        dataBiz = DataBiz.GetInstant();
            OrderModel     order   = BaseZdBiz.Load <OrderModel>(cancelOrderId);
            JsResultObject re      = new JsResultObject();

            if (StringUtil.IsIn(order.orderStatus, new string[] { OrderModel.ORDER_STATUS_COMMENTED, OrderModel.ORDER_STATUS_DEAL }))
            {
                re.code = JsResultObject.CODE_ERROR;
                re.msg  = string.Format("订单{0} 状态为 {1},不能取消"
                                        , order.id
                                        , OrderModel.GetDictOrderStatus()[order.orderStatus]
                                        );
            }
            else
            {
                re = dataBiz.cancelOrder(order, cancelCode, cancelReason);
            }
            return(JsonText(re, JsonRequestBehavior.AllowGet));
        }