Biểu mẫu nhập khu vực ưu tiên

Một phần của tài liệu HỆ THỐNG QUẢN LÝ TUYỂN SINH TRƯỜNG ĐẠI HỌC (Trang 46 - 49)

IX. THIẾT KẾ GIAO DIỆN

f.Biểu mẫu nhập khu vực ưu tiên

- Tên biểu mẫu: Cập Nhật Khu Vực Ưu Tiên - Người thực hiện: Người quản trị hệ thống.

- Thời gian thực hiện: Sau khi nhập xong khu vực của thí sinh đăng ký dự thi ta cần nhập các khu vực được hưởng ưu tiên theo quy định của bộ giáo dục.

- CSDL liên quan: bảng KhuVucUuTien - Mẫu thiết kế:

47

- Khi có thêm hồ sơ thí sinh mới thì người quản trị hệ thống(ngời sử dụng chương trình) có thể ấn vào nút “Thêm” để nhập thông tin khu vực ưu tiên của thí sinh mới. Khi nhập cần phải nhập đầy đủ thông tin vào các ô “Mã KV ƯT”, “Tên KV ƯT”. Đối với ô “Ghi Chú” có thể bỏ qua. Sau khi nhập xong muốn lưu trữ vào CSDL thì kích vào nút “Lưu”. Nút “Sửa” được sử dụng khi thông tin khu vực ưu tiên của thí sinh bị nhập sai hoặc có sự thay đổi. Nút “Xóa” sử dụng khi có thí sinh rút hồ sơ dự thi, không đăng ký tham gia thi nữa.. Người dùng ấn nút “Hủy” khi không muốn tiếp tục thực hiện thao tác đang thực hiện và muốn hủy bỏ. Nút thoát được thực hiện khi người dùng thoát ra khỏi chức năng cập nhật khu vực ưu tiên.

public partial class frmCapNhatKhuVucUuTien : DevComponents.DotNetBar.Office2007Form {

public frmCapNhatKhuVucUuTien() {

InitializeComponent(); }

private void khuVucUuTienBindingNavigatorSaveItem_Click(object sender, EventArgs e) { this.Validate(); this.khuVucUuTienBindingSource.EndEdit(); this.tableAdapterManager.UpdateAll(this.dtsQLTuyenSinh); }

private void frmCapNhatKhuVucUuTien_Load(object sender, EventArgs e) {

48

// TODO: This line of code loads data into the 'dtsQLTuyenSinh.KhuVucUuTien' table. You can move, or remove it, as needed.

this.khuVucUuTienTableAdapter.Fill(this.dtsQLTuyenSinh.KhuVucUuTien); unlocker();

}

private void locker() { btnThem.Enabled = false; btnXoa.Enabled = false; btnSua.Enabled = false; maKVUTTextBox.Enabled = true; tenKVUTTextBox.Enabled = true; ghiChuTextBox.Enabled = true; }

private void unlocker() { btnThem.Enabled = true; btnXoa.Enabled = true; btnSua.Enabled = true; maKVUTTextBox.Enabled = false; tenKVUTTextBox.Enabled = false; ghiChuTextBox.Enabled = false; }

private void btnThem_Click(object sender, EventArgs e) { locker(); maKVUTTextBox.Focus(); try { khuVucUuTienBindingSource.AddNew(); } catch {

lblThongBao.Text = "Không thể thêm. Có lỗi phát sinh"; }

}

private void btnSua_Click(object sender, EventArgs e) {

locker();

maKVUTTextBox.Focus(); }

private void btnXoa_Click(object sender, EventArgs e) {

locker();

if (DialogResult.Yes == MessageBox.Show("Bạn có chắc chắn muốn xóa?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question))

{ try {

khuVucUuTienBindingSource.RemoveCurrent(); lblThongBao.Text = "Xóa thành công"; }

49

{

lblThongBao.Text = "Không thể xóa"; }

} else (adsbygoogle = window.adsbygoogle || []).push({});

unlocker(); }

private void btnLuu_Click(object sender, EventArgs e) { unlocker(); try { Validate(); khuVucUuTienBindingSource.EndEdit(); tableAdapterManager.UpdateAll(dtsQLTuyenSinh); lblThongBao.Text = "Cập nhật dữ liệu thành công"; }

catch {

lblThongBao.Text = "Không cập nhật được dữ liệu"; }

}

private void btnHuy_Click(object sender, EventArgs e) {

unlocker();

khuVucUuTienBindingSource.CancelEdit();

lblThongBao.Text = "Bạn đã hủy một bước đã tạo"; }

private void btnThoat_Click(object sender, EventArgs e) {

this.Close(); }

}

Một phần của tài liệu HỆ THỐNG QUẢN LÝ TUYỂN SINH TRƯỜNG ĐẠI HỌC (Trang 46 - 49)