Beispiel #1
0
        /// <summary>
        /// 确认收货
        /// </summary>
        public void Received()
        {
            int id  = RequestTool.RequestInt("id", 0);
            int tid = RequestTool.RequestInt("tid", 0);
            Lebi_Transport_Order torder = B_Lebi_Transport_Order.GetModel("User_id=" + CurrentUser.id + " and id = " + tid);

            if (torder == null)
            {
                Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}");
                return;
            }
            if (torder.Type_id_TransportOrderStatus != 220)
            {
                Response.Write("{\"msg\":\"" + Tag("当前状态不可收货") + "\"}");
                return;
            }
            if (torder.User_id != CurrentUser.id)
            {
                Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}");
                return;
            }
            torder.Type_id_TransportOrderStatus = 223;
            torder.Time_Received = System.DateTime.Now;
            B_Lebi_Transport_Order.Update(torder);
            EX_Area.UpdateShouHuoCount(torder);
            //发送短信
            SMS.SendSMS_orderrecive(CurrentUser, torder);
            Response.Write("{\"msg\":\"OK\"}");
        }
Beispiel #2
0
        /// <summary>
        /// 退货单发货
        /// </summary>
        public void torder_shipping()
        {
            int        order_id = RequestTool.RequestInt("order_id", 0);
            Lebi_Order model    = B_Lebi_Order.GetModel("User_id=" + CurrentUser.id + " and id = " + order_id);

            if (model == null)
            {
                Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}");
                return;
            }
            if (model.IsVerified != 1)
            {
                Response.Write("{\"msg\":\"" + Tag("请等待客服人员确认") + "\"}");
                return;
            }
            Lebi_Transport_Order torder = B_Lebi_Transport_Order.GetModel("Order_id=" + model.id + "");

            if (torder != null)
            {
                torder.Code           = RequestTool.RequestSafeString("Code");
                torder.Transport_Name = RequestTool.RequestSafeString("Transport_Name");
                B_Lebi_Transport_Order.Update(torder);
            }
            else
            {
                Lebi_Supplier supplier = B_Lebi_Supplier.GetModel(model.Supplier_id);
                if (supplier == null)
                {
                    supplier = new Lebi_Supplier();
                }
                torder          = new Lebi_Transport_Order();
                torder.Code     = RequestTool.RequestSafeString("Code");
                torder.Order_id = model.id;

                torder.T_Address     = model.T_Address;
                torder.T_Email       = model.T_Email;
                torder.T_MobilePhone = model.T_MobilePhone;
                torder.T_Name        = model.T_Name;
                torder.T_Phone       = model.T_Phone;
                //torder.Transport_Code = model.Transport_Code;
                //torder.Transport_id = model.Transport_id;
                torder.Transport_Name   = RequestTool.RequestSafeString("Transport_Name");
                torder.User_id          = model.User_id;
                torder.Supplier_id      = supplier.id;
                torder.Supplier_SubName = supplier.SubName;
                List <TransportProduct>   tps = new List <TransportProduct>();
                TransportProduct          tp;
                List <Lebi_Order_Product> pros = B_Lebi_Order_Product.GetList("Order_id=" + model.id + "", "");

                foreach (Lebi_Order_Product pro in pros)
                {
                    tp                = new TransportProduct();
                    tp.Count          = pro.Count;
                    tp.ImageBig       = pro.ImageBig;
                    tp.ImageMedium    = pro.ImageMedium;
                    tp.ImageOriginal  = pro.ImageOriginal;
                    tp.ImageSmall     = pro.ImageSmall;
                    tp.Product_Number = pro.Product_Number;
                    tp.Product_id     = pro.Product_id;
                    tp.Product_Name   = pro.Product_Name;
                    tps.Add(tp);

                    pro.Count_Shipped = pro.Count;

                    B_Lebi_Order_Product.Update(pro);
                }

                JavaScriptSerializer jss = new JavaScriptSerializer();
                torder.Product = jss.Serialize(tps);
                torder.Type_id_TransportOrderStatus = 220;//默认状态:在途
                B_Lebi_Transport_Order.Add(torder);
                model.IsShipped     = 1;
                model.IsShipped_All = 1;

                B_Lebi_Order.Update(model);
            }
            Response.Write("{\"msg\":\"OK\"}");
        }