Beispiel #1
0
 private void btnSua_Click(object sender, EventArgs e)
 {
     if (dgvDSKyThi.RowCount > 0)
     {
         if (cbbLoaiKyThi.SelectedIndex == -1 || txtTenKyThi.Text == "" || cbbDeThi.SelectedIndex == -1 || cbbLoaiDeThi.SelectedIndex == -1 || cbbLop.SelectedIndex == -1 || dtGioThi.Text == "" || dtNgayThi.Text == "")
         {
             MessageBox.Show("Bạn chưa nhập đủ thông tin!!!");
             return;
         }
         _objkythi = new KyThi(dgvDSKyThi.CurrentRow.Cells[0].Value.ToString(),
                               txtTenKyThi.Text,
                               _objloaidethibus.GetMa_TheoTen_LoaiDeThi(cbbLoaiDeThi.Text),
                               _objdethibus.GetMa_TheoTen_DeThi(cbbDeThi.Text),
                               _objlopbus.GetMa_TheoTen_LopHoc(cbbLop.Text),
                               dtNgayThi.Text,
                               dtGioThi.Text,
                               _objphonghocbus.GetMa_TheoTen_PhongHoc(cbbPhongThi.Text),
                               _objloaikythibus.GetMa_TheoTen_LoaiKyThi(cbbLoaiKyThi.Text));
         if (_objkythibus.EditKyThi(_objkythi))
         {
             MessageBox.Show("Sửa Thành Công!!! ", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
             LoadData();
             resetbox();
         }
         else
         {
             MessageBox.Show("Sửa Thất Bại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     else
     {
         MessageBox.Show("Không có dữ liệu để sửa!!!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Beispiel #2
0
 private void btnLuu_Click(object sender, EventArgs e)
 {
     if (dtgDSHVDangKy.Rows.Count > 0)
     {
         for (int i = 0; i < dtgDSHVDangKy.Rows.Count; i++)
         {
             if (_objthongtindangkybus.Edit_TrangThai_ThongTinDangKy(dtgDSHVDangKy.Rows[i].Cells[1].Value.ToString(), "Đang học") &&
                 _objhocvienbus.Edit_MaLop_HocVien(dtgDSHVDangKy.Rows[i].Cells[1].Value.ToString(), _objlopbus.GetMa_TheoTen_LopHoc(dtgDSHVDangKy.Rows[i].Cells[5].Value.ToString())))
             {
                 dtgDSHVDangKy.Rows.Remove(dtgDSHVDangKy.Rows[i]);
                 i--;
                 LoadData();
             }
             else
             {
                 string a = dtgDSHVDangKy.Rows[i].Cells[0].Value.ToString();
                 MessageBox.Show("Lưu dòng " + a + " thất bại");
             }
         }
         if (dtgDSHVDangKy.Rows.Count == 0)
         {
             MessageBox.Show("Lưu thành công");
             resettextbox();
         }
     }
     else
     {
         MessageBox.Show("Không có dữ liệu để lưu ! ", "Thống báo ", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Beispiel #3
0
        private void btnLuu_Click(object sender, EventArgs e)
        {
            if (dgvKyThi.Rows.Count > 0)
            {
                for (int i = 0; i < dgvKyThi.Rows.Count; i++)
                {
                    _objkythi = new KyThi(_objkythibus.KyThi_NextID(),
                                          dgvKyThi.Rows[i].Cells[1].Value.ToString(),
                                          _objloaidethibus.GetMa_TheoTen_LoaiDeThi(dgvKyThi.Rows[i].Cells[2].Value.ToString()),
                                          _objdethibus.GetMa_TheoTen_DeThi(dgvKyThi.Rows[i].Cells[3].Value.ToString()),
                                          _objlopbus.GetMa_TheoTen_LopHoc(dgvKyThi.Rows[i].Cells[4].Value.ToString()),
                                          dgvKyThi.Rows[i].Cells[5].Value.ToString(),
                                          dgvKyThi.Rows[i].Cells[6].Value.ToString(),
                                          _objphonghocbus.GetMa_TheoTen_PhongHoc(dgvKyThi.Rows[i].Cells[7].Value.ToString()),
                                          _objloaikythibus.GetMa_TheoTen_LoaiKyThi(cbbLoaiKyThi.Text));
                    if (_objkythibus.AddKyThi(_objkythi))
                    {
                        dgvKyThi.Rows.Remove(dgvKyThi.Rows[i]);
                        i--;
                        LoadData();
                        resetbox();
                    }
                    else
                    {
                        string a = dgvKyThi.Rows[i].Cells[0].Value.ToString();
                        MessageBox.Show("Lưu dòng " + a + "thất bại!!!");
                    }

                    if (dgvKyThi.Rows.Count == 0)
                    {
                        MessageBox.Show("Lưu thành công!!!");
                    }
                }
            }
            else
            {
                MessageBox.Show("Không có dữ liệu để lưu!!!");
            }
        }
Beispiel #4
0
        private void btnSua_Click(object sender, EventArgs e)
        {
            try
            {
                if ((txtTenHocVien.Text == "") || (txtSDT.Text == "") || (txtDiaChi.Text == ""))
                {
                    MessageBox.Show("Bạn còn số liệu chưa nhập ");
                    return;
                }
                string _maHV = dtgDSHVChinhThuc.CurrentRow.Cells[0].Value.ToString();//cbbMaHocVien.Text;
                //Them hoc vien
                _objhocvien = new HocVien(
                    _maHV,
                    txtTenHocVien.Text,                                    //hoten
                    dtgDSHVChinhThuc.CurrentRow.Cells[2].Value.ToString(), //gioitinh
                    txtDiaChi.Text,                                        //diachi
                    txtSDT.Text,                                           //sdt
                    _objlopbus.GetMa_TheoTen_LopHoc(cbbLopHoc.Text),
                    Double.Parse(lblHocPhi.Text));

                if (_objhocvienbus.EditHocVien(_objhocvien))
                {
                    LoadData();
                    MessageBox.Show("Sửa Thành Công ", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    resettextbox();
                }
                else
                {
                    MessageBox.Show("Sửa Thất Bại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch
            {
                MessageBox.Show("Bạn đã nhập sai thông tin, vui lòng nhập lại  !", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #5
0
        private void btTim_Click(object sender, EventArgs e)
        {
            DataTable _dttimhocvien;

            if (cbbChonLop.Text == "")
            {
                _dttimhocvien             = _objhocvienbus.FindTenHV_ChinhThuc(txtTimTenHocVien.Text);
                dtgDSHVTheoLop.DataSource = _dttimhocvien;
            }
            else
            {
                _dttimhocvien             = _objhocvienbus.FindTenHV_ChinhThuc_TheoMaLop_TenHV(_objlopbus.GetMa_TheoTen_LopHoc(cbbChonLop.Text), txtTimTenHocVien.Text);
                dtgDSHVTheoLop.DataSource = _dttimhocvien;
            }

            dtgDSHVTheoLop.RowHeadersVisible = false;
            //Load DS hoc vien chinh thuc
            dtgDSHVTheoLop.RowHeadersVisible                       = true;
            dtgDSHVTheoLop.Columns["STT"].DisplayIndex             = 0;
            dtgDSHVTheoLop.Columns["STT"].Width                    = 40;
            dtgDSHVTheoLop.Columns["MaHV"].HeaderText              = "Mã Học Viên";
            dtgDSHVTheoLop.Columns["MaHV"].Width                   = 70;
            dtgDSHVTheoLop.Columns["HoTen"].HeaderText             = "Tên Học Viên";
            dtgDSHVTheoLop.Columns["HoTen"].Width                  = 150;
            dtgDSHVTheoLop.Columns["SDT"].HeaderText               = "SĐT";
            dtgDSHVTheoLop.Columns["DiaChi"].HeaderText            = "Địa Chỉ";
            dtgDSHVTheoLop.Columns["Phai"].Visible                 = false;
            dtgDSHVTheoLop.Columns["NoHP"].HeaderText              = "Nợ học phí";
            dtgDSHVTheoLop.Columns["TenLop"].HeaderText            = "Lớp";
            dtgDSHVTheoLop.Columns["TenChuongTrinhHoc"].HeaderText = "Chương trình học";
            dtgDSHVTheoLop.Columns["TenKhoaHoc"].HeaderText        = "Khóa học";
            dtgDSHVTheoLop.ClearSelection();
        }