Beispiel #1
0
        /// <summary>
        /// 生成包装箱,如果已经有这个ID了,就增加打印次数  放在orderBox类库更合适
        /// </summary>
        /// <param name="BoxNum"></param>
        /// <returns></returns>
        public void CreateBox(int BoxNum)
        {
            DeleteBox(BoxNum);//删除多余的包装

            for (int i = 1; i < BoxNum + 1; i++)
            {
                OrderBox ob = new OrderBox();
                if (ob.Load(this.Id, i))
                {
                    ob.AddPrintNum();
                }
                else
                {
                    ob.BoxId     = i;
                    ob.OrderId   = this.Id;
                    ob.PrintNum  = 1;
                    ob.Status    = CommenClass.OrderBoxStatus.已打印.ToString();
                    ob.StoreZone = CommenClass.SpecialStoreZone.发货区.ToString();
                    ob.Save();
                }
            }
        }
Beispiel #2
0
        public int Save()
        {
            ArrayList arrayList = new ArrayList();

            if (m_Id > 0)
            {
                arrayList.Add(new SqlParameter("@Id", m_Id));
            }
            arrayList.Add(new SqlParameter("@OrderId", m_OrderId));
            arrayList.Add(new SqlParameter("@DeliveryUserId", m_DeliveryUserId));
            arrayList.Add(new SqlParameter("@DistributeUserId", m_DistributeUserId));
            arrayList.Add(new SqlParameter("@UpdateTime", m_UpdateTime));
            arrayList.Add(new SqlParameter("@PrintNum", m_PrintNum));
            arrayList.Add(new SqlParameter("@Address", m_Address));
            arrayList.Add(new SqlParameter("@Latitude", m_Latitude));
            arrayList.Add(new SqlParameter("@Longitude", m_Longitude));

            if (this.Id > 0)
            {
                m_dbo.UpdateData("OrderDelivery", (SqlParameter[])arrayList.ToArray(typeof(SqlParameter)));
            }
            else
            {
                this.Id = m_dbo.InsertData("OrderDelivery", (SqlParameter[])arrayList.ToArray(typeof(SqlParameter)));
            }
            OrderBox ob = new OrderBox();

            if (!ob.IsBoxOrder(this.OrderId))
            {
                if (this.Id > 0)//扫码装车不能在这里修改订单状态
                {
                    //修改订单状态
                    OrderStatus os = new OrderStatus();
                    os.LoadFromOrderId(this.OrderId);
                    os.UpdateStatus(CommenClass.OrderStatusType.配送, CommenClass.Order_Status.已接受, m_DeliveryUserId);
                }
            }
            return(this.Id);
        }