private void btn_themLopHoc_Click(object sender, EventArgs e) { if (lke_makh.Text.Trim() == "" || lke_maNhanVien.Text.Trim() == "" || cbo_maPhong.Text.Trim() == "" || cbo_lichHoc.Text.Trim() == "" || txt_gioBatDau.Text.Trim() == "" || txt_gioKetThuc.Text.Trim() == "") { XtraMessageBox.Show("Chưa điền đầy đủ thông tin!!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { if (lopDTO != null) { GetDetail(); int kq = lopBUS.AddLop(lopDTO); if (kq == 1) { XtraMessageBox.Show(string.Format("Thêm lớp học {0} thành công!", lopDTO.TenLop), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); LoadDSKhoaHoc(); btn_themLopHoc.Enabled = false; btn_suaLopHoc.Enabled = true; dgcontrol_lopHoc.Enabled = true; } else { XtraMessageBox.Show("Thêm không thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } } }
private void btn_themLopHoc_Click(object sender, EventArgs e) { if (lke_makh.Text.Trim() == "" || lke_maNhanVien.Text.Trim() == "" || lke_phongHoc.Text.Trim() == "" || cbo_lichHoc.Text.Trim() == "" || time_gioBatDau.Text.Trim() == "" || time_gioKetThuc.Text.Trim() == "") { XtraMessageBox.Show("Chưa điền đầy đủ thông tin!!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { if (lopDTO != null) { GetDetail(); int kq = lopBUS.AddLop(lopDTO); if (kq == 1) { XtraMessageBox.Show(string.Format("Thêm lớp học {0} thành công!", lopDTO.TenLop), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); LoadDSLop(); btn_themLopHoc.Enabled = false; btn_suaLopHoc.Enabled = true; btn_xoaLopHoc.Enabled = true; dgcontrol_lopHoc.Enabled = true; btn_lamMoiLopHoc.Text = "Làm mới"; btn_lamMoiLopHoc.ImageOptions.Image = EnglishCenterManagement.Properties.Resources.refresh; } else { XtraMessageBox.Show("Thêm không thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } } }