public async Task <IActionResult> GroupingSearch(DateTime?minDate, DateTime?maxDate, SaleStatus status)
        {
            if (!minDate.HasValue && !maxDate.HasValue)
            {
                minDate = new DateTime(DateTime.Now.Year, 1, 1);
                maxDate = DateTime.Now;
            }
            ViewData["minDate"] = minDate.Value.ToString("yyyy-MM-dd");
            ViewData["maxDate"] = maxDate.Value.ToString("yyyy-MM-dd");

            var result = await _salesRecordService.FindByDateGroupingAsync(minDate, maxDate, status);

            return(View(result));
        }
Beispiel #2
0
        public async Task <IActionResult> GroupingSearch(DateTime?minDate, DateTime?maxDate)
        {
            if (minDate == null)
            {
                minDate = new DateTime(DateTime.Now.Year, 1, 1);
            }
            if (maxDate == null)
            {
                maxDate = DateTime.Now;
            }
            ViewData["minData"] = minDate.Value.ToString("yyyy-MM-dd");
            ViewData["maxData"] = maxDate.Value.ToString("yyyy-MM-dd");
            var result = await _salesService.FindByDateGroupingAsync(minDate, maxDate);

            return(View(result));
        }
Beispiel #3
0
        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 list = await _salesRecordsService.FindByDateGroupingAsync(minDate, maxDate);

            return(View(list));
        }
Beispiel #4
0
        public async Task <IActionResult> GroupingSearch(DateTime?min, DateTime?max)
        {
            if (!min.HasValue)
            {
                min = new DateTime(DateTime.Now.Year, 1, 1);
            }
            if (!max.HasValue)
            {
                max = DateTime.Now;
            }
            ViewData["min"] = min.Value.ToString("yyyy-MM-dd");
            ViewData["max"] = max.Value.ToString("yyyy-MM-dd");

            var result = await _salesRecordsService.FindByDateGroupingAsync(min, max);

            return(View(result));
        }
Beispiel #5
0
        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;
            }

            //passando as datas pra view
            ViewData["minDate"] = minDate.Value.ToString("yyy-MM-dd");
            ViewData["maxDate"] = maxDate.Value.ToString("yyy-MM-dd");

            var result = await _salesRecordsService.FindByDateGroupingAsync(minDate, maxDate);

            return(View(result));
        }
        public async Task <IActionResult> SimpleGroup(DateTime?minDate, DateTime?maxDate)
        {
            if (!minDate.HasValue)
            {
                minDate = new DateTime(DateTime.Now.Year, 1, 1);
            }
            if (!maxDate.HasValue)
            {
                maxDate = DateTime.Now;
            }

            //Passando os dados para a View com dicionário ViewData
            ViewData["minDate"] = minDate.Value.ToString("yyyy-MM-dd");
            ViewData["maxDate"] = maxDate.Value.ToString("yyyy-MM-dd");

            var result = await _salesRecordsService.FindByDateGroupingAsync(minDate, maxDate);

            return(View(result));
        }
Beispiel #7
0
        public async Task <IActionResult> GroupingSearch(DateTime?initialDate, DateTime?finalDate)
        {
            List <IGrouping <Department, SalesRecord> > records = await _salesRecordsService.FindByDateGroupingAsync(initialDate, finalDate);

            if (!initialDate.HasValue)
            {
                initialDate = new DateTime(DateTime.Now.Year, 1, 1);
            }

            if (!finalDate.HasValue)
            {
                finalDate = DateTime.Now;
            }

            ViewData["initialDate"] = initialDate.Value.ToString("yyyy-MM-dd");
            ViewData["finalDate"]   = finalDate.Value.ToString("yyyy-MM-dd");

            return(View(records));
        }
Beispiel #8
0
        public async Task <IActionResult> GroupingSearch(DateTime?minDate, DateTime?maxDate)
        {
            try
            {
                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 _salesRecordsService.FindByDateGroupingAsync(minDate, maxDate);

                return(View(result));
            }
            catch (ApplicationException e)
            {
                return(RedirectToAction(nameof(Error), new { message = e.Message }));
            }
        }
Beispiel #9
0
        public async Task <IActionResult> GroupingSearch(DateTime?minDate, DateTime?maxDate)
        {
            if (!minDate.HasValue)
            {
                minDate = new DateTime(DateTime.Today.Year, 1, 1);
            }

            if (!maxDate.HasValue)
            {
                maxDate = DateTime.Today;
            }

            ViewData["minDate"] = minDate.Value.ToString("yyyy-MM-dd"); // html5 date input format = yyyy-MM-dd
            ViewData["maxDate"] = maxDate.Value.ToString("yyyy-MM-dd");

            List <IGrouping <Department, SalesRecord> > salesGroupedByDepartment = await _salesRecordsService.FindByDateGroupingAsync(minDate, maxDate);

            return(View(salesGroupedByDepartment));
        }
Beispiel #10
0
        public async Task <IActionResult> GroupingSearch(DateTime?minDate, DateTime?maxDate)
        {
            var teste = await _salesRecordsService.FindByDateGroupingAsync(minDate, maxDate);

            return(View(teste));
        }