public async Task <IActionResult> Reports(StaffReportsViewModel model) { //if no report is selected if (model.Report == null || model.Report.Equals("")) { //get the types of reports into the view ViewData["Reports"] = new SelectList(new List <string> { "", "Daily Booking Report", "Monthly Booking Report" }); //reload page return(View(model)); } //check what report is to be generated switch (model.Report) { case "Daily Booking Report": await generateDailySales(); break; case "Monthly Booking Report": await generateMonthlySales(); break; } //reload page return(View(model)); }
public ActionResult Reports() { //create the model var model = new StaffReportsViewModel() { Report = "" }; //get the types of reports into the view ViewData["Reports"] = new SelectList(new List <string> { "", "Daily Booking Report", "Monthly Booking Report" }); //load page return(View(model)); }