Example #1
0
        public void TestAddCourse()
        {
            var f = new CourseList();

            f.addCourse("Test", 10, 50, 0, 0, 0, 0, 0, 0, 0, "Description");
            Assert.IsTrue(GlobalItems.checkItemsInDB("course", "name", "Test"));
        }
Example #2
0
        private void CourseUpdate(int uId)
        {
            List <ComboBox> addCourseList = new List <ComboBox>();

            addCourseList.Add(c1);
            addCourseList.Add(c2);
            addCourseList.Add(c3);
            addCourseList.Add(c4);
            addCourseList.Add(c5);


            DBA db = DBA.Instance;

            db.connect();
            db.query("DELETE courseToTT where id_user = "******"");

            int ind = 0;

            while (ind < 5)
            {
                if (addCourseList[ind].Text != "")
                {
                    string course = addCourseList[ind].GetItemText(addCourseList[ind].SelectedItem);

                    course = course.Remove(course.Length - 1);
                    string[] course_data = course.Split('[');
                    int      course_id   = GlobalItems.strToInt(course_data[1]);

                    db.query("INSERT INTO courseToTT (id_user, id_course) VALUES (" + uId + ", " + course_id + ")");
                }
                ind++;
            }
        }
Example #3
0
        public void TestAddTutor()
        {
            var f = new TutorList();

            f.addTutor("ZRob2", "Rob", "*****@*****.**", "1111", "123456789", 3);
            Assert.IsTrue(GlobalItems.checkItemsInDB("users", "fname", "ZRob2"));
        }
Example #4
0
        private void Manager_Load(object sender, EventArgs e)
        {
            label1.Text = "hellow " + GlobalItems.currentUser.fname + " " + GlobalItems.currentUser.lname + ":";


            button8.Text += "(" + GlobalItems.countItems(6).ToString() + ")";
        }
Example #5
0
        public void TestAddDepartments()
        {
            var f = new DepartmentList();

            f.addDepartment("Biologia");
            Assert.IsTrue(GlobalItems.checkItemsInDB("departments", "name", "Biologia"));
        }
Example #6
0
        public void TestAddClass()
        {
            var f = new ClassList();

            f.addClass("Z100", "40", "0", 0, 0);
            Assert.IsTrue(GlobalItems.checkItemsInDB("classes", "name", "Z100"));
        }
Example #7
0
        private void reg_send_Click(object sender, EventArgs e)
        {
            DBA db = DBA.Instance;

            db.connect();

            if (reg_id.Text != "" && reg_fname.Text != "" && reg_lname.Text != "" && reg_email.Text != "" && reg_password.Text != "")
            {
                if (GlobalItems.checkIdNumber(reg_id.Text))
                {
                    db.query("INSERT INTO users (fname, lname, email, password, idNUmber, type) VALUES ('" + reg_fname.Text + "', '" + reg_lname.Text + "', '" + reg_email.Text + "', '" + reg_password.Text + "', '" + reg_id.Text + "', 6)");

                    MessageBox.Show("Data is Saved, Please type your id number and password to login into system");

                    GlobalItems.slideLeftSize(this, 350);
                }
                else
                {
                    MessageBox.Show("User with this id number is already exist in system, please type another id");
                }
            }
            else
            {
                MessageBox.Show("All fields have to be filled");
            }
        }
Example #8
0
        public void LoadSchedule()
        {
            int        key = GlobalItems.getKey("users", "fname", "Dunkan");
            StudentWin obj = new StudentWin();

            obj.ScheduleLoad(key);
            Assert.IsNotNull(key);
        }
Example #9
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 #10
0
 private int getEventId(string eve)
 {
     if (eve == "" || eve == null)
     {
         return(0);
     }
     string[] c = eve.Split('|');
     return(GlobalItems.strToInt(c[0]));
 }
Example #11
0
 private void reg_cancel_Click(object sender, EventArgs e)
 {
     GlobalItems.slideLeftSize(this, 350);
     reg_fname.Text    = "";
     reg_lname.Text    = "";
     reg_email.Text    = "";
     reg_password.Text = "";
     reg_id.Text       = "";
 }
Example #12
0
        public void TestDeleteClass()
        {
            var f  = new ClassList();
            int id = GlobalItems.getKey("classes", "name", "Z100");

            if (id > 0)
            {
                f.deleteClass(id.ToString());
                Assert.IsFalse(GlobalItems.checkItemsInDB("classes", "name", "Z100"));
            }
        }
Example #13
0
        public void TestDeleteCourse()
        {
            var f  = new CourseList();
            int id = GlobalItems.getKey("course", "name", "Test");

            if (id > 0)
            {
                f.DeleteCourse(id.ToString());
                Assert.IsFalse(GlobalItems.checkItemsInDB("course", "name", "Test"));
            }
        }
Example #14
0
        public void TestDeleteDepartments()
        {
            var f  = new DepartmentList();
            int id = GlobalItems.getKey("departments", "name", "Biologia");

            if (id > 0)
            {
                f.delete_department(id.ToString());
                Assert.IsFalse(GlobalItems.checkItemsInDB("departments", "name", "Biologia"));
            }
        }
Example #15
0
        private async void button1_Click(object sender, EventArgs e)
        {
            pictureBox2.Visible = true;
            await Task.Delay(2000);

            bool res = GlobalItems.Login(textBox1.Text, textBox2.Text);

            if (res)
            {
                this.Hide();
                textBox1.Text = "";
                textBox2.Text = "";

                if (GlobalItems.CheckUserLevel() == 1)
                {
                    ManagerWin wnd = new ManagerWin();
                    wnd.Show();
                }
                else if (GlobalItems.CheckUserLevel() == 2)
                {
                    MazkiraWin wnd = new MazkiraWin();
                    wnd.Show();
                }
                else if (GlobalItems.CheckUserLevel() == 3)
                {
                    TeacherWin wnd = new TeacherWin();
                    wnd.Show();
                }
                else if (GlobalItems.CheckUserLevel() == 4)
                {
                    TeacherWin wnd = new TeacherWin();
                    wnd.Show();
                }

                else if (GlobalItems.CheckUserLevel() == 5)
                {
                    StudentWin wnd = new StudentWin();
                    wnd.Show();
                }

                else
                {
                    MessageBox.Show("Your account is not approved by secretary");
                }
            }
            else
            {
                MessageBox.Show("This user is not exist", "Login Error",
                                MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            pictureBox2.Visible = false;
        }
Example #16
0
        private void recoverySend_Click(object sender, EventArgs e)
        {
            string email = recoveryEmail.Text;

            if (GlobalItems.checkUserEmail(email))
            {
                GlobalItems.sendEmail(email);
                MessageBox.Show("Your new password has been send to your email");
            }
            else
            {
                MessageBox.Show("This email is not register in the system, Please enter correct email");
            }
        }
Example #17
0
    // Use this for initialization
    void Start()
    {
        Color c = GetComponent <Image>().color;

        GetComponent <Image>().color = new Color(c.r, c.g, c.b, 0);

        foreach (Transform t in transform)
        {
            children.Add(t.gameObject);
        }

        foreach (RectTransform t in children[0].transform)
        {
            GlobalItems.NewSize(t);
        }
    }
Example #18
0
        private void Form6_Load(object sender, EventArgs e)
        {
            userInfoLoad();
            CourseLoad();
            CourseByUserLoad(GlobalItems.currentUser.id);
            studentScheduleOptions(GlobalItems.currentUser.id);
            ScheduleLoad(GlobalItems.currentUser.id);



            if (GlobalItems.CheckUserLevel() == 6)
            {
                button3.Enabled = false;
                button2.Enabled = false;
                MessageBox.Show("Option courses and My Info no active for now. Secretary will update your data and you will have acsses to this option");
            }
        }
Example #19
0
        public void getInfo()
        {
            StudentWin obj  = new StudentWin();
            Panel      obj2 = null;

            List <Control> list = new List <Control>();

            GlobalItems.GetAllControl(obj, list);
            foreach (Control control in list)
            {
                if (control.GetType() == typeof(Panel) && control.Name == "myInfoPanel")
                {
                    obj2 = new Panel();
                }
            }

            Assert.IsNotNull(obj2);
        }
Example #20
0
        private void c5_SelectedIndexChanged(object sender, EventArgs e)
        {
            string course = c5.GetItemText(c5.SelectedItem);

            optC5.Text = "";
            if (course != "")
            {
                optC5.Items.Clear();
                course = course.Remove(course.Length - 1);
                string[] course_data = course.Split('[');
                int      course_id   = GlobalItems.strToInt(course_data[1]);
                getAllCourseOptions(course_id, optC5);
            }
            else
            {
                optC5.Items.Clear();
            }
        }
Example #21
0
    void Start()
    {
        aim   = GameObject.Find("AimImage").GetComponent <Image>();
        close = GameObject.Find("CloseImage").GetComponent <Image>();

        foreach (Transform t in transform)
        {
            children.Add(t.gameObject);
        }

        for (int i = 0; i < children.Count; i++)
        {
            if (children[i].GetComponent <Text>())
            {
                text.Add(new MessageIntro(children[i].GetComponent <Text>()));
                text[text.Count - 1].textColor = new Color(text[text.Count - 1].textColor.r, text[text.Count - 1].textColor.g, text[text.Count - 1].textColor.b, 0f);

                timers.Add(0);
            }
            if (children[i].layer == LayerMask.NameToLayer("UILeftTag"))
            {
                left = new TagInfoHandler(children[i]);
            }
            if (children[i].layer == LayerMask.NameToLayer("UIRightTag"))
            {
                right = new TagInfoHandler(children[i]);
            }
        }

        aim.color   = new Color(aim.color.r, aim.color.g, aim.color.b, 0);
        close.color = new Color(close.color.r, close.color.g, close.color.b, 0);

        foreach (GameObject g in children)
        {
            if (g.GetComponent <RectTransform>())
            {
                GlobalItems.NewSize(g.GetComponent <RectTransform>());
            }
        }
    }
Example #22
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 #23
0
 public void TestLoginTrue()
 {
     Assert.AreEqual(GlobalItems.Login("3333", "12345"), true);
 }
Example #24
0
 void IncreaseResearchCost(Miner miner)
 {
     miner.ResearchCost += GlobalItems.CalculateNewPrice(miner.ResearchStartCost, 1.15f, miner.ResearchLevel);
 }
Example #25
0
 private void hideFriend_Click(object sender, EventArgs e)
 {
     GlobalItems.slideLeft(friend_id, -260);
 }
Example #26
0
 private void button7_Click(object sender, EventArgs e)
 {
     GlobalItems.slideRight(friend_id, 0);
 }
Example #27
0
 private void hideRequest_Click(object sender, EventArgs e)
 {
     GlobalItems.slideLeft(requestPanel, -260);
 }
Example #28
0
 private void button1_Click_1(object sender, EventArgs e)
 {
     GlobalItems.slideRight(requestPanel, 0);
 }
Example #29
0
 void IncreasePassiveBonus(Miner miner)
 {
     miner.PassiveBonus += (GlobalItems.CalculateNewPrice(miner.PassiveStartBonus, 1.15f, miner.ResearchLevel));
 }
Example #30
0
 private void coursesHide_Click(object sender, EventArgs e)
 {
     GlobalItems.slideLeft(coursesPanel, -660);
 }