Ejemplo n.º 1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (kq.kiemtraquyenuser(FormDangnhap.loginUsename, "lop", "add") == true)
            {
                if (!string.IsNullOrEmpty(txtMalop.Text))
                {
                    txtMalop.Text = "";
                    return;
                }

                Khoa kh = _khoa.getByName(cmbKhoa.Text);
                if (kh == null)
                {
                    MessageBox.Show("Có lỗi xãy ra.");
                    return;
                }

                if (_lh.isValid(txtTenlop.Text, kh.Makhoa))
                {
                    _lh.add(_lh.getNewID(), txtTenlop.Text, kh.Makhoa);
                    loadDataTable();

                    MessageBox.Show("Thêm thành công.");
                }
                else
                {
                    MessageBox.Show("Vui lòng nhập dữ liệu.");
                }
            }
            else
            {
                MessageBox.Show("Bạn không có quyền thực hiện lệnh này");
            }
        }
Ejemplo n.º 2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (kq.kiemtraquyenuser(FormDangnhap.loginUsename, "giaovien", "add") == true)
            {
                if (!string.IsNullOrEmpty(txtMa.Text))
                {
                    txtMa.Text = "";
                    return;
                }

                Khoa kh = _khoa.getByName(cmbKhoa.Text);
                if (kh == null)
                {
                    MessageBox.Show("Có lỗi xãy ra.");
                    return;
                }

                if (_gv.isValid(txtHoTen.Text, dtimeNgaySinh.Value.ToString("dd/MM/yyyy"), cmbGioiTinh.Text, txtDiaChi.Text, txtDienThoai.Text, txtEmail.Text, kh.Makhoa, cmbTrinhDo.Text, txtCMND.Text, txtQuocTich.Text, txtNangKhieu.Text))
                {
                    if (_gv.isExist(txtMa.Text))
                    {
                        MessageBox.Show("Mã môn học đã tồn tại.");
                        return;
                    }
                    _gv.add(_gv.getNewID(), txtHoTen.Text, dtimeNgaySinh.Value.ToString("dd/MM/yyyy"), cmbGioiTinh.Text, txtDiaChi.Text, txtDienThoai.Text, txtEmail.Text, kh.Makhoa, cmbTrinhDo.Text, txtCMND.Text, txtQuocTich.Text, txtNangKhieu.Text);
                    loadDataTable();
                }
                else
                {
                    MessageBox.Show("Vui lòng nhập dữ liệu.");
                }
            }
            else
            {
                MessageBox.Show("Bạn không có quyền thực hiện lệnh này");
            }
        }
Ejemplo n.º 3
0
        private void luu_Click(object sender, EventArgs e)
        {
            if (kq.kiemtraquyenuser(FormDangnhap.loginUsename, "sinhvien", "up") == true)
            {
                Khoa k = kh.getByName(khoasv.Text);
                SinhVienRepositories sv = new SinhVienRepositories();
                if (sv.updatesv(masv.Text, Tensv.Text, ngaysinh.Text, diachi.Text, gioitinh.Text, dienthoai.Text,
                                cmbLop.Text, khoahoc.Text, k.Makhoa, bacdaotao.Text, cmnd.Text) == 1)
                {
                    MessageBox.Show("Bạn đã cập nhật thành công");
                }
            }

            else
            {
                MessageBox.Show("Bạn không có quyền thực hiện lệnh này");
            }
        }