public ProductStatVM()
        {
            plService = new ProductlineService();
            pService  = new ProductService();
            odService = new OrderdetailService();
            oService  = new OrderStatisticService();

            {
                List <YearStruct> yl = new List <YearStruct>()
                {
                    new YearStruct()
                    {
                        year = -1, display = "---All---"
                    }
                };

                List <int> year = oService.GetDistinctYear(SortDateEnum.orderDate).ToList();
                year.Sort();
                foreach (int y in year)
                {
                    yl.Add(new YearStruct()
                    {
                        year = y, display = "--" + y.ToString() + "--"
                    });
                }

                YearList = yl;
            }

            MonthList = new List <MonthStruct>()
            {
                new MonthStruct()
                {
                    month = -1, display = "All"
                }, new MonthStruct()
                {
                    month = 1, display = "January"
                }, new MonthStruct()
                {
                    month = 2, display = "February"
                }, new MonthStruct()
                {
                    month = 3, display = "March"
                }, new MonthStruct()
                {
                    month = 4, display = "April"
                }, new MonthStruct()
                {
                    month = 5, display = "May"
                }, new MonthStruct()
                {
                    month = 6, display = "June"
                }, new MonthStruct()
                {
                    month = 7, display = "July"
                }, new MonthStruct()
                {
                    month = 8, display = "August"
                }, new MonthStruct()
                {
                    month = 9, display = "September"
                }, new MonthStruct()
                {
                    month = 10, display = "October"
                }, new MonthStruct()
                {
                    month = 11, display = "November"
                }, new MonthStruct()
                {
                    month = 12, display = "December"
                }
            };

            SelectedMonth = -1;
            SelectedYear  = -1;
        }
Example #2
0
 // GET: Api/Tags
 public OrderStatisticsController(IOrderStatisticService orderStatisticService, IUnitOfWorkAsync unitOfWorkAsync)
 {
     _orderStatisticService = orderStatisticService;
     _unitOfWorkAsync       = unitOfWorkAsync;
 }