public static void WriteText(DeliverStatus status, bool isAsync, bool isSingle, bool isError = false)
        {
            if (isError && status.Success)
            {
                return;
            }

            StringBuilder sb = new StringBuilder();

            sb.Append($"FileName: {status.FileName} \r\n");
            sb.Append($"isAsync: {isAsync} \r\n");
            sb.Append($"isSingle: {isSingle} \r\n");
            sb.Append($"Success: {status.Success} \r\n");
            if (status.Success)
            {
                sb.Append($"Url: {status.PayLoad.Url} \r\n");
            }
            else
            {
                var e = status.ErrorMessage;
                sb.Append($"ErrorMessage: \r\n");
                while (e != null)
                {
                    sb.Append($"\t {e.Message}");
                    e = e.InnerException;
                }
            }
            sb.Append("\r\n");
            Console.WriteLine(sb.ToString());
        }
Exemple #2
0
        public bool UpdateDeliverStatus(int orderId, DeliverStatus statusValue)
        {
            Parameters cmdParams = new Parameters();

            cmdParams.AddInParameter("@OrderID", DbType.Int32, orderId);
            cmdParams.AddInParameter("@DeliverStatus", DbType.Int32, (int)statusValue);
            return(DBHelper.ExecuteSql("UPDATE PE_Orders SET DeliverStatus = @DeliverStatus WHERE OrderID = @OrderId", cmdParams));
        }
Exemple #3
0
 public static bool UpdateDeliverStatus(int orderId, DeliverStatus statusValue)
 {
     return(dal.UpdateDeliverStatus(orderId, statusValue));
 }
Exemple #4
0
        public static bool Add(DeliverItemInfo deliverItemInfo)
        {
            bool flag = false;
            IList <OrderItemInfo> infoListByOrderId = OrderItem.GetInfoListByOrderId(deliverItemInfo.OrderId);
            DeliverStatus         preparative       = DeliverStatus.Preparative;
            int num = 0;
            IList <StockItemInfo> infoList = new List <StockItemInfo>();
            bool flag2 = true;

            foreach (OrderItemInfo info in infoListByOrderId)
            {
                bool flag3 = false;
                if (Product.CharacterIsExists(info.ProductCharacter, ProductCharacter.Practicality))
                {
                    flag3 = true;
                }
                else if ((deliverItemInfo.DeliverDirection != 1) && Product.CharacterIsExists(info.ProductCharacter, ProductCharacter.Card))
                {
                    flag3 = true;
                }
                if (flag3)
                {
                    if (flag2)
                    {
                        num   = StockManage.GetMaxId() + 1;
                        flag2 = false;
                    }
                    int amount = info.Amount;
                    if (deliverItemInfo.DeliverDirection == 1)
                    {
                        amount = -amount;
                        Product.AddBuyTimes(info.ProductId, info.TableName);
                    }
                    if (string.IsNullOrEmpty(info.TableName))
                    {
                        Present.AddStocks(info.ProductId, amount);
                    }
                    else
                    {
                        Product.AddStocks(info.ProductId, amount, info.Property);
                    }
                    StockItemInfo item = new StockItemInfo();
                    item.Amount      = Math.Abs(amount);
                    item.ItemId      = StockItem.GetMaxId() + 1;
                    item.Price       = info.TruePrice;
                    item.ProductId   = info.ProductId;
                    item.TableName   = info.TableName;
                    item.Property    = info.Property;
                    item.ProductName = info.ProductName;
                    item.ProductNum  = "";
                    item.StockId     = num;
                    item.Unit        = info.Unit;
                    infoList.Add(item);
                    Product.AddOrderNum(info.ProductId, info.TableName, info.Property, amount);
                }
            }
            if (!flag2)
            {
                StockInfo stockInfo = new StockInfo();
                stockInfo.Inputer   = deliverItemInfo.HandlerName;
                stockInfo.InputTime = deliverItemInfo.DeliverDate;
                stockInfo.Remark    = "退货";
                stockInfo.StockId   = num;
                if (deliverItemInfo.DeliverDirection == 1)
                {
                    stockInfo.StockNum  = StockItem.GetShipmentNum();
                    stockInfo.StockType = StockType.Shipment;
                    stockInfo.Remark    = "订单" + deliverItemInfo.OrderNum + "发货";
                    preparative         = DeliverStatus.Consignment;
                }
                else
                {
                    stockInfo.StockNum  = StockItem.GetInStockNum();
                    stockInfo.StockType = StockType.InStock;
                    stockInfo.Remark    = "订单" + deliverItemInfo.OrderNum + "退货";
                }
                if (StockManage.Add(stockInfo))
                {
                    StockItem.Add(infoList, stockInfo.StockId);
                }
            }
            if (Order.UpdateDeliverStatus(deliverItemInfo.OrderId, preparative))
            {
                flag = dal.Add(deliverItemInfo);
            }
            return(flag);
        }
Exemple #5
0
 public static bool CheckUpload(DeliverStatus status)
 {
     return(status.Success);
 }