Example #1
0
        private void btnClose_Click(object sender, EventArgs e)
        {
            this.Close();
            OfficalStudentForm f = new OfficalStudentForm();

            f.Show();
        }
Example #2
0
        private void buttonOfficialStudent_Click(object sender, EventArgs e)
        {
            OfficalStudentForm f = new OfficalStudentForm();

            this.Hide();
            f.Show();
        }
Example #3
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            StudentDAL potentialStudentDAL = new StudentDAL();
            SignupDAL  sgDAL = new SignupDAL();

            potentialStudentDAL.ConnectToDatabase();
            StudentDTO   currentObject = (StudentDTO)dgvListStudent.CurrentRow.DataBoundItem;
            DialogResult rs            = MessageBox.Show("Bạn muốn xoá học viên: " + currentObject.StudentId, "Thông báo", MessageBoxButtons.YesNo);

            if (rs == DialogResult.Yes)
            {
                try
                {
                    if (sgDAL.DeleteSignupStudent(currentObject.StudentId) && potentialStudentDAL.DeleteStudent(currentObject.StudentId))
                    {
                        MessageBox.Show("Xoá học viên thành công!!!");
                        this.Close();
                        OfficalStudentForm f = new OfficalStudentForm();
                        f.Show();
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show("Xoá học viên thất bại!!!");
                }
            }
        }
Example #4
0
        private void btConfim_Click(object sender, EventArgs e)
        {
            StudentDAL studentDAL = new StudentDAL();

            studentDAL.ConnectToDatabase();
            try
            {
                if ((studentDAL.InsertStudent(textboxStudentID.Text, textboxStudentName.Text, textboxStudentMail.Text, textboxStudentAddress.Text, textboxStudentPhoneNumber.Text, birthDateTimePicker.Value)) &&
                    textboxStudentName.Text != "")
                {
                    MessageBox.Show("Thêm học viên thành công!!!");
                    this.Close();
                    OfficalStudentForm f = new OfficalStudentForm();
                    f.Show();
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Thêm học viên thất bại, vui lòng kiểm tra lại dữ liệu!!!");
            }
        }
Example #5
0
        private void btConfim_Click(object sender, EventArgs e)
        {
            StudentDAL studentDAL = new StudentDAL();

            studentDAL.ConnectToDatabase();
            try
            {
                StudentDTO studentDTO = new StudentDTO(textboxStudentID.Text, textboxStudentName.Text, textboxStudentMail.Text, textboxStudentAddress.Text, textboxStudentPhoneNumber.Text, birthDateTimePicker.Value);
                if (studentDAL.UpdateStudent(studentDTO))
                {
                    MessageBox.Show("Thay đổi thông tin học viên thành công!!!");
                    this.Close();
                    OfficalStudentForm f = new OfficalStudentForm();
                    f.Show();
                }
            }
            catch
            {
                MessageBox.Show("Thay đổi thất bại, kiểm tra lại thông tin!!!");
            }
        }