Ejemplo n.º 1
0
        public IActionResult OnPostCancelTeeTime()
        {
            ModelState.Remove("Date");
            ModelState.Remove("Time");
            if (ModelState.IsValid)
            {
                Confirmation = false;
                CBS RequestDirector     = new CBS();
                var selectedTeeTimeTemp = TempData.Get <TeeTime>("key");
                selectedTeeTime = selectedTeeTimeTemp;
                Confirmation    = RequestDirector.DeleteTeeTime(selectedTeeTime);
                if (Confirmation)
                {
                    TempData["Alert"] = $"Successfully Cancelled Tee Time";
                    return(RedirectToPage("/Index"));
                }
                else
                {
                    TempData["Danger"] = true;
                    Alert = $"Could Not Modify Tee Time Tee Time";
                }
            }



            return(Page());
        }