예제 #1
0
        private async void button2_Click(object sender, EventArgs e)
        {
            if (comboBox1.Text == "")
            {
                MessageBox.Show("Silahkan pilih Kecamatan!");
            }
            if (comboBox2.Text == "")
            {
                MessageBox.Show("Silahkan pilih Desa/Kelurahan!");
            }
            if (comboBox3.Text == "")
            {
                MessageBox.Show("Silahkan pilih TPS!");
            }
            else
            {
                FirebaseResponse resp1 = await client.GetTaskAsync("Data User/" + label5.Text + comboBox1.Text + comboBox2.Text + comboBox3.Text + "/JumlahLaki/");

                NoLaki           no       = resp1.ResultAs <NoLaki>();
                FirebaseResponse response = await client.GetTaskAsync("Data User/" + label5.Text + comboBox1.Text + comboBox2.Text + comboBox3.Text + "/JumlahPerempuan/");

                NoCewek          noCewek   = response.ResultAs <NoCewek>();
                FirebaseResponse response1 = await client.GetTaskAsync("Data User/" + label5.Text + comboBox1.Text + comboBox2.Text + comboBox3.Text + "/JumlahSM/");

                SM sM = response1.ResultAs <SM>();
                FirebaseResponse response2 = await client.GetTaskAsync("Data User/" + label5.Text + comboBox1.Text + comboBox2.Text + comboBox3.Text + "/JumlahBM/");

                BM bM = response2.ResultAs <BM>();
                FirebaseResponse response3 = await client.GetTaskAsync("Data User/" + label5.Text + comboBox1.Text + comboBox2.Text + comboBox3.Text + "/JumlahPM/");

                PM pM = response3.ResultAs <PM>();
                FirebaseResponse response4 = await client.GetTaskAsync("Data User/" + label5.Text + comboBox1.Text + comboBox2.Text + comboBox3.Text + "/JumlahTK/");

                TK tK = response4.ResultAs <TK>();
                FirebaseResponse response5 = await client.GetTaskAsync("Data User/" + label5.Text + comboBox1.Text + comboBox2.Text + comboBox3.Text + "/JumlahSD/");

                SD sD = response5.ResultAs <SD>();
                FirebaseResponse response6 = await client.GetTaskAsync("Data User/" + label5.Text + comboBox1.Text + comboBox2.Text + comboBox3.Text + "/JumlahSMP/");

                SMP sMP = response6.ResultAs <SMP>();
                FirebaseResponse response7 = await client.GetTaskAsync("Data User/" + label5.Text + comboBox1.Text + comboBox2.Text + comboBox3.Text + "/JumlahSMA/");

                SMA sMA = response7.ResultAs <SMA>();
                FirebaseResponse response8 = await client.GetTaskAsync("Data User/" + label5.Text + comboBox1.Text + comboBox2.Text + comboBox3.Text + "/JumlahS1/");

                S1 s1 = response8.ResultAs <S1>();
                FirebaseResponse response9 = await client.GetTaskAsync("Data User/" + label5.Text + comboBox1.Text + comboBox2.Text + comboBox3.Text + "/JumlahS2/");

                S2 s2 = response9.ResultAs <S2>();
                FirebaseResponse response10 = await client.GetTaskAsync("Data User/" + label5.Text + comboBox1.Text + comboBox2.Text + comboBox3.Text + "/JumlahS3/");

                S3 s3 = response10.ResultAs <S3>();
                FirebaseResponse response11 = await client.GetTaskAsync("Data User/" + label5.Text + comboBox1.Text + comboBox2.Text + comboBox3.Text + "/JumlahTidaksekolah/");

                Tidaksekolah     tidaksekolah = response11.ResultAs <Tidaksekolah>();
                FirebaseResponse response12   = await client.GetTaskAsync("Data User/" + label5.Text + comboBox1.Text + comboBox2.Text + comboBox3.Text + "/JumlahKK/");

                KKs kKs = response12.ResultAs <KKs>();
                FirebaseResponse response13 = await client.GetTaskAsync("Data User/" + label5.Text + comboBox1.Text + comboBox2.Text + comboBox3.Text + "/JumlahIslam/");

                Islam            islam      = response13.ResultAs <Islam>();
                FirebaseResponse response14 = await client.GetTaskAsync("Data User/" + label5.Text + comboBox1.Text + comboBox2.Text + comboBox3.Text + "/JumlahKristen/");

                Kristen          kristen    = response14.ResultAs <Kristen>();
                FirebaseResponse response15 = await client.GetTaskAsync("Data User/" + label5.Text + comboBox1.Text + comboBox2.Text + comboBox3.Text + "/JumlahKatholik/");

                Katholik         katholik   = response15.ResultAs <Katholik>();
                FirebaseResponse response16 = await client.GetTaskAsync("Data User/" + label5.Text + comboBox1.Text + comboBox2.Text + comboBox3.Text + "/JumlahBudha/");

                Bundha           bundha     = response16.ResultAs <Bundha>();
                FirebaseResponse response17 = await client.GetTaskAsync("Data User/" + label5.Text + comboBox1.Text + comboBox2.Text + comboBox3.Text + "/JumlahHindu/");

                Hindu            hindu      = response17.ResultAs <Hindu>();
                FirebaseResponse response18 = await client.GetTaskAsync("Data User/" + label5.Text + comboBox1.Text + comboBox2.Text + comboBox3.Text + "/JumlahKonghucu/");

                Konghucu         konghucu   = response18.ResultAs <Konghucu>();
                FirebaseResponse response19 = await client.GetTaskAsync("Data User/" + label5.Text + comboBox1.Text + comboBox2.Text + comboBox3.Text + "/JumlahPetani/");

                Petani           petani     = response19.ResultAs <Petani>();
                FirebaseResponse response20 = await client.GetTaskAsync("Data User/" + label5.Text + comboBox1.Text + comboBox2.Text + comboBox3.Text + "/JumlahNelayan/");

                Nelayan          nelayan    = response20.ResultAs <Nelayan>();
                FirebaseResponse response21 = await client.GetTaskAsync("Data User/" + label5.Text + comboBox1.Text + comboBox2.Text + comboBox3.Text + "/JumlahPedagang/");

                Pedagang         pedagang   = response21.ResultAs <Pedagang>();
                FirebaseResponse response22 = await client.GetTaskAsync("Data User/" + label5.Text + comboBox1.Text + comboBox2.Text + comboBox3.Text + "/JumlahPTP/");

                PTP pTP = response22.ResultAs <PTP>();
                FirebaseResponse response23 = await client.GetTaskAsync("Data User/" + label5.Text + comboBox1.Text + comboBox2.Text + comboBox3.Text + "/JumlahSwasta/");

                Swasta           swasta     = response23.ResultAs <Swasta>();
                FirebaseResponse response24 = await client.GetTaskAsync("Data User/" + label5.Text + comboBox1.Text + comboBox2.Text + comboBox3.Text + "/JumlahBuruh/");

                Buruh            buruh      = response24.ResultAs <Buruh>();
                FirebaseResponse response25 = await client.GetTaskAsync("Data User/" + label5.Text + comboBox1.Text + comboBox2.Text + comboBox3.Text + "/JumlahWiraswasta/");

                Wiraswasta       wiraswasta = response25.ResultAs <Wiraswasta>();
                FirebaseResponse response26 = await client.GetTaskAsync("Data User/" + label5.Text + comboBox1.Text + comboBox2.Text + comboBox3.Text + "/JumlahPensiunan/");

                Pensiunan        pensiunan  = response26.ResultAs <Pensiunan>();
                FirebaseResponse response27 = await client.GetTaskAsync("Data User/" + label5.Text + comboBox1.Text + comboBox2.Text + comboBox3.Text + "/JumlahPelajar/");

                Pelajar          pelajar    = response27.ResultAs <Pelajar>();
                FirebaseResponse response28 = await client.GetTaskAsync("Data User/" + label5.Text + comboBox1.Text + comboBox2.Text + comboBox3.Text + "/JumlahTidakkerja/");

                Tidakkerja       tidakkerja = response28.ResultAs <Tidakkerja>();
                FirebaseResponse response29 = await client.GetTaskAsync("Data User/" + label5.Text + comboBox1.Text + comboBox2.Text + comboBox3.Text + "/JumlahK/");

                K k = response29.ResultAs <K>();
                FirebaseResponse response30 = await client.GetTaskAsync("Data User/" + label5.Text + comboBox1.Text + comboBox2.Text + comboBox3.Text + "/JumlahS/");

                S s = response30.ResultAs <S>();
                FirebaseResponse response31 = await client.GetTaskAsync("Data User/" + label5.Text + comboBox1.Text + comboBox2.Text + comboBox3.Text + "/JumlahM/");

                M m = response31.ResultAs <M>();

                label10.Text = no.jmlLaki;
                label11.Text = noCewek.jmlcewek;
                label16.Text = pM.jmlPM;
                label17.Text = bM.jmlBM;
                label18.Text = pM.jmlPM;
                label20.Text = kKs.jmlkk;
                label25.Text = islam.jmlIslam;
                label26.Text = kristen.jmlKristen;
                label27.Text = katholik.jmlKatholik;
                label28.Text = bundha.jmlBudha;
                label29.Text = hindu.jmlHindu;
                label30.Text = konghucu.jmlKonghucu;
                label41.Text = petani.jmlPetani;
                label42.Text = nelayan.jmlNelayan;
                label43.Text = pedagang.jmlPedagang;
                label44.Text = pTP.jmlPTP;
                label45.Text = swasta.jmlSwasta;
                label46.Text = buruh.jmlburuh;
                label47.Text = wiraswasta.jmlWiraswasta;
                label48.Text = pensiunan.jmlPensiunan;
                label49.Text = pelajar.jmlpelajar;
                label50.Text = tidakkerja.jmlTidakkerja;

                chart1.Series["Pendidikan"].Points.Clear();
                chart1.Series["Pendidikan"].IsValueShownAsLabel = true;
                chart1.Series["Pendidikan"].Points.AddXY("TK", tK.jmlTK);
                chart1.Series["Pendidikan"].Points.AddXY("SD", sD.jmlSD);
                chart1.Series["Pendidikan"].Points.AddXY("SMP", sMP.jmlSMP);
                chart1.Series["Pendidikan"].Points.AddXY("SMA/SMK", sMA.jmlSMA);
                chart1.Series["Pendidikan"].Points.AddXY("S1", s1.jmlS1);
                chart1.Series["Pendidikan"].Points.AddXY("S2", s2.jmlS2);
                chart1.Series["Pendidikan"].Points.AddXY("S3", s3.jmlS3);
                chart1.Series["Pendidikan"].Points.AddXY("Tidak Sekolah", tidaksekolah.jmlTidaksekolah);

                chart2.Series["K"].Points.Clear();
                chart2.Series["K"].IsValueShownAsLabel = true;
                chart2.Series["K"].Points.AddXY("K", k.jmlK);
                chart2.Series["S"].Points.AddXY("S", s.jmlS);
                chart2.Series["M"].Points.AddXY("M", m.jmlM);
            }
        }
예제 #2
0
        private async void button1_Click(object sender, EventArgs e)
        {
            FirebaseResponse resp1 = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahNama/");

            NoNama           get1     = resp1.ResultAs <NoNama>();
            FirebaseResponse response = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahLaki/");

            GenderLaki       genderLaki = response.ResultAs <GenderLaki>();
            FirebaseResponse response2  = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahPerempuan");

            GenderCewek      genderCewek = response2.ResultAs <GenderCewek>();
            FirebaseResponse response3   = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahIslam");

            Islam            islam     = response3.ResultAs <Islam>();
            FirebaseResponse response4 = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahKristen");

            Kristen          kristen   = response4.ResultAs <Kristen>();
            FirebaseResponse response5 = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahKatholik");

            Katholik         katholik  = response5.ResultAs <Katholik>();
            FirebaseResponse response6 = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahHindu");

            Hindu            hindu     = response6.ResultAs <Hindu>();
            FirebaseResponse response7 = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahBudha");

            Bundha           bundha    = response7.ResultAs <Bundha>();
            FirebaseResponse response8 = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahKonghucu");

            Konghucu         konghucu  = response8.ResultAs <Konghucu>();
            FirebaseResponse response9 = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahPetani");

            Petani           petani     = response9.ResultAs <Petani>();
            FirebaseResponse response10 = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahNelayan");

            Nelayan          nelayan    = response10.ResultAs <Nelayan>();
            FirebaseResponse response11 = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahPedagang");

            Pedagang         pedagang   = response11.ResultAs <Pedagang>();
            FirebaseResponse response12 = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahPTP");

            PTP pTP = response12.ResultAs <PTP>();
            FirebaseResponse response13 = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahSwasta");

            Swasta           swasta     = response13.ResultAs <Swasta>();
            FirebaseResponse response14 = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahBuruh");

            Buruh            buruh      = response14.ResultAs <Buruh>();
            FirebaseResponse response15 = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahWiraswasta");

            Wiraswasta       wiraswasta = response15.ResultAs <Wiraswasta>();
            FirebaseResponse response16 = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahPensiunan");

            Pensiunan        pensiunan  = response16.ResultAs <Pensiunan>();
            FirebaseResponse response17 = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahPelajar");

            Pelajar          pelajar    = response17.ResultAs <Pelajar>();
            FirebaseResponse response18 = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahTidakkerja");

            Tidakkerja       tidakkerja = response18.ResultAs <Tidakkerja>();
            FirebaseResponse response19 = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahTK");

            TK tK = response19.ResultAs <TK>();
            FirebaseResponse response20 = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahSD");

            SD sD = response20.ResultAs <SD>();
            FirebaseResponse response21 = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahSMP");

            SMP sMP = response21.ResultAs <SMP>();
            FirebaseResponse response22 = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahSMA");

            SMA sMA = response22.ResultAs <SMA>();
            FirebaseResponse response23 = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahS1");

            S1 s1 = response23.ResultAs <S1>();
            FirebaseResponse response24 = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahS2");

            S2 s2 = response24.ResultAs <S2>();
            FirebaseResponse response25 = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahS3");

            S3 s3 = response25.ResultAs <S3>();
            FirebaseResponse response26 = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahTidaksekolah");

            Tidaksekolah     tidaksekolah = response26.ResultAs <Tidaksekolah>();
            FirebaseResponse response27   = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahSM");

            SM sM = response27.ResultAs <SM>();
            FirebaseResponse response28 = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahBM");

            BM bM = response28.ResultAs <BM>();
            FirebaseResponse response29 = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahPM");

            PM pM = response29.ResultAs <PM>();
            FirebaseResponse response30 = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahK");

            K ks = response30.ResultAs <K>();
            FirebaseResponse response31 = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahS");

            S ss = response31.ResultAs <S>();
            FirebaseResponse response32 = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahM");

            M ms = response32.ResultAs <M>();
            FirebaseResponse response33 = await client.GetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahIsidata");

            IsiData isiData = response33.ResultAs <IsiData>();

            var dataNama = new DataNama
            {
                Nonam = (Convert.ToInt32(get1.jmlNama) + 1).ToString(),
                Nama  = textBox1.Text
            };

            var dataisi = new DataIsi
            {
                Sno             = (Convert.ToInt32(isiData.jmlIsiandata) + 1).ToString(),
                Sname           = textBox1.Text,
                Shp             = textBox2.Text,
                Sagama          = comboBox1.Text,
                Spekerjaan      = comboBox2.Text,
                Spendidikan     = comboBox3.Text,
                Sstatus         = comboBox4.Text,
                Stanggallahirss = dateTimePicker1.Text
            };
            var laki = new Laki
            {
                SKelamin = "Laki-Laki"
            };
            var perempuan = new Perempuan
            {
                SKelamin = "Perempuan"
            };
            var pilk = new PilK
            {
                SPilihan = "K"
            };
            var pils = new PilS
            {
                SPilihan = "S"
            };
            var pilm = new PilM
            {
                SPilihan = "M"
            };

            var obj1 = new NoNama
            {
                jmlNama = dataNama.Nonam
            };

            var obj2 = new NoLaki
            {
                jmlLaki = (Convert.ToInt32(genderLaki.jmlLaki) + 1).ToString()
            };
            var obj0 = new NoIsiData
            {
                jmlIsiandata = dataisi.Sno
            };

            var obj3 = new NoCewek
            {
                jmlcewek = (Convert.ToInt32(genderCewek.jmlcewek) + 1).ToString()
            };

            var obj4 = new NoIslam
            {
                jmlIslam = (Convert.ToInt32(islam.jmlIslam) + 1).ToString()
            };
            var obj5 = new NoKristen
            {
                jmlKristen = (Convert.ToInt32(kristen.jmlKristen) + 1).ToString()
            };
            var obj6 = new NoKatholik
            {
                jmlKatholik = (Convert.ToInt32(katholik.jmlKatholik) + 1).ToString()
            };
            var obj7 = new NoHindu
            {
                jmlHindu = (Convert.ToInt32(hindu.jmlHindu) + 1).ToString()
            };
            var obj8 = new NoBudha
            {
                jmlBudha = (Convert.ToInt32(bundha.jmlBudha) + 1).ToString()
            };
            var obj9 = new NoKonghucu
            {
                jmlKonghucu = (Convert.ToInt32(konghucu.jmlKonghucu) + 1).ToString()
            };
            var obj10 = new NoPetani
            {
                jmlPetani = (Convert.ToInt32(petani.jmlPetani) + 1).ToString()
            };
            var obj11 = new NoNelayan
            {
                jmlNelayan = (Convert.ToInt32(nelayan.jmlNelayan) + 1).ToString()
            };
            var obj12 = new NoPedagang
            {
                jmlPedagang = (Convert.ToInt32(pedagang.jmlPedagang) + 1).ToString()
            };
            var obj13 = new NoPTP
            {
                jmlPTP = (Convert.ToInt32(pTP.jmlPTP) + 1).ToString()
            };
            var obj14 = new NoSwasta
            {
                jmlSwasta = (Convert.ToInt32(swasta.jmlSwasta) + 1).ToString()
            };
            var obj15 = new NoBuruh
            {
                jmlBuruh = (Convert.ToInt32(buruh.jmlburuh) + 1).ToString()
            };
            var obj16 = new NoWiraswasta
            {
                jmlWiraswasta = (Convert.ToInt32(wiraswasta.jmlWiraswasta) + 1).ToString()
            };
            var obj17 = new NoPensiunan
            {
                jmlPensiunan = (Convert.ToInt32(pensiunan.jmlPensiunan) + 1).ToString()
            };
            var obj18 = new NoPelajar
            {
                jmlPElajar = (Convert.ToInt32(pelajar.jmlpelajar) + 1).ToString()
            };
            var obj19 = new NoTidakkerja
            {
                jmlTidakkerja = (Convert.ToInt32(tidakkerja.jmlTidakkerja) + 1).ToString()
            };
            var obj20 = new NoTK
            {
                jmlTK = (Convert.ToInt32(tK.jmlTK) + 1).ToString()
            };
            var obj21 = new NoSD
            {
                jmlSD = (Convert.ToInt32(sD.jmlSD) + 1).ToString()
            };
            var obj22 = new NoSMP
            {
                jmlSMP = (Convert.ToInt32(sMP.jmlSMP) + 1).ToString()
            };
            var obj23 = new NoSMA
            {
                jmlSMA = (Convert.ToInt32(sMA.jmlSMA) + 1).ToString()
            };
            var obj24 = new NoS1
            {
                jmlS1 = (Convert.ToInt32(s1.jmlS1) + 1).ToString()
            };
            var obj25 = new NoS2
            {
                jmlS2 = (Convert.ToInt32(s2.jmlS2) + 1).ToString()
            };
            var obj26 = new NoS3
            {
                jmlS3 = (Convert.ToInt32(s3.jmlS3) + 1).ToString()
            };
            var obj27 = new NoTidaksekolah
            {
                jmlTidaksekolah = (Convert.ToInt32(tidaksekolah.jmlTidaksekolah) + 1).ToString()
            };
            var obj28 = new NoSM
            {
                jmlSM = (Convert.ToInt32(sM.jmlSM) + 1).ToString()
            };
            var obj29 = new NoBM
            {
                jmlBM = (Convert.ToInt32(bM.jmlBM) + 1).ToString()
            };
            var obj30 = new NoPM
            {
                jmlPM = (Convert.ToInt32(pM.jmlPM) + 1).ToString()
            };
            var obj31 = new NoK
            {
                jmlK = (Convert.ToInt32(ks.jmlK) + 1).ToString()
            };
            var obj32 = new NoS
            {
                jmlS = (Convert.ToInt32(ss.jmlS) + 1).ToString()
            };
            var obj33 = new NoM
            {
                jmlM = (Convert.ToInt32(ms.jmlM) + 1).ToString()
            };
            var pk = new PK
            {
                jmlK = (Convert.ToInt32(ks.jmlK) + 1).ToString()
            };
            var ps = new PS
            {
                jmlS = (Convert.ToInt32(ss.jmlS) + 1).ToString()
            };
            var pm = new Pm
            {
                jmlM = (Convert.ToInt32(ms.jmlM) + 1).ToString()
            };



            SetResponse resp = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/Nama/" + dataNama.Nonam, dataNama);

            DataNama    result1 = resp1.ResultAs <DataNama>();
            SetResponse resp3   = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahNama/", obj1);

            //Isidata
            SetResponse response34 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/Data/" + dataisi.Sno, dataisi);

            DataIsi     dataIsi    = response34.ResultAs <DataIsi>();
            SetResponse response35 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahIsidata/", obj0);

            if (radioButton1.Checked)
            {
                SetResponse response1 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahLaki/", obj2);

                SetResponse response36 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/Data/" + dataisi.Sno, laki);

                Laki laki1 = response36.ResultAs <Laki>();
            }

            else if (radioButton2.Checked)
            {
                SetResponse response1 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahPerempuan/", obj3);

                SetResponse response37 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/Data/" + dataisi.Sno, perempuan);

                Perempuan perempuan1 = response37.ResultAs <Perempuan>();
            }

            if (comboBox1.Text == "Islam")
            {
                SetResponse response1 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahIslam/", obj4);
            }
            if (comboBox1.Text == "Kristen")
            {
                SetResponse response1 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahKristen/", obj5);
            }
            if (comboBox1.Text == "Katholik")
            {
                SetResponse response1 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahKatholik/", obj6);
            }
            if (comboBox1.Text == "Hindu")
            {
                SetResponse response1 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahHindu/", obj7);
            }
            if (comboBox1.Text == "Budha")
            {
                SetResponse response1 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahBudha/", obj8);
            }
            if (comboBox1.Text == "Konghucu")
            {
                SetResponse response1 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahKonghucu/", obj9);
            }
            if (comboBox2.Text == "Petani")
            {
                SetResponse response1 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahPetani/", obj10);
            }
            if (comboBox2.Text == "Nelayan")
            {
                SetResponse response1 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahNelayan/", obj11);
            }
            if (comboBox2.Text == "Pedagang")
            {
                SetResponse response1 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahPedagang/", obj12);
            }
            if (comboBox2.Text == "PNS/TNI/POLRI")
            {
                SetResponse response1 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahPTP/", obj13);
            }
            if (comboBox2.Text == "Pegawai Swasta")
            {
                SetResponse response1 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahSwasta/", obj14);
            }
            if (comboBox2.Text == "Buruh")
            {
                SetResponse response1 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahBuruh/", obj15);
            }
            if (comboBox2.Text == "Wiraswasta")
            {
                SetResponse response1 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahWiraswasta/", obj16);
            }
            if (comboBox2.Text == "Pensiunan")
            {
                SetResponse response1 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahPensiunan/", obj17);
            }
            if (comboBox2.Text == "Pelajar/Mahasiswa")
            {
                SetResponse response1 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahPelahar/", obj18);
            }
            if (comboBox2.Text == "Tidak Bekerja")
            {
                SetResponse response1 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahTidakkerja/", obj19);
            }
            if (comboBox3.Text == "TK")
            {
                SetResponse response1 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahTK/", obj20);
            }
            if (comboBox3.Text == "SD")
            {
                SetResponse response1 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahSD/", obj21);
            }
            if (comboBox3.Text == "SMP")
            {
                SetResponse response1 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahSMP/", obj22);
            }
            if (comboBox3.Text == "SMA/SMK")
            {
                SetResponse response1 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahSMA/", obj23);
            }
            if (comboBox3.Text == "S1")
            {
                SetResponse response1 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahS1/", obj24);
            }
            if (comboBox3.Text == "S2")
            {
                SetResponse response1 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahS2/", obj25);
            }
            if (comboBox3.Text == "S3")
            {
                SetResponse response1 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahS3/", obj26);
            }
            if (comboBox3.Text == "Tidak Sekolah")
            {
                SetResponse response1 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahTidaksekolah/", obj27);
            }
            if (comboBox4.Text == "Sudah Menikah")
            {
                SetResponse response1 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahSM/", obj28);
            }
            if (comboBox4.Text == "Belum Menikah")
            {
                SetResponse response1 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahBM/", obj29);
            }
            if (comboBox4.Text == "Pernah Menikah")
            {
                SetResponse response1 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahPM/", obj30);
            }

            if (comboBox5.Text == "K")
            {
                SetResponse response1 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahK/", pk);

                K           k          = response1.ResultAs <K>();
                SetResponse response38 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/Data/" + dataisi.Sno, pilk);

                Pilihank pilihank1 = response38.ResultAs <Pilihank>();
            }

            if (comboBox5.Text == "S")
            {
                SetResponse response1 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahS/", ps);

                S           s          = response1.ResultAs <S>();
                SetResponse response39 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/Data/" + dataisi.Sno, pils);

                Pilihans pilihans1 = response39.ResultAs <Pilihans>();
            }

            if (comboBox5.Text == "M")
            {
                SetResponse response1 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/JumlahM/", pm);

                M           m          = response1.ResultAs <M>();
                SetResponse response40 = await client.SetTaskAsync("Data User/" + label13.Text + label14.Text + label15.Text + label16.Text + "/Data/" + dataisi.Sno, pilm);

                Pilihanm pilihanm1 = response40.ResultAs <Pilihanm>();
            }

            this.Close();
        }
예제 #3
0
        private async void button1_Click(object sender, EventArgs e)
        {
            FirebaseResponse resp1 = await client.GetTaskAsync("Data User/" + label4.Text + "/JumlahKecamatan/");

            NoKecamatan      get1  = resp1.ResultAs <NoKecamatan>();
            FirebaseResponse resp2 = await client.GetTaskAsync("Data User/" + label4.Text + "/JumlahDesa/");

            NoDesa get2 = resp2.ResultAs <NoDesa>();

            var DataKecamatan = new InTambahData
            {
                NoKec   = (Convert.ToInt32(get1.jmlKecamatan) + 1).ToString(),
                NamaKec = textBox1.Text
            };

            var DataDesa = new InTambahDataDesa
            {
                NoDes   = (Convert.ToInt32(get2.jmlDesa) + 1).ToString(),
                NamaDes = textBox2.Text
            };
            var obj2 = new NoDesa
            {
                jmlDesa = DataDesa.NoDes
            };
            var obj1 = new NoKecamatan
            {
                jmlKecamatan = DataKecamatan.NoKec
            };

            if (textBox1.Text == "")
            {
                SetResponse resp4 = await client.SetTaskAsync("Data User/" + label4.Text + "/Desa/" + DataDesa.NoDes, DataDesa);

                InTambahDataDesa re4   = resp4.ResultAs <InTambahDataDesa>();
                SetResponse      resp6 = await client.SetTaskAsync("Data User/" + label4.Text + "/JumlahDesa/", obj2);
            }
            else if (textBox2.Text == "")
            {
                SetResponse resp3 = await client.SetTaskAsync("Data User/" + label4.Text + "/Kecamatan/" + DataKecamatan.NoKec, DataKecamatan);

                InTambahData res3  = resp3.ResultAs <InTambahData>();
                SetResponse  resp5 = await client.SetTaskAsync("Data User/" + label4.Text + "/JumlahKecamatan/", obj1);
            }
            else
            {
                SetResponse resp3 = await client.SetTaskAsync("Data User/" + label4.Text + "/Kecamatan/" + DataKecamatan.NoKec, DataKecamatan);

                InTambahData re3 = resp3.ResultAs <InTambahData>();

                SetResponse resp4 = await client.SetTaskAsync("Data User/" + label4.Text + "/Desa/" + DataDesa.NoDes, DataDesa);

                InTambahDataDesa res4 = resp4.ResultAs <InTambahDataDesa>();

                SetResponse resp5 = await client.SetTaskAsync("Data User/" + label4.Text + "/JumlahKecamatan/", obj1);

                SetResponse resp6 = await client.SetTaskAsync("Data User/" + label4.Text + "/JumlahDesa/", obj2);
            }

            var isidata = new IsiData
            {
                jmlIsiandata = "0"
            };

            var kec = new NoKecamatan
            {
                jmlKecamatan = "0"
            };

            var des = new NoDesa
            {
                jmlDesa = "0"
            };

            var nam = new NoNama
            {
                jmlNama = "0"
            };

            var genderlaki = new GenderLaki
            {
                jmlLaki = "0"
            };
            var gendercewek = new GenderCewek
            {
                jmlcewek = "0"
            };
            var islam = new Islam
            {
                jmlIslam = "0"
            };
            var kristen = new Kristen
            {
                jmlKristen = "0"
            };
            var katholik = new Katholik
            {
                jmlKatholik = "0"
            };
            var hindu = new Hindu
            {
                jmlHindu = "0"
            };
            var budha = new Bundha
            {
                jmlBudha = "0"
            };
            var konghucu = new Konghucu
            {
                jmlKonghucu = "0"
            };
            var petani = new Petani
            {
                jmlPetani = "0"
            };
            var nelayan = new Nelayan
            {
                jmlNelayan = "0"
            };
            var pedagang = new Pedagang
            {
                jmlPedagang = "0"
            };
            var ptp = new PTP
            {
                jmlPTP = "0"
            };
            var swasta = new Swasta
            {
                jmlSwasta = "0"
            };
            var buruh = new Buruh
            {
                jmlburuh = "0"
            };
            var wiraswasta = new Wiraswasta
            {
                jmlWiraswasta = "0"
            };
            var pensiunan = new Pensiunan
            {
                jmlPensiunan = "0"
            };
            var pelajar = new Pelajar
            {
                jmlpelajar = "0"
            };
            var tidakkerja = new Tidakkerja
            {
                jmlTidakkerja = "0"
            };
            var tk = new TK
            {
                jmlTK = "0"
            };
            var sd = new SD
            {
                jmlSD = "0"
            };
            var smp = new SMP
            {
                jmlSMP = "0"
            };
            var sma = new SMA
            {
                jmlSMA = "0"
            };
            var s1 = new S1
            {
                jmlS1 = "0"
            };
            var s2 = new S2
            {
                jmlS2 = "0"
            };
            var s3 = new S3
            {
                jmlS3 = "0"
            };
            var tidaksekolah = new Tidaksekolah
            {
                jmlTidaksekolah = "0"
            };
            var sm = new SM
            {
                jmlSM = "0"
            };
            var bm = new BM
            {
                jmlBM = "0"
            };
            var pm = new PM
            {
                jmlPM = "0"
            };
            var k = new K
            {
                jmlK = "0"
            };
            var s = new S
            {
                jmlS = "0"
            };
            var m = new M
            {
                jmlM = "0"
            };
            var kk = new KKs
            {
                jmlkk = textBox3.Text
            };


            SetResponse response0 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahKK/", kk);

            data        result0   = response0.ResultAs <data>();
            SetResponse response1 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahKecamatan/", kec);

            data        result1   = response1.ResultAs <data>();
            SetResponse response2 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahDesa/", des);

            data        result2   = response2.ResultAs <data>();
            SetResponse response3 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahNama/", nam);

            NoNama      result3   = response3.ResultAs <NoNama>();
            SetResponse response4 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahLaki/", genderlaki);

            GenderLaki  result4   = response4.ResultAs <GenderLaki>();
            SetResponse response5 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahPerempuan/", gendercewek);

            GenderCewek result5   = response5.ResultAs <GenderCewek>();
            SetResponse response6 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahIslam/", islam);

            Islam       islam1    = response6.ResultAs <Islam>();
            SetResponse response7 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahKristen/", kristen);

            Kristen     kristen1  = response7.ResultAs <Kristen>();
            SetResponse response8 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahKatholik/", katholik);

            Katholik    katholik1 = response8.ResultAs <Katholik>();
            SetResponse response9 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahHindu/", hindu);

            Hindu       hindu1     = response9.ResultAs <Hindu>();
            SetResponse response10 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahBudha/", budha);

            Bundha      bundha     = response10.ResultAs <Bundha>();
            SetResponse response11 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahKonghucu/", konghucu);

            Konghucu    konghucu1  = response11.ResultAs <Konghucu>();
            SetResponse response12 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahPetani/", petani);

            Petani      petani1    = response12.ResultAs <Petani>();
            SetResponse response13 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahNelayan/", nelayan);

            Nelayan     nelayan1   = response13.ResultAs <Nelayan>();
            SetResponse response14 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahPedagang/", pedagang);

            Pedagang    pedagang1  = response14.ResultAs <Pedagang>();
            SetResponse response15 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahPTP/", ptp);

            PTP         pTP        = response15.ResultAs <PTP>();
            SetResponse response16 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahSwasta/", swasta);

            Swasta      swasta1    = response16.ResultAs <Swasta>();
            SetResponse response17 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahBuruh/", buruh);

            Buruh       buruh1     = response17.ResultAs <Buruh>();
            SetResponse response18 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahWiraswasta/", wiraswasta);

            Wiraswasta  wiraswasta1 = response18.ResultAs <Wiraswasta>();
            SetResponse response19  = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahPensiunan/", pensiunan);

            Pensiunan   pensiunan1 = response19.ResultAs <Pensiunan>();
            SetResponse response20 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahPelajar/", pelajar);

            Pelajar     pelajar1   = response20.ResultAs <Pelajar>();
            SetResponse response21 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahTidakkerja/", tidakkerja);

            Tidakkerja  tidakkerja1 = response21.ResultAs <Tidakkerja>();
            SetResponse response22  = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahTK/", tk);

            TK          tK         = response22.ResultAs <TK>();
            SetResponse response23 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahSD/", sd);

            SD          sD         = response23.ResultAs <SD>();
            SetResponse response24 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahSMP/", smp);

            SMP         sMP        = response24.ResultAs <SMP>();
            SetResponse response25 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahSMA/", sma);

            SMA         sMA        = response25.ResultAs <SMA>();
            SetResponse response26 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahS1/", s1);

            S1          s11        = response26.ResultAs <S1>();
            SetResponse response27 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahS2/", s2);

            S2          s21        = response27.ResultAs <S2>();
            SetResponse response28 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahS3/", s3);

            S3          s31        = response28.ResultAs <S3>();
            SetResponse response29 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahTidaksekolah/", tidaksekolah);

            Tidaksekolah tidaksekolah1 = response29.ResultAs <Tidaksekolah>();
            SetResponse  response30    = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahSM/", sm);

            SM          sM         = response30.ResultAs <SM>();
            SetResponse response31 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahBM/", bm);

            BM          bM         = response31.ResultAs <BM>();
            SetResponse response32 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahPM/", pm);

            PM          pM         = response32.ResultAs <PM>();
            SetResponse response33 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahK/", k);

            K           ks         = response33.ResultAs <K>();
            SetResponse response34 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahS/", s);

            S           ss         = response34.ResultAs <S>();
            SetResponse response35 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahM/", m);

            M           ms         = response35.ResultAs <M>();
            SetResponse response36 = await client.SetTaskAsync("Data User/" + label4.Text + textBox1.Text + textBox2.Text + comboBox1.Text + "/JumlahIsidata", isidata);

            this.Close();
            Peringatan peringatan = new Peringatan();

            peringatan.Show();
        }