Ejemplo n.º 1
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");
        }
        /// <summary>
        /// CLick event handler for btnShowRecord to display record of selected student
        /// </summary>
        /// <param name="sender">Object on which event has occured</param>
        /// <param name="e">Args for the event</param>
        protected void btnShowRecord_Click(object sender, EventArgs e)
        {
            //Extract rollno from textbox
            string value = txtRollNo.Text;
            int    rollNo;

            int.TryParse(value, out rollNo);

            //Call GetStudentRecord() method to fetch data
            StudentDataHandler studentHandler = new StudentDataHandler();
            List <string>      stud           = studentHandler.GetStudentRecord(rollNo);

            //Check the returned result
            if (stud != null)
            {
                #region Display Record
                Response.Write("<h2>Data for Student </h2>");
                Response.Write(string.Format("Student ID : {0}<br />", stud[0]));
                Response.Write(string.Format("Full Name : {0}<br />", stud[1]));
                Response.Write(string.Format("Father's Name : {0}<br />", stud[2]));
                Response.Write(string.Format("Age : {0}<br />", stud[3]));
                Response.Write(string.Format("Roll No. : {0}<br />", stud[4]));
                Response.Write(string.Format("Stream : {0}<br />", stud[5]));
                Response.Write(string.Format("Address : {0}<br />", stud[7]));
                #endregion
            }
            else
            {
                Response.Write("No record found.");
            }
        }
Ejemplo n.º 3
0
        public void LoadGetStudentInfo(string id)
        {
            StudentDataHandler studentData = new StudentDataHandler(id);

            this.textboxStudentPhone.Text  = studentData.GetPhone();
            this.textboxStudentName.Text   = studentData.GetName();
            this.textboxStudentMother.Text = studentData.GetMother();
            this.textboxStudentID.Text     = studentData.GetID();

            if (studentData.GetGender() == 1)
            {
                radiobuttonStudentMale.Checked = true;
            }
            else
            {
                radiobuttonStudentFemale.Checked = true;
            }

            this.textboxStudentFather.Text = studentData.GetFather();
            this.textboxStudentEmail.Text  = studentData.GetEmail();
            this.datetimeStudentDOB.Value  = studentData.GetDOB();
            this.comboboxStudentDepartment.SelectedIndex = studentData.GetDepartment();
            this.textboxStudentCreditsCompleted.Text     = studentData.GetCredit().ToString();
            this.textboxStudentCGPA.Text = studentData.GetCGPA().ToString();
            this.comboboxStudentNationality.SelectedIndex = studentData.GetNationality();
            this.comboboxStudentBloodGroup.SelectedIndex  = studentData.GetBloodGroup();
            this.pictureboxStudentPicture.ImageLocation   = studentData.GetImageDirectory();
            this.textboxStudentMAC.Text = studentData.GetMAC();
            // this.pictureboxStudentPicture.Load();
        }
Ejemplo n.º 4
0
        private void buttonDeleteStudent_Click(object sender, EventArgs e)
        {
            string             id          = this.textboxStudentID.Text;
            StudentDataHandler studentData = new StudentDataHandler(id);

            studentData.DeleteStudent();
            UpdateForm();
            MessageBox.Show("Student Deleted");
        }
Ejemplo n.º 5
0
        private void UpdateForm()
        {
            StudentDataHandler studentData = new StudentDataHandler();
            FacultyDataHandler facultyData = new FacultyDataHandler();
            CourseDataHandler  courseData  = new CourseDataHandler();

            this.datagridStudentTable.DataSource = studentData.GetStudentTable();
            this.datagridFacultyTable.DataSource = facultyData.GetFacultyTable();
            this.datagridCourseTable.DataSource  = courseData.GetCourseTable();
            string FacultyName = this.comboboxCourseAssignFaculty.SelectedItem.ToString();

            this.datagridFacultyCoursesAssigned.DataSource = courseData.GetFacultyCoursesAssigned(FacultyName);
        }
Ejemplo n.º 6
0
        public StudentInterface(string id)
        {
            InitializeComponent();
            StudentDataHandler studentData = new StudentDataHandler(id);

            this.Text = "Welcome, " + studentData.GetName();
            this.labelPhoneAns.Text      = studentData.GetPhone();
            this.labelNameAns.Text       = studentData.GetName();
            this.labelMotherAns.Text     = studentData.GetMother();
            this.labelIDAns.Text         = studentData.GetID();
            this.labelGenderAns.Text     = studentData.GetGender() == 1 ? "Male" : "Female";
            this.labelFatherAns.Text     = studentData.GetFather();
            this.labelEmailAns.Text      = studentData.GetEmail();
            this.labelDOBAns.Text        = studentData.GetDOB();
            this.labelDepartmentAns.Text = studentData.GetDepartment();
            this.labelCreditsAns.Text    = studentData.GetCredit().ToString();
            this.labelCGPAAns.Text       = studentData.GetCGPA().ToString();
            this.labelBloodGroupAns.Text = Enum.GetName(typeof(BloodGroup), studentData.GetBloodGroup());
        }
Ejemplo n.º 7
0
 private void textboxSearchStudent_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == (char)13)
     {
         StudentDataHandler studentData = new StudentDataHandler();
         if (Regex.IsMatch(textboxSearchStudent.Text, @"^[\p{L}]+$"))
         {
             this.datagridStudentTable.DataSource = studentData.SearchStudentByName(textboxSearchStudent.Text);
         }
         // else if (textboxSearchStudent.Text.Length == 3)
         //     this.datagridStudentTable.DataSource = studentData.SearchStudentByDepartment(textboxSearchStudent.Text);
         else if (textboxSearchStudent.Text.Length > 0)
         {
             this.datagridStudentTable.DataSource = studentData.SearchStudentByID(textboxSearchStudent.Text);
         }
         else
         {
             this.datagridStudentTable.DataSource = studentData.GetStudentTable();
         }
     }
 }
Ejemplo n.º 8
0
        private void Button_Click(object sender, RoutedEventArgs e) // Load
        {
            string comboBoxValue = Regex.Match(Entity_ComboBox.SelectedValue.ToString(), @"(?<=: )\w+").Value;

            switch (comboBoxValue)
            {
            case "Student":
            {
                Entity_ComboBox.IsEnabled = false;
                studentDataHandler        = new StudentDataHandler(FilePath_Box.Text);
                MainDataGrid.ItemsSource  = studentDataHandler.Students;
                break;
            }

            case "Teacher":
            {
                Entity_ComboBox.IsEnabled = false;
                teacherDataHandler        = new TeacherDataHandler(FilePath_Box.Text);
                MainDataGrid.ItemsSource  = teacherDataHandler.Teachers;
                break;
            }
            }
        }
Ejemplo n.º 9
0
 private void Form1_Load(object sender, EventArgs e)
 {
     dh = new StudentDataHandler();
 }
Ejemplo n.º 10
0
        public AdminInterface(string id)
        {
            this.id = id;
            InitializeComponent();

            foreach (var bg in Enum.GetValues(typeof(BloodGroup)))
            {
                comboboxFacultyBloodGroup.Items.Add(bg);
                comboboxStudentBloodGroup.Items.Add(bg);
            }

            foreach (var nationality in Enum.GetValues(typeof(Nationality)))
            {
                comboboxFacultyNationality.Items.Add(nationality);
                comboboxStudentNationality.Items.Add(nationality);
            }

            AdminDataHandler departmentData = new AdminDataHandler();
            List <string>    departmentList = departmentData.GetDepartmentData();

            foreach (string dept in departmentList)
            {
                this.comboboxCourseDepartment.Items.Add(dept);
                this.comboboxFacultyDepartment.Items.Add(dept);
                this.comboboxStudentDepartment.Items.Add(dept);
            }

            foreach (string time in Times)
            {
                this.comboboxCourseStartTime.Items.Add(time);
                this.comboboxCourseEndTime.Items.Add(time);
            }

            foreach (int credit in Credits)
            {
                this.comboboxCourseCredits.Items.Add(credit);
            }

            foreach (string section in Sections)
            {
                this.comboboxCourseSection.Items.Add(section);
            }

            AdminDataHandler   adminData   = new AdminDataHandler(id);
            StudentDataHandler studentData = new StudentDataHandler();
            FacultyDataHandler facultyData = new FacultyDataHandler();
            CourseDataHandler  courseData  = new CourseDataHandler();

            List <string> facultyList = facultyData.GetAllFaculty();

            foreach (string faculty in facultyList)
            {
                this.comboboxCourseAssignFaculty.Items.Add(faculty);
            }

            this.Text = "Welcome, " + adminData.GetName();
            this.labelPhoneAns.Text      = adminData.GetPhone();
            this.labelNameAns.Text       = adminData.GetName();
            this.labelMotherAns.Text     = adminData.GetMother();
            this.labelIDAns.Text         = adminData.GetID();
            this.labelGenderAns.Text     = adminData.GetGender().ToString();
            this.labelFatherAns.Text     = adminData.GetFather();
            this.labelEmailAns.Text      = adminData.GetEmail();
            this.labelDOBAns.Text        = adminData.GetDOB();
            this.labelBloodGroupAns.Text = Enum.GetName(typeof(BloodGroup), adminData.GetBloodGroup());

            this.datagridStudentTable.DataSource        = studentData.GetStudentTable();
            this.datagridFacultyTable.DataSource        = facultyData.GetFacultyTable();
            this.datagridCourseTable.DataSource         = courseData.GetCourseTable();
            this.datagridSearchAssignCourses.DataSource = courseData.GetAssignCourseTable();

            try
            {
                string FacultyName = this.comboboxCourseAssignFaculty.SelectedItem.ToString();
            }
            catch
            {
                string FacultyName = "n/a";
                this.datagridFacultyCoursesAssigned.DataSource = courseData.GetFacultyCoursesAssigned(FacultyName);
            }
        }
Ejemplo n.º 11
0
 public StudentsHandler()
 {
     dataHandler = new StudentDataHandler();
 }