Example #1
0
        public ActionResult DeleteShow(int id)
        {
            ShowService service = new ShowService();

            service.DeleteShow(id);

            return(RedirectToAction("AllShows"));
        }
Example #2
0
        public ActionResult DeleteShow(int id)
        {
            showService.DeleteShow(new ShowModel {
                Id = id
            });

            return(RedirectToAction("Shows"));
        }
Example #3
0
        public IHttpActionResult Delete(int id)
        {
            ShowService service = CreateShowService();

            //bool b = service.DeleteShow(id);
            //if (!b)
            //return InternalServerError();
            //above is shorthand for below
            if (!service.DeleteShow(id)) //
            {
                return(InternalServerError());
            }

            return(Ok());
        }
Example #4
0
        private void DeleteButton_Click(object sender, EventArgs args)
        {
            Program     app         = Program.GetInstance();
            ShowService showManager = app.GetService <ShowService>("shows");

            // Ask for confirmation
            if (!GuiHelper.ShowConfirm("Weet je zeker dat je deze voorstelling wilt verwijderen?"))
            {
                return;
            }

            // Delete show
            if (!showManager.DeleteShow(show))
            {
                GuiHelper.ShowError("Kon voorstelling niet verwijderen");
                return;
            }

            ShowList newScreen = app.GetScreen <ShowList>("showList");

            app.ShowScreen(newScreen);
            GuiHelper.ShowInfo("Voorstelling succesvol verwijderd");
        }
        public async Task <IActionResult> DeleteShow(Guid id)
        {
            await _service.DeleteShow(id);

            return(Ok());
        }