Example #1
0
        private void setInstructorBtn_Click(object sender, EventArgs e)
        {
            Admin adm = MyAdmin.Admin;

            //Student stu = new Student(students[studentsComboBox.SelectedIndex].Id, students[studentsComboBox.SelectedIndex].Name);
            student = StudentDAL.GetById(students[studentsComboBox.SelectedIndex].Id);
            //student.Id = students[studentsComboBox.SelectedIndex].Id;
            bool isInst = StudentDAL.SetInstructor(student);
            int  res    = StudentDAL.Add(student.UserName, student.Name, student.Age, student.Address, student.Phone, student.Email, isInst, student.Admin.Id, student.Department.Id, student.Password);

            if (res != 0)
            {
                StudentDAL.DeleteById(student.Id);
            }
        }