Пример #1
0
        public async Task <IActionResult> SimpleSearch(DateTime?minDate, DateTime?maxDate)
        {
            var includeList = new List <string> {
                "Seller", "Seller.Department"
            };

            var request = new SalesRecordByDateIncluding
            {
                MinDate                 = minDate,
                MaxDate                 = maxDate,
                IncludeList             = includeList,
                GroupBySellerDepartment = false
            };

            string jsonValues = JsonConvert.SerializeObject(request);

            var result = await _webApiService.FindByDateAsync <SalesRecord>(jsonValues);

            ViewData["minDate"] = minDate?.Date.ToString("yyyy-MM-dd");
            ViewData["maxDate"] = maxDate?.Date.ToString("yyyy-MM-dd");

            return(View(result));
        }