Пример #1
0
        /// <summary>
        /// 根据滞销库存数获取等级
        /// </summary>
        /// <param name="inStockDays"></param>
        /// <returns></returns>
        private MinMarginDays GetMinMarginDays(int inStockDays)
        {
            MinMarginDays days = MinMarginDays.Thirty;

            if (inStockDays >= 0 && inStockDays <= 30)
            {
                days = MinMarginDays.Thirty;
            }

            if (inStockDays >= 31 && inStockDays <= 60)
            {
                days = MinMarginDays.Sixty;
            }

            if (inStockDays >= 61 && inStockDays <= 90)
            {
                days = MinMarginDays.Ninety;
            }

            if (inStockDays >= 91 && inStockDays <= 120)
            {
                days = MinMarginDays.OneHundredAndTwenty;
            }

            if (inStockDays >= 120 && inStockDays <= 180)
            {
                days = MinMarginDays.OneHundredAndEighty;
            }

            if (inStockDays > 180)
            {
                days = MinMarginDays.Other;
            }
            return(days);
        }
Пример #2
0
 private void AddMargin(MinMarginDays days, MinMarginKPIVM value)
 {
     if (Margin.ContainsKey(days))
     {
         Margin[days].MinMargin = value.MinMargin;
         Margin[days].MaxMargin = value.MaxMargin;
     }
     else
     {
         var tempValue = new MinMarginKPIVM {
             MinMargin = value.MinMargin, MaxMargin = value.MaxMargin
         };
         Margin.Add(days, tempValue);
     }
 }