private void btnExit_Click(object sender, EventArgs e)
        {
            this.Close();
            StudentManage studentManage = new StudentManage();

            studentManage.Show();
        }
        private void btnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                var option = MessageBox.Show(MessageDefine.ConfirmDeleteStudent, "Xác nhận xóa", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                if (option == DialogResult.Yes)
                {
                    db.STUDENTs.Remove(student);
                    db.SaveChanges();

                    MessageBox.Show(MessageDefine.DeleteRecordSuccessful, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.Close();
                    StudentManage studentManage = new StudentManage();
                    studentManage.Show();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(MessageDefine.ExceptionMessage + ex.Message);
            }
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                // Xác thực thông tin nhập vào
                if (txtStudentId.Text == "")
                {
                    lbInformation.Text = "Thông báo lỗi: " + MessageDefine.StudentIdNull;
                    return;
                }


                // thêm thông tin sinh viên sau chỉnh sửa vào csdl
                STUDENT student = new STUDENT();
                student.STUDENTID   = txtStudentId.Text;
                student.STUDENTNAME = txtFullName.Text;
                student.DOB         = dob.Value;

                if (cbbGender.SelectedItem.ToString().Equals("Nam"))
                {
                    student.GENDER = 1;
                }
                else
                {
                    student.GENDER = 2;
                }

                student.RELIGION    = txtReligion.Text;
                student.FOLK        = txtFolk.Text;
                student.ADDRESSS    = txtAddress.Text;
                student.CMND        = txtCMND.Text;
                student.DATECMND    = dateCMND.Value;
                student.ISSUEDBY    = txtIssuedBy.Text;
                student.NATION      = txtNation.Text;
                student.PHONENUMBER = txtPhoneNumber.Text;
                student.STUDYAT     = txtSchool.Text;
                student.STUDENTYEAR = int.Parse(txtYear.Text);
                student.DEPARTMENT  = txtDepartment.Text;
                student.PHOTO       = lbImageName.Text;
                student.STATUSS     = 1;
                student.EMAIL       = txtEmail.Text;

                db.Entry(student).State = System.Data.Entity.EntityState.Modified;
                db.SaveChanges();

                // Upload file ảnh avatar vào hệ thống
                if (avatarPath != "")
                {
                    File.Copy(avatarPath, CommonUsing.ImagePath() + Path.GetFileName(avatarPath), true);
                }

                MessageBox.Show("Chỉnh sửa thông tin sinh viên thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Close();
                StudentManage studentManage = new StudentManage();
                studentManage.Show();
            }
            catch (Exception ex)
            {
                lbInformation.Text = ex.Message;
            }
        }