Пример #1
0
 public ActionResult CancelOrder(FormCollection Fm)
 {
     Maticsoft.BLL.Shop.Order.Orders orders = new Maticsoft.BLL.Shop.Order.Orders();
     long orderId = Globals.SafeLong(Fm["OrderId"], (long) 0L);
     OrderInfo model = orders.GetModel(orderId);
     if (((model != null) && (model.BuyerID == base.currentUser.UserID)) && OrderManage.CancelOrder(model, base.currentUser))
     {
         return base.Content("True");
     }
     return base.Content("False");
 }
Пример #2
0
        public static string GetOrderType(string paymentGateway, int orderStatus, int paymentStatus, int shippingStatus)
        {
            Maticsoft.BLL.Shop.Order.Orders orders = new Maticsoft.BLL.Shop.Order.Orders();
            switch (orders.GetOrderType(paymentGateway, orderStatus, paymentStatus, shippingStatus))
            {
                case Maticsoft.Model.Shop.Order.EnumHelper.OrderMainStatus.Paying:
                    return "等待付款";

                case Maticsoft.Model.Shop.Order.EnumHelper.OrderMainStatus.PreHandle:
                    return "等待处理";

                case Maticsoft.Model.Shop.Order.EnumHelper.OrderMainStatus.Cancel:
                    return "取消订单";

                case Maticsoft.Model.Shop.Order.EnumHelper.OrderMainStatus.Locking:
                    return "订单锁定";

                case Maticsoft.Model.Shop.Order.EnumHelper.OrderMainStatus.PreConfirm:
                    return "等待付款确认";

                case Maticsoft.Model.Shop.Order.EnumHelper.OrderMainStatus.Handling:
                    return "正在处理";

                case Maticsoft.Model.Shop.Order.EnumHelper.OrderMainStatus.Shipping:
                    return "配货中";

                case Maticsoft.Model.Shop.Order.EnumHelper.OrderMainStatus.Shiped:
                    return "已发货";

                case Maticsoft.Model.Shop.Order.EnumHelper.OrderMainStatus.Complete:
                    return "已完成";
            }
            return "未知状态";
        }
Пример #3
0
 public PartialViewResult OrderList(int pageIndex = 1, string viewName = "_OrderList")
 {
     Maticsoft.BLL.Shop.Order.Orders orders = new Maticsoft.BLL.Shop.Order.Orders();
     Maticsoft.BLL.Shop.Order.OrderItems items = new Maticsoft.BLL.Shop.Order.OrderItems();
     int pageSize = 8;
     int startIndex = (pageIndex > 1) ? (((pageIndex - 1) * pageSize) + 1) : 0;
     int endIndex = pageIndex * pageSize;
     int totalItemCount = 0;
     totalItemCount = orders.GetRecordCount(" BuyerID=" + base.CurrentUser.UserID);
     if (totalItemCount < 1)
     {
         return base.PartialView(viewName);
     }
     List<OrderInfo> list = orders.GetListByPageEX("BuyerID=" + base.CurrentUser.UserID, "", startIndex, endIndex);
     if ((list != null) && (list.Count > 0))
     {
         foreach (OrderInfo info in list)
         {
             info.OrderItems = items.GetModelList(" OrderId=" + info.OrderId);
         }
     }
     PagedList<OrderInfo> model = new PagedList<OrderInfo>(list, pageIndex, pageSize, totalItemCount);
     if (base.Request.IsAjaxRequest())
     {
         return this.PartialView(viewName, model);
     }
     return this.PartialView(viewName, model);
 }
Пример #4
0
 public PartialViewResult OrderList(int pageIndex = 1, string viewName = "_OrderList")
 {
     Action<Maticsoft.Model.Shop.Order.OrderInfo> action = null;
     Maticsoft.BLL.Shop.Order.Orders orders = new Maticsoft.BLL.Shop.Order.Orders();
     Maticsoft.BLL.Shop.Order.OrderItems itemBll = new Maticsoft.BLL.Shop.Order.OrderItems();
     int pageSize = 10;
     int startIndex = (pageIndex > 1) ? (((pageIndex - 1) * pageSize) + 1) : 0;
     int endIndex = pageIndex * pageSize;
     int totalItemCount = 0;
     string strWhere = " BuyerID=" + base.CurrentUser.UserID + " AND OrderType=1";
     totalItemCount = orders.GetRecordCount(strWhere);
     if (totalItemCount < 1)
     {
         return base.PartialView(viewName);
     }
     List<Maticsoft.Model.Shop.Order.OrderInfo> items = orders.GetListByPageEX(strWhere, "", startIndex, endIndex);
     if ((items != null) && (items.Count > 0))
     {
         foreach (Maticsoft.Model.Shop.Order.OrderInfo info in items)
         {
             if (info.HasChildren && (info.PaymentStatus > 1))
             {
                 info.SubOrders = orders.GetModelList(" ParentOrderId=" + info.OrderId);
                 if (action == null)
                 {
                     action = delegate (Maticsoft.Model.Shop.Order.OrderInfo info) {
                         info.OrderItems = itemBll.GetModelList(" OrderId=" + info.OrderId);
                     };
                 }
                 info.SubOrders.ForEach(action);
                 continue;
             }
             info.OrderItems = itemBll.GetModelList(" OrderId=" + info.OrderId);
         }
     }
     PagedList<Maticsoft.Model.Shop.Order.OrderInfo> model = new PagedList<Maticsoft.Model.Shop.Order.OrderInfo>(items, pageIndex, pageSize, totalItemCount);
     if (base.Request.IsAjaxRequest())
     {
         return this.PartialView(viewName, model);
     }
     return this.PartialView(viewName, model);
 }