private async void NewsLine_Load(object sender, EventArgs e)
        {
            client = new FireSharp.FirebaseClient(config);
            FirebaseResponse res = null;

            res = await client.GetTaskAsync("NewsLineCnt/");

            countClass cc = res.ResultAs <countClass>();
            long       x  = Convert.ToInt64(cc.cnt.ToString());

            dt.Columns.Add("Post");
            dt.Columns.Add("Date");
            dt.Columns.Add("Time");
            dataGridView1.DataSource = dt;
            int i = 0;

            while (true)
            {
                i++;
                if (i > x)
                {
                    break;
                }
                FirebaseResponse res1 = null;
                res1 = await client.GetTaskAsync("NewsLine/3rdyear/1stsemester/CSE/post" + i.ToString());

                postOnlinedData d = res1.ResultAs <postOnlinedData>();
                DataRow         r = dt.NewRow();
                r["Post"] = d.post;
                r["Date"] = d.Date;
                r["Time"] = d.Time;
                dt.Rows.Add(r);
            }
        }
Ejemplo n.º 2
0
        private async void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            dt.Clear();
            client = new FireSharp.FirebaseClient(config);
            FirebaseResponse res = null;

            res = await client.GetTaskAsync("NewsLineCnt/");

            countClass cc = res.ResultAs <countClass>();
            long       x  = Convert.ToInt64(cc.cnt.ToString());


            int i = 0;

            //MessageBox.Show(comboBox1.SelectedItem.ToString());

            while (true)
            {
                i++;
                FirebaseResponse res1 = null;
                res1 = await client.GetTaskAsync("StudentAll/CSE/" + comboBox1.SelectedItem.ToString() + "/" + i.ToString());

                Data4 d;
                try
                {
                    d = res1.ResultAs <Data4>();;
                }
                catch (Exception exs)
                {
                    break;
                }

                DataRow r = dt.NewRow();
                r["Name"]         = d.name;
                r["Designation"]  = d.desig;
                r["organisation"] = d.org;
                r["Address"]      = d.add;
                r["Session"]      = comboBox1.SelectedItem.ToString();
                r["Mail Id"]      = d.mail;
                r["Contact No."]  = d.phn;
                r["Higher Study"] = d.hStudy;
                dt.Rows.Add(r);
            }
        }