public IActionResult DashboardSimple(DateTime?minDate, DateTime?maxDate) { if (!minDate.HasValue) { minDate = new DateTime(DateTime.Now.Year, 1, 1); } if (!maxDate.HasValue) { maxDate = new DateTime(DateTime.Now.Year, 12, 30); } ViewData["minDate"] = minDate.Value.ToString("yyyy-MM-dd"); ViewData["maxDate"] = maxDate.Value.ToString("yyyy-MM-dd"); var sellerRecordView = _salesRecordService.FindByDateChart(minDate, maxDate); var sellerNameView = _salesRecordService.FindByName(); ViewBag.MinDate = minDate.Value.ToString("dd/MM/yyyy"); ViewBag.MaxDate = maxDate.Value.ToString("dd/MM/yyyy"); ViewBag.Sellers = sellerNameView; ViewBag.Amount = sellerRecordView; return(View()); }