public async Task <IActionResult> CountByCustomerMonth(CountByCustomerMonthViewModel model) { if (ModelState.IsValid) { model.Customers = await GetCustomerCountsByMonthAsync(model.Nam, model.Thang); ViewBag.Months = new SelectList(model.Months, "ID", "Ten", model.Thang); ViewBag.Years = new SelectList(model.Years, model.Nam); } return(View(model)); }
public async Task <IActionResult> CountByCustomerMonth() { var nowm = DateTime.Today.Month; var nowy = DateTime.Today.Year; var model = new CountByCustomerMonthViewModel { Thang = nowm, Nam = nowy, Customers = await GetCustomerCountsByMonthAsync(nowy, nowm) }; ViewBag.Months = new SelectList(model.Months, "ID", "Ten", nowm); ViewBag.Years = new SelectList(model.Years, nowy); return(View(model)); }