Пример #1
0
        public int Order_API()
        {
            int    oid    = Convert.ToInt32(RequestEx["oid"]);
            string action = RequestEx["action"];
            int    result = Failed;
            //-----
            M_OrderList orderMod = orderBll.SelReturnModel(oid);

            if (mu.UserID != orderMod.Userid)
            {
                return(result);
            }
            switch (action)
            {
            case "del":
            {
                orderBll.DelByIDS_U(oid.ToString(), mu.UserID);
                orderBll.CancelOrder(orderMod);
                result = Success;
            }
            break;

            case "receive":
            {
                if (orderMod.Paymentstatus < (int)M_OrderList.PayEnum.HasPayed)
                {
                    break;
                }
                orderBll.UpdateByField("StateLogistics", "2", oid);
                if (DataConvert.CLng(orderMod.ExpressNum) > 0)
                {
                    B_Order_Exp expBll = new B_Order_Exp();
                    M_Order_Exp expMod = expBll.SelReturnModel(DataConvert.CLng(orderMod.ExpressNum));
                    if (expMod != null)
                    {
                        expMod.SignDate = DateTime.Now.ToString();
                        expBll.UpdateByID(expMod);
                    }
                }
                result = Success;
            }
            break;

            case "reconver":    //还原
            {
                orderBll.UpdateByField("Aside", "0", oid);
                result = Success;
            }
            break;

            case "realdel":    //彻底删除
            {
                orderBll.UpdateByField("Aside", "2", oid);
                result = Success;
            }
            break;

            default:
                break;
            }
            return(result);
        }