Beispiel #1
0
        //methods
        public async void CreateEvent()
        {
            try
            {
                if (Evm.NewItem.Name == null || Evm.NewItem.Type == null || Evm.NewItem.Description == null || Evm.NewItem.Location == null || Evm.Date1 <= DateTime.Now)
                {
                    MessageDialog msg = new MessageDialog("In order to create event, you have to fill all the information. Otherwise make sure that the date is picked.", "Creating failed");
                    msg.ShowAsync();
                }
                else
                {
                    DateTime date = DataTimeConvertor.DateTimeOffsetAndTimeSetToDateTime(Evm.Date1, Evm.Time1);

                    _catalog.Events.Add(new Event(Evm.NewItem.Name, Evm.NewItem.Type, Evm.NewItem.Description, date,
                                                  Evm.NewItem.Location));
                    await _getEvents.SavetoJson(_catalog.Events);

                    _frameNAvigation.ActivateFrameNavigation(typeof(EventPage));
                }
            }
            catch (Exception e)
            {
                string        ex  = e.ToString();
                MessageDialog msg = new MessageDialog(ex, "Error");
                msg.ShowAsync();
            }
        }
Beispiel #2
0
 public async void LogIn()
 {
     if (Username == "Ben" && Password == "123")
     {
         _loginStatus = true;
         _frameNAvigation.ActivateFrameNavigation(typeof(EventPage));
     }
     else if (Username == "ooo" && Password == "ooo")
     {
         _loginStatus = true;
         _frameNAvigation.ActivateFrameNavigation(typeof(EventPage));
     }
     else if (Username == "Mimi" && Password == "789")
     {
         _loginStatus = true;
         _frameNAvigation.ActivateFrameNavigation(typeof(EventPage));
     }
     else
     {
         _loginStatus = false;
         MessageDialog msg = new MessageDialog("Wrong username or password,please try again.");
         await msg.ShowAsync();
     }
 }