Ejemplo n.º 1
0
 public MainPageViewModel(INavigationService navigationService, IAlert alert)
 {
     this.navigationService = navigationService;
     this.alert             = alert;
     SetAlertCommand        = new DelegateCommand(() =>
     {
         alert.Set(Title, Message, AfterMS * 1000);
     });
 }
Ejemplo n.º 2
0
        public ActionResult Index(MapModel mapModel)
        {
            if (!ModelState.IsValid)
            {
                return(View(mapModel));
            }

            try
            {
                _adminData.SaveMapPageMetadata(mapModel);
                _alert.Set(this, AlertType.Success, "Changes have been saved");
            }
            catch (Exception)
            {
                _alert.Set(this, AlertType.Error, "Unable to save changes");
            }

            return(Index());
        }
Ejemplo n.º 3
0
        public ActionResult Tickets(TicketsModel ticketsModel)
        {
            if (!ModelState.IsValid)
            {
                return(View(ticketsModel));
            }

            try
            {
                _data.SaveTicketInfoContact(ticketsModel);
                _alert.Set(this, AlertType.Success, "You have been added to the mailing list");
            }
            catch (Exception)
            {
                _alert.Set(this, AlertType.Error, "We were unable to add you to the mailing list. Please try again");
            }

            return(RedirectToAction("Tickets", "Festival"));
        }
Ejemplo n.º 4
0
        public ActionResult Create(ActModel model)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    _adminData.CreateAct(model);
                    _alert.Set(this, AlertType.Success, "Changes have been saved");
                    return(RedirectToAction("Index", "Performers"));
                }
                catch (Exception)
                {
                    _alert.Set(this, AlertType.Error, "Unable to save changes");
                }
            }

            return(View(model));
        }