Exemplo n.º 1
0
        void BeforeReqQuantityChange(ref double reqQuantity)
        {
            //Изменено
            if ((!IsShopBalance) || (OrderMode == AutoOrderModeEnum.NothingMode))
            {
                CalcOrder(ref reqQuantity);
            }
            else
            {
                switch (OrderMode)
                {
                case AutoOrderModeEnum.MinOrderMode:
                    if ((IsShopBalance) && (ShopBalance == 0))
                    {
                        SetValue(ref reqQuantity, MinOrder);
                    }
                    break;

                case AutoOrderModeEnum.RecommendMode:
                    if ((IsShopBalance) && (ShopBalance == 0))
                    {
                        SetValue(ref reqQuantity, double.Parse(ForOrder.ToString()));
                    }
                    break;

                case AutoOrderModeEnum.AllRecommendMode:
                    if (IsShopBalance)
                    {
                        SetValue(ref reqQuantity, double.Parse(ForOrder.ToString()));
                    }
                    break;
                }
                CalcOrder(ref reqQuantity);
            }
        }
Exemplo n.º 2
0
        void BeforeReqQuantityChange(ref double reqQuantity)
        {
            //Изменено

            /* if(MinOrder == QuantityInPack)
             * {
             *   reqQuantity = RoundOrderHelper.Calc(reqQuantity, Quantity, QuantityInPack, MinOrder);
             *   if ((IsQuoted) && (reqQuantity > Quota))
             *       reqQuantity = Quota;
             * }
             * else
             * {*/
            if ((!IsShopBalance) || (OrderMode == AutoOrderModeEnum.NothingMode))
            {
                CalcOrder(ref reqQuantity);
            }
            else
            {
                switch (OrderMode)
                {
                case AutoOrderModeEnum.MinOrderMode:
                    if ((IsShopBalance) && (ShopBalance == 0))
                    {
                        SetValue(ref reqQuantity, MinOrder);
                    }
                    break;

                case AutoOrderModeEnum.RecommendMode:
                    if ((IsShopBalance) && (ShopBalance == 0))
                    {
                        SetValue(ref reqQuantity, double.Parse(ForOrder.ToString()));
                    }
                    break;

                case AutoOrderModeEnum.AllRecommendMode:
                    if (IsShopBalance)
                    {
                        SetValue(ref reqQuantity, double.Parse(ForOrder.ToString()));
                    }
                    break;
                }
                CalcOrder(ref reqQuantity);
            }
            //}
        }
Exemplo n.º 3
0
        public void CalcAutoOrder(DateTime now)
        {
            if (RreqAssort)
            {
                switch (OrderMode)
                {
                case AutoOrderModeEnum.MinOrderMode:
                    if (LastOrderDate <= now.Date)
                    {
                        IfNotShopBalance(MinOrder);
                        // SendOnAutoOrder();
                    }
                    break;

                case AutoOrderModeEnum.RecommendMode:
                    if (LastOrderDate <= now.Date)
                    {
                        IfNotShopBalance(double.Parse(ForOrder.ToString()));
                        //SendOnAutoOrder();
                    }
                    break;

                case AutoOrderModeEnum.AllRecommendMode:
                    if (LastOrderDate <= now.Date)
                    {
                        if (IsShopBalance)
                        {
                            ReqQuantity = (double.Parse(ForOrder.ToString()));
                            SendOnAutoOrder();
                        }
                    }
                    break;

                default:
                    ReqQuantity = (double.Parse(ForOrder.ToString()));
                    break;
                }
            }
        }