Exemplo n.º 1
0
        private async void Criteria_Load(object sender, EventArgs e)
        {
            int             i      = 0;
            IFirebaseClient client = new FireSharp.FirebaseClient(config);

            dt.Columns.Add("Nama Kriteria");
            dt.Columns.Add("Nilai Kriteria");
            dataGridView1.DataSource = dt;
            dataGridView1.Columns["Nama Kriteria"].Width = 700;

            while (true)
            {
                i++;
                if (i > 5)
                {
                    break;
                }
                FirebaseResponse response = await client.GetTaskAsync("Kriteria/" + i);

                Bobot   bobot = response.ResultAs <Bobot>();
                DataRow dr    = dt.NewRow();
                dr["Nama Kriteria"]  = bobot.Nama;
                dr["Nilai Kriteria"] = bobot.Nilai;
                dt.Rows.Add(dr);
            }
        }
Exemplo n.º 2
0
        private async void DialogEditCriteria_Load(object sender, EventArgs e)
        {
            IFirebaseClient  client   = new FireSharp.FirebaseClient(config);
            FirebaseResponse response = await client.GetTaskAsync("Kriteria/" + baris);

            Bobot bobot = response.ResultAs <Bobot>();

            label1.Text   = bobot.Nama;
            textBox1.Text = bobot.Nilai.ToString();
        }
Exemplo n.º 3
0
        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;
                var             gantiBobot = new Bobot
                {
                    Nama  = dgv.Cells[0].Value.ToString(),
                    Nilai = Convert.ToSingle(dgv.Cells[1].Value)
                };

                FirebaseResponse resBobot = await client.UpdateTaskAsync("Kriteria/" + i, gantiBobot);

                Bobot updt = resBobot.ResultAs <Bobot>();
            }
        }
Exemplo n.º 4
0
        private async void button1_Click(object sender, EventArgs e)
        {
            try
            {
                IFirebaseClient client = new FireSharp.FirebaseClient(config);
                var             bobot  = new Bobot
                {
                    Nama  = label1.Text,
                    Nilai = Convert.ToSingle(textBox1.Text)
                };
                FirebaseResponse update = await client.UpdateTaskAsync("Kriteria/" + baris, bobot);

                Bobot updateBobot = update.ResultAs <Bobot>();
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 5
0
        //Refresh Button
        private async void button1_Click(object sender, EventArgs e)
        {
            dt.Rows.Clear();
            int             i      = 0;
            IFirebaseClient client = new FireSharp.FirebaseClient(config);

            while (true)
            {
                i++;
                if (i > 5)
                {
                    break;
                }
                FirebaseResponse response = await client.GetTaskAsync("Kriteria/" + i);

                Bobot   bobot = response.ResultAs <Bobot>();
                DataRow dr    = dt.NewRow();
                dr["Nama Kriteria"]  = bobot.Nama;
                dr["Nilai Kriteria"] = bobot.Nilai;
                dt.Rows.Add(dr);
            }
        }