Beispiel #1
0
        /// <summary>
        /// 获取预测时间list
        /// </summary>
        /// <param name="startDate">预测开始时间</param>
        /// <param name="years">预测念书</param>
        /// <returns>预测时间list</returns>
        public static List <KeyValueInfo> GetValForecastDateDescList(DateTime startDate, int years)
        {
            List <KeyValueInfo> ForecastList = new List <KeyValueInfo>();

            for (int i = 0; i < years * 12; i++)
            {
                ForecastList.Add(new KeyValueInfo()
                {
                    ID = startDate.Month, Name = MonthDesc.GetMonthDesc(startDate.Month) + '-' + startDate.Year
                });
                startDate = startDate.AddMonths(1);
            }

            return(ForecastList);
        }
Beispiel #2
0
        /// <summary>
        /// 获取实绩时间list
        /// </summary>
        /// <param name="startDate">实绩开始时间</param>
        /// <param name="endDate">实绩结束时间</param>
        /// <returns>实绩时间list</returns>
        public static List <KeyValueInfo> GetValActualDateDescList(DateTime startDate, DateTime endDate)
        {
            int months = ((endDate.Year - startDate.Year) * 12) + endDate.Month - startDate.Month;
            List <KeyValueInfo> ActualList = new List <KeyValueInfo>();

            for (int i = 0; i < months; i++)
            {
                ActualList.Add(new KeyValueInfo()
                {
                    ID = startDate.Month, Name = MonthDesc.GetMonthDesc(startDate.Month) + '-' + startDate.Year
                });
                startDate = startDate.AddMonths(1);
            }

            return(ActualList);
        }