//Método Busca Agrupada
        public async Task <IActionResult> GroupingSearch(DateTime?minDate, DateTime?maxDate)
        {
            if (!minDate.HasValue)
            {
                minDate = new DateTime(DateTime.Now.Year, 1, 1);
            }
            if (!maxDate.HasValue)
            {
                maxDate = DateTime.Now;
            }
            ViewData["minDate"] = minDate.Value.ToString("yyyy-MM-dd");
            ViewData["maxDate"] = maxDate.Value.ToString("yyyy-MM-dd");
            var result = await _salesRecordService.FindByDateGroupAsync(minDate, maxDate);

            return(View(result));
        }
예제 #2
0
        public async Task <IActionResult> GroupFind(DateTime?dtOne, DateTime?dtTwo)
        {
            //if (!dtOne.HasValue)
            //{
            //    dtOne = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
            //}
            //if (!dtTwo.HasValue)
            //{
            //    dtTwo = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
            //}

            //ViewData["minDate"] = dtOne.Value.ToString("yyyy-MM-dd");
            //ViewData["maxDate"] = dtTwo.Value.ToString("yyyy-MM-dd");
            var result = await _salesRecordsService.FindByDateGroupAsync(dtOne, dtTwo);

            return(View(result));
        }
예제 #3
0
        public async Task <IActionResult> GroupSearch(DateTime?start, DateTime?end)
        {
            ViewData["Title"] = "Sales Records - Group Search";
            if (!start.HasValue)
            {
                start = new DateTime(DateTime.Now.Year, 1, 1);
            }
            if (!end.HasValue)
            {
                end = DateTime.Now;
            }
            ViewData["start"] = start.Value.ToString("dd/MM/yyyy");
            ViewData["end"]   = end.Value.ToString("dd/MM/yyyy");

            var salesRecords = await _salesRecordService.FindByDateGroupAsync(start, end);

            return(View(salesRecords));
        }