Example #1
0
        private void buttonUpdateFaculty_Click(object sender, EventArgs e)
        {
            string             id          = this.textboxFacultyID.Text;
            FacultyDataHandler facultyData = new FacultyDataHandler(id);

            facultyData.SetPhone(this.textboxFacultyPhone.Text);
            facultyData.SetName(this.texboxFacultyName.Text);
            facultyData.SetID(this.textboxFacultyID.Text);
            facultyData.SetFather(this.textboxFacultyFather.Text);
            facultyData.SetMother(this.textboxFacultyMother.Text);
            facultyData.SetEmail(this.textboxFacultyEmail.Text);
            facultyData.SetDOB(this.datetimeFacultyDOB.Value);
            facultyData.SetDepartment(this.comboboxFacultyDepartment.SelectedIndex);
            facultyData.SetBloodGroup(this.comboboxFacultyBloodGroup.SelectedIndex);
            facultyData.SetNationality(this.comboboxFacultyNationality.SelectedIndex);

            if (radiobuttonFacultyMale.Checked)
            {
                facultyData.SetGender(1);
            }
            else
            {
                facultyData.SetGender(2);
            }

            facultyData.SetPassword(GeneratePasswordHash.CalculateMD5Hash(this.textboxStudentPassword.Text));
            // studentData.SetImageDirectory(studentImageURL);
            facultyData.UpdateFaculty();
            UpdateForm();
            MessageBox.Show("Faculty Updated");
        }
Example #2
0
        private void buttonUpdateStudent_Click(object sender, EventArgs e)
        {
            string             id          = this.textboxStudentID.Text;
            StudentDataHandler studentData = new StudentDataHandler(id);

            studentData.SetPhone(this.textboxStudentPhone.Text);
            studentData.SetName(this.textboxStudentName.Text);
            studentData.SetMother(this.textboxStudentMother.Text);
            studentData.SetID(this.textboxStudentID.Text);

            if (radiobuttonStudentMale.Checked)
            {
                studentData.SetGender(1);
            }
            else
            {
                studentData.SetGender(2);
            }

            studentData.SetFather(this.textboxStudentFather.Text);
            studentData.SetEmail(this.textboxStudentEmail.Text);
            studentData.SetDOB(this.datetimeStudentDOB.Value);
            studentData.SetDepartment(this.comboboxStudentDepartment.SelectedIndex);
            studentData.SetCredit(Convert.ToInt32(this.textboxStudentCreditsCompleted.Text));
            studentData.SetCGPA(Convert.ToDouble(this.textboxStudentCGPA.Text));
            studentData.SetBloodGroup(this.comboboxStudentBloodGroup.SelectedIndex);
            studentData.SetImageDirectory(studentImageURL);
            studentData.SetMAC(this.textboxStudentMAC.Text);
            studentData.SetPassword(GeneratePasswordHash.CalculateMD5Hash(this.textboxStudentPassword.Text));
            studentData.UpdateStudent();
            UpdateForm();
            MessageBox.Show("Student Updated");
        }