Exemplo n.º 1
0
        public Home_Page()
        {
            // TODO: Confirm that "Task" works or if we need to reference the event by something else
            //     Models.Event_Details task = Application.Current.Resources["Task"] as Models.Event_Details;

            this.InitializeComponent();
            this.Update_Weather();
            Timer.Tick    += Timer_Tick;
            Timer.Interval = new TimeSpan(0, 0, 1);
            Timer.Start();
            Database_Service.SchedServiceClient client = new Database_Service.SchedServiceClient();
            EventViewModel model = new EventViewModel();

            Models.User_Account account = Application.Current.Resources["User"] as Models.User_Account;
            model.EventList  = client.GetMeetingInfoForUserAsync(account.clientID).GetAwaiter().GetResult();
            this.DataContext = model;
        }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            account = (Models.User_Account)Application.Current.Resources["User"];
            //method needed to create/read/store an image as an avatar byte array on the client side
            //this.AvatarImageBox.Source = account.avatarImage;
            this.UsernameTextBox.Text    = account.username;
            this.FirstNameTextBox.Text   = account.firstName;
            this.LastNameTextBox.Text    = account.lastName;
            this.PhoneNumberTextBox.Text = account.phoneNumber;
            EventViewModel em = new EventViewModel();

            if (account.avatarImage != null)
            {
                em.newAvatar(account.avatarImage);
            }
            this.DataContext = em;
        }
Exemplo n.º 3
0
        public Event_Page()
        {
            this.InitializeComponent();
            System.Uri manifestUri = new Uri("http://amssamples.streaming.mediaservices.windows.net/49b57c87-f5f3-48b3-ba22-c55cfdffa9cb/Sintel.ism/manifest(format=m3u8-aapl)");
            _mediaPlayer        = new MediaPlayer();
            _mediaPlayer.Source = MediaSource.CreateFromUri(manifestUri);
            account             = Application.Current.Resources["User"] as Models.User_Account;

            Task.Run(async() => {
                string connecting;
                try
                {
                    UpdateChat(connecting = await rtc.ConnectAsync(null, new ConnectionInformationObject(eventDetails.chatID, account.email, account.username, true)));
                }
                catch (Exception e)
                { }
            });
        }
Exemplo n.º 4
0
        private async void LoginButton_Click(object sender, RoutedEventArgs e)
        {
            this.LoginButton.IsEnabled = false;
            Database_Service.SchedServiceClient client = new Database_Service.SchedServiceClient();
            string testString;

            if (s == "")
            {
                testString = await client.LoginCheckAsync(this.EmailTextBox.Text.Trim(), this.PasswordTextBox.Password.Trim());
            }
            else
            {
                testString = await client.LoginCheckAsync(this.EmailTextBox.Text.Trim(), s);
            }

            if (testString == "Login Successful")
            {
                var user = await client.GetUserAsync(this.EmailTextBox.Text.Trim());

                Models.User_Account account = new Models.User_Account()
                {
                    clientID    = user.ClientID,
                    username    = user.UserName,
                    avatarImage = user.Avatar,
                    firstName   = user.FirstName,
                    lastName    = user.LastName,
                    phoneNumber = user.Phone,
                    address     = user.Address,
                    email       = user.Email
                };
                Application.Current.Resources.Add("User", account);
                this.DisplaySuccessDialog();
            }
            else
            {
                this.ErrorMessage.Text     = Login_Page.ErrorMessageText;
                this.LoginButton.IsEnabled = true;
            }
        }
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     account = (Models.User_Account)Application.Current.Resources["User"];
 }
Exemplo n.º 6
0
 public void Login_User()
 {
     account = (Models.User_Account)Application.Current.Resources["User"];
 }