Example #1
0
        private async void button2_Click(object sender, EventArgs e)
        {
            dt2.Rows.Clear();
            int              i        = 0;
            IFirebaseClient  client   = new FireSharp.FirebaseClient(config);
            FirebaseResponse response = await client.GetTaskAsync("Counter");

            counter ctn = response.ResultAs <counter>();

            while (true)
            {
                i++;
                if (i > ctn.M)
                {
                    break;
                }

                FirebaseResponse responseNilai = await client.GetTaskAsync("Penilaian/" + i);

                Penilaian obj = responseNilai.ResultAs <Penilaian>();
                DataRow   dr  = dt2.NewRow();
                dr["Nama"] = obj.nama;
                dr["NIP"]  = obj.nip;
                dr["Dokumen Portofolio"]       = obj.C5;
                dr["Kinerja Guru"]             = obj.C2;
                dr["Presentasi Best Practice"] = obj.C3;
                dr["Wawancara"]  = obj.C4;
                dr["Test Tulis"] = obj.C1;
                dt2.Rows.Add(dr);
            }
        }
Example #2
0
        private async void button2_Click(object sender, EventArgs e)
        {
            try
            {
                IFirebaseClient  client   = new FireSharp.FirebaseClient(config);
                FirebaseResponse resNilai = await client.GetTaskAsync("Penilaian/" + baris);

                Penilaian ambil = resNilai.ResultAs <Penilaian>();
                var       nilai = new Penilaian
                {
                    nama     = label1.Text,
                    nip      = ambil.nip,
                    username = ambil.username,
                    C5       = Convert.ToSingle(textBox1.Text),
                    C2       = Convert.ToSingle(textBox2.Text),
                    C3       = Convert.ToSingle(textBox3.Text),
                    C4       = Convert.ToSingle(textBox4.Text),
                    C1       = Convert.ToSingle(textBox5.Text),
                };
                FirebaseResponse update = await client.UpdateTaskAsync("Penilaian/" + baris, nilai);

                Penilaian pen1 = update.ResultAs <Penilaian>();
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Example #3
0
        private async void button1_Click(object sender, EventArgs e)
        {
            try
            {
                IFirebaseClient  client     = new FireSharp.FirebaseClient(config);
                FirebaseResponse resPenilan = await client.GetTaskAsync("Penilaian/" + baris);

                Penilaian        ambil   = resPenilan.ResultAs <Penilaian>();
                FirebaseResponse resData = await client.GetTaskAsync("User_Account/" + baris);

                Data data = resData.ResultAs <Data>();
                var  akun = new Data
                {
                    namaDepan    = textBox2.Text,
                    namaBelakang = textBox1.Text,
                    nip          = textBox3.Text,
                    tglLahir     = textBox4.Text,
                    sekolah      = textBox6.Text,
                    pangkatGol   = comboBox1.Text,
                    mapel        = comboBox2.Text,
                    username     = textBox8.Text,
                    pwd          = textBox9.Text
                };

                var nilai = new Penilaian
                {
                    nama     = textBox2.Text + " " + textBox1.Text,
                    nip      = textBox3.Text,
                    username = textBox8.Text,
                    C1       = ambil.C1,
                    C2       = ambil.C2,
                    C3       = ambil.C3,
                    C4       = ambil.C4,
                    C5       = ambil.C5
                };

                FirebaseResponse response1 = await client.UpdateTaskAsync("User_Account/" + baris, akun);

                Data data1 = response1.ResultAs <Data>();

                FirebaseResponse response2 = await client.UpdateTaskAsync("Penilaian/" + baris, nilai);

                Penilaian penNilai = response2.ResultAs <Penilaian>();

                MessageBox.Show("Edit Berhasi", "Smart Teacher", MessageBoxButtons.OK, MessageBoxIcon.None);
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Example #4
0
        private async void DialogEditRanking_Load(object sender, EventArgs e)
        {
            IFirebaseClient  client = new FireSharp.FirebaseClient(config);
            FirebaseResponse resPen = await client.GetTaskAsync("Penilaian/" + baris);

            Penilaian pen = resPen.ResultAs <Penilaian>();

            label1.Text   = pen.nama;
            textBox1.Text = pen.C5.ToString();
            textBox2.Text = pen.C2.ToString();
            textBox3.Text = pen.C3.ToString();
            textBox4.Text = pen.C4.ToString();
            textBox5.Text = pen.C1.ToString();
        }
Example #5
0
        private async void WaktuHabis_Load(object sender, EventArgs e)
        {
            circularProgressBar1.Minimum = 0;
            circularProgressBar1.Value   = 0;
            client = new FireSharp.FirebaseClient(config);
            int              i         = 0;
            double           nilai2    = (nilai * 10) / 3;
            FirebaseResponse responseM = await client.GetTaskAsync("Counter");

            counter ctn = responseM.ResultAs <counter>();

            circularProgressBar1.Maximum = ctn.M;
            while (true)
            {
                circularProgressBar1.Value = i;
                i++;
                if (i > ctn.M)
                {
                    break;
                }

                FirebaseResponse response = await client.GetTaskAsync("User_Account/" + i);

                Data data = response.ResultAs <Data>();
                if (username == data.username)
                {
                    var penilaian = new Penilaian
                    {
                        nama     = data.namaDepan + data.namaBelakang,
                        nip      = data.nip,
                        C1       = Convert.ToSingle(string.Format("{0:0.##}", nilai2)),
                        C2       = 0,
                        C3       = 0,
                        C4       = 0,
                        C5       = 0,
                        username = data.username
                    };
                    FirebaseResponse updt = await client.UpdateTaskAsync("Penilaian/" + i, penilaian);

                    Penilaian pn = updt.ResultAs <Penilaian>();
                }
            }
            var   ss  = new SoalSelesai();
            Soal1 obj = (Soal1)Application.OpenForms["Soal1"];

            obj.Close();
            this.Close();
            ss.Show();
        }
Example #6
0
        private async void dataGridView2_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            if (dataGridView2.CurrentRow != null)
            {
                string           awal, akhir;
                IFirebaseClient  client     = new FireSharp.FirebaseClient(config);
                DataGridViewRow  dgv        = dataGridView2.CurrentRow;
                int              i          = dgv.Index + 1;
                FirebaseResponse resPenilan = await client.GetTaskAsync("User_Account/" + i);

                Data     ambil         = resPenilan.ResultAs <Data>();
                string[] returnedArray = dgv.Cells[0].Value.ToString().Split(new[] { ' ' }, 2);
                awal  = returnedArray[0];
                akhir = returnedArray[1];

                var data = new Data
                {
                    namaDepan    = awal,
                    namaBelakang = akhir,
                    nip          = dgv.Cells[1].Value.ToString(),
                    tglLahir     = ambil.tglLahir,
                    pangkatGol   = ambil.pangkatGol,
                    sekolah      = ambil.sekolah,
                    mapel        = ambil.mapel,
                    username     = ambil.username,
                    pwd          = ambil.pwd
                };

                var nilai = new Penilaian
                {
                    nama     = dgv.Cells[0].Value.ToString(),
                    nip      = dgv.Cells[1].Value.ToString(),
                    username = ambil.username,
                    C1       = Convert.ToSingle(dgv.Cells[6].Value),
                    C2       = Convert.ToSingle(dgv.Cells[3].Value),
                    C3       = Convert.ToSingle(dgv.Cells[4].Value),
                    C4       = Convert.ToSingle(dgv.Cells[5].Value),
                    C5       = Convert.ToSingle(dgv.Cells[2].Value),
                };
                FirebaseResponse response1 = await client.UpdateTaskAsync("User_Account/" + i, data);

                Data data1 = response1.ResultAs <Data>();

                FirebaseResponse response2 = await client.UpdateTaskAsync("Penilaian/" + i, nilai);

                Penilaian penNilai = response2.ResultAs <Penilaian>();
            }
        }
Example #7
0
        private async void button2_Click(object sender, EventArgs e)
        {
            if (checkBox1.Checked)
            {
                int              i         = 0;
                double           nilai2    = (nilai * 10) / 3;
                FirebaseResponse responseM = await client.GetTaskAsync("Counter");

                counter ctn = responseM.ResultAs <counter>();
                while (true)
                {
                    i++;
                    if (i > ctn.M)
                    {
                        break;
                    }

                    FirebaseResponse response = await client.GetTaskAsync("User_Account/" + i);

                    Data data = response.ResultAs <Data>();
                    if (username == data.username)
                    {
                        var penilaian = new Penilaian
                        {
                            nama     = data.namaDepan + data.namaBelakang,
                            nip      = data.nip,
                            C1       = Convert.ToSingle(string.Format("{0:0.##}", nilai2)),
                            C2       = 0,
                            C3       = 0,
                            C4       = 0,
                            C5       = 0,
                            username = data.username
                        };
                        FirebaseResponse updt = await client.UpdateTaskAsync("Penilaian/" + i, penilaian);

                        Penilaian pn = updt.ResultAs <Penilaian>();
                    }
                }
                var   ss  = new SoalSelesai();
                Soal1 obj = (Soal1)Application.OpenForms["Soal1"];
                obj.Close();
                this.Close();
                ss.Show();
            }
        }
Example #8
0
        //Edit value Tabel
        private async void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            IFirebaseClient client = new FireSharp.FirebaseClient(config);

            if (dataGridView1.CurrentRow != null)
            {
                DataGridViewRow  dgv        = dataGridView1.CurrentRow;
                int              i          = dgv.Index + 1;
                FirebaseResponse resPenilan = await client.GetTaskAsync("Penilaian/" + i);

                Penilaian ambil = resPenilan.ResultAs <Penilaian>();
                var       data  = new Data
                {
                    namaDepan    = dgv.Cells[0].Value.ToString(),
                    namaBelakang = dgv.Cells[1].Value.ToString(),
                    nip          = dgv.Cells[2].Value.ToString(),
                    tglLahir     = dgv.Cells[3].Value.ToString(),
                    pangkatGol   = dgv.Cells[4].Value.ToString(),
                    sekolah      = dgv.Cells[5].Value.ToString(),
                    mapel        = dgv.Cells[6].Value.ToString(),
                    username     = dgv.Cells[7].Value.ToString(),
                    pwd          = dgv.Cells[8].Value.ToString()
                };

                var nilai = new Penilaian
                {
                    nama     = dgv.Cells[0].Value.ToString() + " " + dgv.Cells[1].Value.ToString(),
                    nip      = dgv.Cells[2].Value.ToString(),
                    username = dgv.Cells[7].Value.ToString(),
                    C1       = ambil.C1,
                    C2       = ambil.C2,
                    C3       = ambil.C3,
                    C4       = ambil.C4,
                    C5       = ambil.C5
                };
                FirebaseResponse response1 = await client.UpdateTaskAsync("User_Account/" + i, data);

                Data data1 = response1.ResultAs <Data>();

                FirebaseResponse response2 = await client.UpdateTaskAsync("Penilaian/" + i, nilai);

                Penilaian penNilai = response2.ResultAs <Penilaian>();
            }
        }
Example #9
0
        public async void koneksi()
        {
            int i = 0;
            FirebaseResponse resAkun = await client.GetTaskAsync("Counter");

            counter ctn = resAkun.ResultAs <counter>();

            circularProgressBar1.Maximum = ctn.M;
            while (true)
            {
                circularProgressBar1.Visible = true;
                label22.Visible            = true;
                circularProgressBar1.Value = i;
                i++;
                if (i > ctn.M)
                {
                    circularProgressBar1.Visible = false;
                    label22.Visible = false;
                    break;
                }
                FirebaseResponse response = await client.GetTaskAsync("User_Account/" + i);

                Data             obj    = response.ResultAs <Data>();
                FirebaseResponse resPen = await client.GetTaskAsync("Penilaian/" + i);

                Penilaian pen = resPen.ResultAs <Penilaian>();
                if (username == obj.username)
                {
                    label10.Text = obj.nip;
                    label11.Text = obj.namaDepan + " " + obj.namaBelakang;
                    label12.Text = obj.mapel;
                    label13.Text = obj.sekolah;
                }
                if (pen.username == username && pen.C1 == 0)
                {
                    label19.Text = "Belum Mengikuti";
                }
                else if (pen.username == username && pen.C1 != 0)
                {
                    label19.Text    = "Sudah Mengikuti";
                    button3.Enabled = false;
                }
            }
        }
Example #10
0
        private async void ranking_Load(object sender, EventArgs e)
        {
            foreach (DataGridViewColumn column in dataGridView2.Columns)
            {
                column.SortMode = DataGridViewColumnSortMode.NotSortable;
            }
            int i = 0;

            loadgrid2();
            loadgrid1();
            IFirebaseClient client = new FireSharp.FirebaseClient(config);

            this.dataGridView1.Sort(this.dataGridView1.Columns["Nilai Akhir"], ListSortDirection.Descending);


            FirebaseResponse response = await client.GetTaskAsync("Counter");

            counter ctn = response.ResultAs <counter>();

            while (true)
            {
                i++;
                if (i > ctn.M)
                {
                    break;
                }

                FirebaseResponse responseNilai = await client.GetTaskAsync("Penilaian/" + i);

                Penilaian obj = responseNilai.ResultAs <Penilaian>();
                DataRow   dr  = dt2.NewRow();
                dr["Nama"] = obj.nama;
                dr["NIP"]  = obj.nip;
                dr["Dokumen Portofolio"]       = obj.C5;
                dr["Kinerja Guru"]             = obj.C2;
                dr["Presentasi Best Practice"] = obj.C3;
                dr["Wawancara"]  = obj.C4;
                dr["Test Tulis"] = obj.C1;
                dt2.Rows.Add(dr);
            }
        }
Example #11
0
        private async void UserControl2_Load(object sender, EventArgs e)
        {
            label7.Text = string.Empty;
            circularProgressBar1.Value   = 0;
            circularProgressBar1.Minimum = 0;
            client = new FireSharp.FirebaseClient(config);
            int i = 0;
            FirebaseResponse resAkun = await client.GetTaskAsync("Counter");

            counter ctn = resAkun.ResultAs <counter>();

            circularProgressBar1.Maximum = ctn.M;
            while (true)
            {
                label8.Visible             = true;
                panel3.Visible             = true;
                circularProgressBar1.Value = i;
                i++;
                if (i > ctn.M)
                {
                    circularProgressBar1.Visible = false;
                    label8.Visible = false;
                    panel3.Visible = false;
                    break;
                }
                FirebaseResponse resPen = await client.GetTaskAsync("Penilaian/" + i);

                Penilaian pen = resPen.ResultAs <Penilaian>();
                if (pen.username == Menu.username && pen.C1 == 0)
                {
                    label7.Text = "Belum Mengikuti";
                    Menu.cek    = 0;
                }
                else if (pen.username == Menu.username && pen.C1 != 0)
                {
                    label7.Text = "Sudah Mengikuti";
                    Menu.cek    = 1;
                }
            }
        }
Example #12
0
        //Delete Button
        private async void button1_Click(object sender, EventArgs e)
        {
            IFirebaseClient client = new FireSharp.FirebaseClient(config);
            DialogResult    result = MessageBox.Show("Apakah Anda Yakin?", "Smart Teacher", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (result == DialogResult.Yes)
            {
                FirebaseResponse resCtn = await client.GetTaskAsync("Counter");

                counter ctn = resCtn.ResultAs <counter>();
                var     con = new counter
                {
                    M = ctn.M - 1
                };
                DataGridViewRow  dgv = dataGridView1.CurrentRow;
                int              i   = dgv.Index + 1;
                FirebaseResponse del = await client.DeleteTaskAsync("User_Account/" + i);

                FirebaseResponse delNilai = await client.DeleteTaskAsync("Penilaian/" + i);

                FirebaseResponse resUpdate = await client.UpdateTaskAsync("Counter", con);

                counter update = resUpdate.ResultAs <counter>();
                while (true)
                {
                    i++;
                    if (i > ctn.M)
                    {
                        break;
                    }
                    FirebaseResponse resNilai = await client.GetTaskAsync("Penilaian/" + i);

                    Penilaian        penNilai = resNilai.ResultAs <Penilaian>();
                    FirebaseResponse resData  = await client.GetTaskAsync("User_Account/" + i);

                    Data ambilData = resData.ResultAs <Data>();
                    var  nilai     = new Penilaian
                    {
                        nama     = penNilai.nama,
                        nip      = penNilai.nip,
                        username = penNilai.username,
                        C1       = penNilai.C1,
                        C2       = penNilai.C2,
                        C3       = penNilai.C3,
                        C4       = penNilai.C4,
                        C5       = penNilai.C5
                    };
                    var data = new Data
                    {
                        namaDepan    = ambilData.namaDepan,
                        namaBelakang = ambilData.namaBelakang,
                        nip          = ambilData.nip,
                        tglLahir     = ambilData.tglLahir,
                        pangkatGol   = ambilData.pangkatGol,
                        sekolah      = ambilData.sekolah,
                        mapel        = ambilData.mapel,
                        username     = ambilData.username,
                        pwd          = ambilData.pwd
                    };

                    SetResponse updateNilai = await client.SetTaskAsync("Penilaian/" + Convert.ToInt32(i - 1), nilai);

                    Penilaian   gantiNilai = updateNilai.ResultAs <Penilaian>();
                    SetResponse updateAkun = await client.SetTaskAsync("User_Account/" + Convert.ToInt32(i - 1), data);

                    Data gantiAkun = updateAkun.ResultAs <Data>();
                    if (i == ctn.M)
                    {
                        FirebaseResponse del1 = await client.DeleteTaskAsync("User_Account/" + i);

                        FirebaseResponse del2 = await client.DeleteTaskAsync("Penilaian/" + i);
                    }
                }
            }
        }
Example #13
0
        private async void button1_Click(object sender, EventArgs e)
        {
            try
            {
                var data = new Data
                {
                    namaDepan    = textBox10.Text,
                    namaBelakang = textBox9.Text,
                    nip          = textBox8.Text,
                    pangkatGol   = comboBox2.Text,
                    tglLahir     = textBox7.Text,
                    sekolah      = textBox6.Text,
                    mapel        = comboBox3.Text,
                    username     = textBox1.Text,
                    pwd          = textBox2.Text
                };

                if (textBox2.Text == textBox3.Text)
                {
                    circularProgressBar1.Visible = true;
                    FirebaseResponse responseakun = await client.GetTaskAsync("Counter");

                    counter ctn = responseakun.ResultAs <counter>();
                    int     i   = 0;
                    int     b   = 1;
                    while (true)
                    {
                        circularProgressBar1.Visible = true;
                        circularProgressBar1.Maximum = ctn.M;
                        circularProgressBar1.Minimum = 0;
                        circularProgressBar1.Value   = i;
                        i++;
                        if (i > ctn.M)
                        {
                            break;
                        }
                        FirebaseResponse responseambil = await client.GetTaskAsync("User_Account/" + i);

                        Data obj = responseambil.ResultAs <Data>();
                        if (textBox1.Text == obj.username)
                        {
                            MessageBox.Show("Maaf, Username Sudah Terpakai", "Registrasi", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            b = 2;
                            circularProgressBar1.Visible = false;
                            circularProgressBar1.Value   = 0;
                        }
                        else if (textBox8.Text == obj.nip)
                        {
                            MessageBox.Show("Maaf, Tidak Dapat menggunakan NIP Yang Anda Masukkan", "Registrasi", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            b = 2;
                            circularProgressBar1.Visible = false;
                            circularProgressBar1.Value   = 0;
                        }
                    }

                    if (b == 1)
                    {
                        circularProgressBar1.Visible = false;
                        var Counter = new counter
                        {
                            M = Convert.ToInt32(ctn.M + 1)
                        };
                        FirebaseResponse rsp = await client.UpdateTaskAsync("Counter", Counter);

                        counter     ctn1     = rsp.ResultAs <counter>();
                        SetResponse response = await client.SetTaskAsync("User_Account/" + i, data);

                        Data result = response.ResultAs <Data>();

                        var nilai = new Penilaian
                        {
                            nama     = result.namaDepan + " " + result.namaBelakang,
                            nip      = result.nip,
                            C1       = 0,
                            C2       = 0,
                            C3       = 0,
                            C4       = 0,
                            C5       = 0,
                            username = result.username
                        };

                        SetResponse pushNilai = await client.SetTaskAsync("Penilaian/" + i, nilai);

                        Penilaian pen = pushNilai.ResultAs <Penilaian>();
                    }

                    if (MessageBox.Show("Registrasi Berhasil", "Registrasi", MessageBoxButtons.OK) == DialogResult.OK)
                    {
                        var lgn = new Login();
                        this.Close();
                        lgn.Show();
                    }
                }
                else
                {
                    MessageBox.Show("Password Tidak Sama", "Register", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Example #14
0
        private async void button1_Click(object sender, EventArgs e)
        {
            dt.Rows.Clear();
            label3.Visible      = true;
            pictureBox1.Visible = true;
            foreach (DataGridViewColumn column in dataGridView1.Columns)
            {
                column.SortMode = DataGridViewColumnSortMode.NotSortable;
            }
            try
            {
                int c = 0;
                int k = 0;
                int i, j;
                double[,] result = new double[99, 99];
                double[,] salin  = new double[99, 99];
                double[,] temp   = new double[99, 99];
                double[,] temp2  = new double[99, 99];
                double[,] fix    = new double[99, 99];
                double[,] a      = new double[99, 99];
                double[] temporary        = new double[99];

                IFirebaseClient  client   = new FireSharp.FirebaseClient(config);
                FirebaseResponse delete   = await client.DeleteTaskAsync("Ranking");

                FirebaseResponse response = await client.GetTaskAsync("Counter/");

                counter bts               = response.ResultAs <counter>();
                //cetak matriks
                for (i = 1; i <= bts.M; i++)
                {
                    for (j = 1; j <= 5; j++)
                    {
                        FirebaseResponse responNilai = await client.GetTaskAsync("Penilaian/" + i);

                        Penilaian obj = responNilai.ResultAs <Penilaian>();
                        if (j == 1)
                        {
                            a[i, j]     = obj.C1;
                            salin[i, j] = obj.C1;
                        }
                        else if (j == 2)
                        {
                            a[i, j]     = obj.C2;
                            salin[i, j] = obj.C2;
                        }
                        else if (j == 3)
                        {
                            a[i, j]     = obj.C3;
                            salin[i, j] = obj.C3;
                        }
                        else if (j == 4)
                        {
                            a[i, j]     = obj.C4;
                            salin[i, j] = obj.C4;
                        }
                        else if (j == 5)
                        {
                            a[i, j]     = obj.C5;
                            salin[i, j] = obj.C5;
                        }
                        ////Debug.Write(string.Format("{0:N2} ", salin[i, j]));
                    }
                    ////Debug.WriteLine("");
                }
                //end cetak matriks

                //cetak hasil akar
                for (j = 1; j <= 5; j++)
                {
                    for (i = 1; i <= bts.M; i++)
                    {
                        if (i == 1)
                        {
                            salin[i + 1, j] = Math.Pow(salin[i + 1, j], 2) + Math.Pow(salin[i, j], 2);
                        }
                        else if (i > 1)
                        {
                            salin[i + 1, j] = Math.Pow(salin[i + 1, j], 2) + salin[i, j];
                        }
                        result[i, j] = Math.Sqrt(salin[i, j]);
                        //if (i % 2 == 0)
                        //{
                        Debug.WriteLine(result[i, j]);
                        // }
                    }
                }
                //end cetak hasil akar

                //cetak Xij + perkalian bobot
                Debug.WriteLine("");
                for (j = 1; j <= 5; j++)
                {
                    for (i = 1; i <= bts.M; i++)
                    {
                        temp[i, j] = a[i, j] / result[bts.M, j];
                        if (j == 1)
                        {
                            temp2[i, j] = temp[i, j] * 0.25;
                        }
                        else if (j == 2)
                        {
                            temp2[i, j] = temp[i, j] * 0.15;
                        }
                        else if (j == 3)
                        {
                            temp2[i, j] = temp[i, j] * 0.1;
                        }
                        else if (j == 4)
                        {
                            temp2[i, j] = temp[i, j] * 0.25;
                        }
                        else if (j == 5)
                        {
                            temp2[i, j] = temp[i, j] * 0.25;
                        }

                        Debug.Write(" " + temp2[i, j]);
                    }

                    Debug.WriteLine("");
                }

                Debug.WriteLine("");

                //penjumlahan kriteria beserta bobot
                for (i = 1; i <= bts.M; i++)
                {
                    for (j = 1; j <= 5; j++)
                    {
                        temp2[i, j + 1] = temp2[i, j + 1] + temp2[i, j];
                    }
                    temporary[i] = temp2[i, 5];
                    Debug.WriteLine(" " + temp2[i, 5]);
                }
                Debug.WriteLine("");


                while (true)
                {
                    DataRow dr = dt.NewRow();
                    k++;
                    if (k > bts.M)
                    {
                        c = 1;
                        break;
                    }
                    FirebaseResponse resAkun = await client.GetTaskAsync("User_Account/" + k);

                    Data data = resAkun.ResultAs <Data>();
                    dr["Nama"]             = data.namaDepan + " " + data.namaBelakang;
                    dr["NIP"]              = data.nip;
                    dr["Pangkat/Gol"]      = data.pangkatGol;
                    dr["Sekolah Mengajar"] = data.sekolah;
                    dr["Mapel"]            = data.mapel;
                    dr["Nilai Akhir"]      = temporary[k];
                    dt.Rows.Add(dr);
                    c = 1;
                }
                if (c == 1)
                {
                    k = 0;
                    while (true)
                    {
                        k++;
                        if (k > bts.M)
                        {
                            break;
                        }
                        FirebaseResponse resAkun = await client.GetTaskAsync("User_Account/" + k);

                        Data            data = resAkun.ResultAs <Data>();
                        DataGridViewRow dgv  = dataGridView1.Rows[k - 1];
                        if (dgv.Index < 3)
                        {
                            dgv.DefaultCellStyle.BackColor = Color.Green;
                        }
                        var nilaiFix = new Ranked
                        {
                            nama       = dgv.Cells[0].Value.ToString(),
                            nip        = dgv.Cells[1].Value.ToString(),
                            PangkatGol = dgv.Cells[2].Value.ToString(),
                            sekolah    = dgv.Cells[3].Value.ToString(),
                            mapel      = dgv.Cells[4].Value.ToString(),
                            nilaiAkhir = Convert.ToSingle(dgv.Cells[5].Value)
                        };
                        var hit = new RankCount
                        {
                            count = bts.M
                        };
                        SetResponse pushNilai = await client.SetTaskAsync("Ranking/" + k, nilaiFix);

                        Ranked           push        = pushNilai.ResultAs <Ranked>();
                        FirebaseResponse countUpdate = await client.UpdateTaskAsync("Count", hit);

                        RankCount hitUpdate = countUpdate.ResultAs <RankCount>();
                    }
                    FirebaseResponse realTime = await client.GetTaskAsync("Ranking/" + bts.M);

                    if (realTime.ResultAs <Ranked>() == null)
                    {
                        pictureBox1.Visible = true;
                        label3.Visible      = true;
                    }
                    pictureBox1.Visible = false;
                    label3.Visible      = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }