Esempio n. 1
0
        private void courseAddButton_Click(object sender, EventArgs e)
        {
            addTeacherObj = new AddTeacherClass();

            addTeacherObj.TeacherId     = teacherIdTextBox.Text;
            addTeacherObj.TeacherName   = teacherNameTextBox.Text;
            addTeacherObj.TeacherDesign = designationTextBox.Text;
            addTeacherObj.DeptName      = dNameComboBox.Text;
            addTeacherObj.Password      = passwordTextBox.Text;

            if ((teacherIdTextBox.Text == "") || (teacherNameTextBox.Text == "") || (designationTextBox.Text == "") || (dNameComboBox.Text == "") || (passwordTextBox.Text == ""))
            {
                MessageBox.Show("Please Fill-Up all field");

                this.Update();
            }
            else
            {
                gateways = new Gateway();

                if (gateways.InserIntoTeacherInfoTable(addTeacherObj) == 1)
                {
                    MessageBox.Show("Information Added Successfully!!!");
                    teacherResetButton_Click(sender, e);
                }
                else
                {
                    MessageBox.Show("Already Added \"" + teacherNameTextBox.Text + "\"");
                }
            }
        }