Пример #1
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            qu  = (questions)e.Parameter;
            str = qu.question_value;
            string opt1 = (await App.MobileService.GetTable <questions>()
                           .Where(questions => questions.question_value == str)
                           .Select(questions => questions.option1)
                           .ToEnumerableAsync()).FirstOrDefault();

            string opt2 = (await App.MobileService.GetTable <questions>()
                           .Where(questions => questions.question_value == str)
                           .Select(questions => questions.option2)
                           .ToEnumerableAsync()).FirstOrDefault();

            string opt3 = (await App.MobileService.GetTable <questions>()
                           .Where(questions => questions.question_value == str)
                           .Select(questions => questions.option3)
                           .ToEnumerableAsync()).FirstOrDefault();

            string opt4 = (await App.MobileService.GetTable <questions>()
                           .Where(questions => questions.question_value == str)
                           .Select(questions => questions.option4)
                           .ToEnumerableAsync()).FirstOrDefault();

            ques.Text   = str;
            op1.Content = opt1;
            op2.Content = opt2;
            op3.Content = opt3;
            op4.Content = opt4;
            pr.IsActive = false;
        }
Пример #2
0
        private async void sub_Click(object sender, RoutedEventArgs e)
        {
            if (que.Text == "" || tb1.Text == "" || tb2.Text == "" || tb3.Text == "" || tb4.Text == "")
            {
                await new MessageDialog("Please complete all fields").ShowAsync();
            }
            else
            {
                questions newque = new questions();

                try
                {
                    newque = new questions {
                        question_id = Guid.NewGuid().ToString(), question_value = que.Text, userid = useridnew2, option1 = tb1.Text, option2 = tb2.Text, option3 = tb3.Text, option4 = tb4.Text, no_of_responses = 0, answered1 = 0, answered2 = 0, answered3 = 0, answered4 = 0, radius = rad, location_latitude = lat, location_longitude = lon
                    };
                }
                catch (Exception eee)
                {
                    MessageDialog m = new MessageDialog(eee.ToString());
                    m.ShowAsync();
                }
                await App.MobileService.GetTable <questions>().InsertAsync(newque);

                Frame.Navigate(typeof(Feed));
            }
        }
Пример #3
0
        private void ourlistview_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            questions q = new questions();

            q = (questions)ourlistview.SelectedItem;
            Frame.Navigate(typeof(Qdisplay), q);
        }
Пример #4
0
 private void ourlistview_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     questions q = new questions();
     q = (questions)ourlistview.SelectedItem;
     Frame.Navigate(typeof(Qdisplay),q);
 }
Пример #5
0
        private async void sub_Click(object sender, RoutedEventArgs e)
        {


            if (que.Text == "" || tb1.Text == "" || tb2.Text == "" || tb3.Text == "" || tb4.Text == "")
            {
                await new MessageDialog("Please complete all fields").ShowAsync();

            }
            else
            {

                questions newque = new questions();

                try
                {
                    newque = new questions { question_id = Guid.NewGuid().ToString(), question_value = que.Text, userid = useridnew2, option1 = tb1.Text, option2 = tb2.Text, option3 = tb3.Text, option4 = tb4.Text, no_of_responses = 0, answered1 = 0, answered2 = 0, answered3 = 0, answered4 = 0, radius = rad, location_latitude = lat, location_longitude = lon };

                }
                catch (Exception eee)
                {
                    MessageDialog m = new MessageDialog(eee.ToString());
                    m.ShowAsync();

                }
                await App.MobileService.GetTable<questions>().InsertAsync(newque);
                Frame.Navigate(typeof(Feed));
            }
        }