Esempio n. 1
0
        public static HasilKepribadian LoadHasilKepribadian(DBSoalContext db, int indicator)
        {
            HasilKepribadian hk = new HasilKepribadian();

            db.CreateIfNotExists();
            db.LogDebug = true;
            hk          = (from p in db.HasilKepribadian
                           where p.Id.Equals(indicator)
                           select p).FirstOrDefault();
            return(hk);
        }
Esempio n. 2
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            HasilKepribadian kepribadian = (HasilKepribadian)PhoneApplicationService.Current.State["kepribadian"];

            infoHasil.Text   = kepribadian.Info_Kepribadian;
            keunggulan1.Text = kepribadian.Keunggulan1;
            keunggulan2.Text = kepribadian.Keunggulan2;
            keunggulan3.Text = kepribadian.Keunggulan3;
            kelemahan1.Text  = kepribadian.Kelemahan1;
            kelemahan2.Text  = kepribadian.Kelemahan2;
            kelemahan3.Text  = kepribadian.Kelemahan3;
            profesiText.Text = kepribadian.Pekerjaan;
            BitmapImage tn = new BitmapImage();

            tn.SetSource(Application.GetResourceStream(new Uri(@"Assets/" + kepribadian.Nama_Kepribadian + ".jpg", UriKind.Relative)).Stream);
            hasilImage.Source = tn;
        }
Esempio n. 3
0
 partial void DeleteHasilKepribadian(HasilKepribadian instance);
Esempio n. 4
0
 partial void UpdateHasilKepribadian(HasilKepribadian instance);
Esempio n. 5
0
 partial void InsertHasilKepribadian(HasilKepribadian instance);
Esempio n. 6
0
        private void btnLanjut_Click(object sender, RoutedEventArgs e)
        {
            Jawaban temp  = new Jawaban();
            bool    check = false;

            if (btnA.IsChecked == true)
            {
                temp.jawaban = "A";
                check        = true;
                jawabanUser.Add(temp);
            }
            else if (btnB.IsChecked == true)
            {
                temp.jawaban = "B";
                check        = true;
                jawabanUser.Add(temp);
            }
            else if (btnC.IsChecked == true)
            {
                temp.jawaban = "C";
                check        = true;
                jawabanUser.Add(temp);
            }
            else if (btnD.IsChecked == true)
            {
                temp.jawaban = "D";
                check        = true;
                jawabanUser.Add(temp);
            }
            else
            {
                MessageBox.Show("Pilihlah salah satu jawaban !");
            }

            if (btnLanjut.Content.Equals("Selesai"))
            {
                check = false;
                int hasil;
                hasil   = Control.HasilKepribadian(jawabanUser);
                pribadi = Control.LoadHasilKepribadian(db, hasil);
                PhoneApplicationService.Current.State["kepribadian"] = pribadi;
                NavigationService.Navigate(new Uri("/TestKepribadianResult.xaml", UriKind.Relative));
            }

            if (check)
            {
                temp.kodeSoal = listSoal.ElementAt(nomor - 1).Kode_Soal;

                if (nomor == listSoal.Count - 1)
                {
                    btnLanjut.Content = "Selesai";
                }

                if (nomor < listSoal.Count)
                {
                    jenisSoal.Text = listSoal.ElementAt(nomor).Jenis_Soal;
                    txtBtnA.Text   = listSoal.ElementAt(nomor).JawabanA;
                    txtBtnB.Text   = listSoal.ElementAt(nomor).JawabanB;
                    txtBtnC.Text   = listSoal.ElementAt(nomor).JawabanC;
                    txtBtnD.Text   = listSoal.ElementAt(nomor).JawabanD;
                    btnA.IsChecked = false;
                    btnB.IsChecked = false;
                    btnC.IsChecked = false;
                    btnD.IsChecked = false;
                    nomor++;
                }
            }
        }