Example #1
0
        public void TestDeleteTeacher()
        {
            var    f  = new TeacherList();
            string id = GlobalItems.getIdNumber("users", "fname", "ZRob");

            f.deleteTeacher(id);
            Assert.IsFalse(GlobalItems.checkItemsInDB("users", "fname", "ZRob"));
        }
Example #2
0
        private void Send_Click(object sender, EventArgs e)
        {
            string id = GlobalItems.getIdNumber("users", "IdNUmber", fId.Text);

            if (id != null)
            {
                int friend_id = checkStudentId(id);
                if (friend_id != -1)
                {
                    int i;
                    progressBar1.Minimum = 0;
                    progressBar1.Maximum = 2000;

                    for (i = 0; i <= 2000; i++)
                    {
                        progressBar1.Value = i;
                    }

                    if (progressBar1.Value == 2000)
                    {
                        CourseByUserLoad(friend_id);
                        studentScheduleOptions(friend_id);

                        CourseUpdate(GlobalItems.currentUser.id);
                        bildStudentSchedule(GlobalItems.currentUser.id);
                        ScheduleLoad(GlobalItems.currentUser.id);

                        MessageBox.Show("Data Saved!");
                        return;
                    }
                }
                MessageBox.Show("Error ID is incorrect!!!");
                return;
            }
            MessageBox.Show("Error ID is incorrect!!!");
            return;
        }
Example #3
0
        private void GraphApiExample()
        {
            // note: avoid using synchronous methods if possible as it will block the thread until the result is received

            try
            {
                var fb = new FacebookClient(_accessToken);

                // instead of casting to IDictionary<string,object> or IList<object>
                // you can also make use of the dynamic keyword.
                dynamic result = fb.Get("me?fields=first_name,last_name,id,name");

                // You can either access it this way, using the .
                dynamic id   = result.id;
                dynamic name = result.name;

                dynamic first_name = result.first_name;
                dynamic last_name  = result.last_name;

                // if dynamic you don't need to cast explicitly.
                lblUserId.Text = "User Id: " + id;
                lnkName.Text   = "Hi " + name;

                lblFirstName.Text = "First Name " + first_name;
                lblLastName.Text  = "Last Name " + last_name;


                string iden = GlobalItems.getIdNumber("users", "fname", first_name);
                if (iden != id)
                {
                    Unproved obj = new Unproved();
                    obj.addUser(first_name, last_name, "", "", id, 6);
                }
                else
                {
                    this.Close();


                    GlobalItems.Login(id, "");
                    switch (GlobalItems.CheckUserLevel())
                    {
                    case 3:
                    case 4:
                        TeacherWin wnd = new TeacherWin(_accessToken);
                        wnd.Show(startFrom.Instance);
                        wnd.Select();
                        wnd.Focus();
                        break;

                    case 5:
                    case 6:
                        StudentWin wnd2 = new StudentWin(_accessToken);
                        wnd2.Show(startFrom.Instance);
                        wnd2.Select();
                        wnd2.Focus();
                        break;
                    }
                }
            }
            catch (FacebookApiException ex)
            {
                MessageBox.Show(ex.Message);
            }
        }