/// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.  The Parameter
        /// property is typically used to configure the page.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            t_to_overview tf = (t_to_overview)e.Parameter;

            testname_to_db_block.Text          = tf.testname1;
            soil_type_combo_todb.SelectedIndex = tf.soiltype1;  //
            landcovered_to_db_block.Text       = tf.landcovered1;
            season_combo_todb.SelectedIndex    = tf.season1;    //
            if (tf.temp_c1 == "")
            {
                temp_to_db_block.Text = "unavailable";
            }
            else
            {
                temp_to_db_block.Text = tf.temp_c1;
            }
            if (tf.humidity1 == "")
            {
                humidity_to_db_block.Text = "unavailable";
            }
            else
            {
                humidity_to_db_block.Text = tf.humidity1;
            }
            amount_n_to_db_block.Text         = tf.amount_n;
            amount_p_to_db_block.Text         = tf.amount_p;
            amount_k_to_db_block.Text         = tf.amount_k;
            ph_combo_todb.SelectedIndex       = tf.ph;        //
            moisture_combo_todb.SelectedIndex = tf.moisture;
            ec_combo_todb.SelectedIndex       = tf.ec;        //
        }
Esempio n. 2
0
 private async void cont_Click(object sender, RoutedEventArgs e)
 {
     if (n_amount_box.Text != "" && p_amount_box.Text != "" && k_amount_box.Text != "" && ph_box.SelectedIndex != -1 && moisture_box.SelectedIndex != -1 && ec_box.SelectedIndex != -1)
     {
         t_to_overview tf1 = new t_to_overview()
         {
             testname1 = testname, soiltype1 = soiltype, landcovered1 = landcovered, season1 = season, temp_c1 = temp_c, humidity1 = humidity, amount_n = n_amount_box.Text, amount_p = p_amount_box.Text, amount_k = k_amount_box.Text, ph = ph_box.SelectedIndex, moisture = moisture_box.SelectedIndex, ec = ec_box.SelectedIndex
         };
         this.Frame.Navigate(typeof(test_overview), tf1); //transfering data to test_overview
     }
     else
     {
         MessageDialog msg = new MessageDialog("Missed some fields,please enter them to continue", "Error");
         await msg.ShowAsync();
     }
 }