コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }