Beispiel #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            this.Hide();
            StudentsList obj = new StudentsList(loginUserName, "BBA");

            obj.Show();
        }
Beispiel #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (sbl.IsExistCSStudent(this.loginUserName) || sbl.IsExistEEEStudent(this.loginUserName) || sbl.IsExistBBAStudent(this.loginUserName))
            {
                this.Hide();
                StudentPage sp = new StudentPage(this.loginUserName, this.department);      //for student
                sp.Show();
            }
            else
            {
                this.Hide();
                StudentsList sl = new StudentsList(this.loginUserName, this.department);       //for admin
                sl.Show();
            }

            //if (loginUserName != null && loginUserName.Length == 8)
            //{
            //    this.Hide();
            //    StudentsList sl = new StudentsList(loginUserName, department);
            //    sl.Show();
            //}
            //else if (loginUserName != null && loginUserName.Length == 6)
            //{
            //    this.Hide();
            //    StudentPage sp = new StudentPage(loginUserName, department);
            //    sp.Show();
            //}
        }
        private void button2_Click(object sender, EventArgs e)
        {
            this.Hide();
            StudentsList sl = new StudentsList(loginUserName, department);

            sl.Show();
        }
Beispiel #4
0
        private void button2_Click(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show("Are you sure to dlete this student?", "Confirmation", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);

            if (result == DialogResult.Yes)
            {
                sbl.DeleteStudent(label27.Text, department);
                this.Hide();
                StudentsList sl = new StudentsList(loginUserName, department);
                sl.Show();
                MessageBox.Show("Student deleted successfully.");
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            if (sbl.IsExistCSStudent(textBox1.Text) || sbl.IsExistEEEStudent(textBox1.Text) || sbl.IsExistBBAStudent(textBox1.Text))
            {
                MessageBox.Show("Student with same Student ID already exist.\nPlease use another Student ID.");
            }
            else if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "" || textBox8.Text == "" || textBox4.Text == "" || textBox5.Text == "" ||
                     textBox7.Text == "" || textBox6.Text == "" || textBox9.Text == "" || textBox13.Text == "" || textBox14.Text == "" || textBox15.Text == "" ||
                     comboBox1.SelectedIndex == 0 || textBox12.Text == "" || textBox11.Text == "" || textBox16.Text == "" || textBox17.Text == "" || pictureBox1.Image == null)
            {
                MessageBox.Show("Please fill all the information correctly.");
            }
            else if (textBox1.Text.Length != 6)
            {
                MessageBox.Show("Please use 6 character for a User Name.");
            }
            else
            {
                string bloodGroup = comboBox1.Items[comboBox1.SelectedIndex].ToString();
                string gender, maritalStatus;

                if (radioButton1.Checked == true)
                {
                    gender = "Male";
                }
                else
                {
                    gender = "Female";
                }

                if (checkBox1.Checked == true)
                {
                    maritalStatus = "Married";
                }
                else
                {
                    maritalStatus = "Unmarried";
                }

                sbl.AddStudent(textBox1.Text, textBox2.Text, textBox3.Text, textBox8.Text, textBox4.Text, textBox5.Text, textBox7.Text, textBox6.Text, textBox9.Text, textBox13.Text, textBox14.Text, textBox15.Text, gender, textBox12.Text, textBox11.Text, maritalStatus, bloodGroup, textBox16.Text, textBox17.Text, pictureBox1.Image, department);
                this.Hide();
                StudentsList fl = new StudentsList(loginUserName, department);
                fl.Show();

                MessageBox.Show("Student added successfully.");
            }
        }