Exemplo n.º 1
0
        public void loaddatabase()
        {
            HopDongDao  hd  = new HopDongDao();
            NhanvienDao nvd = new NhanvienDao();

            hopDongsBindingSource.DataSource = hd.loadtheoyeucau(nvd.getchucvutunhanvien(manvhientai), manvhientai);
        }
Exemplo n.º 2
0
 private void btnXoa_Click(object sender, EventArgs e)
 {
     if (txtMaHD.Text == "")
     {
         XtraMessageBox.Show("Bạn chưa chọn dòng!!");
     }
     else
     {
         DialogResult dialogResult = XtraMessageBox.Show("Xác nhận", "Bạn thực sự muốn xóa?", MessageBoxButtons.YesNo);
         if (dialogResult == DialogResult.Yes)
         {
             HopDongDao  hd  = new HopDongDao();
             NhanvienDao nvd = new NhanvienDao();
             hd.XoaHD(txtMaHD.Text);
             XtraMessageBox.Show("Đã xóa thành công!!");
             hopDongsBindingSource.DataSource = hd.loadtheoyeucau(nvd.getchucvutunhanvien(manvhientai), manvhientai);
             reset();
         }
     }
 }
Exemplo n.º 3
0
 private void btnSua_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtMaHD.Text == "" || cboMaGoiHD.Text == "" || cboMaChuKy.Text == "" || cboMaKH.Text == "" || txtMaNV.Text == "" || dtmNgayHieuLuc.Text == "")
         {
             XtraMessageBox.Show("Điền Đầy Đủ Thông Tin", "Thông báo");
         }
         else
         {
             HopDongDao  hd  = new HopDongDao();
             NhanvienDao nvd = new NhanvienDao();
             hd.SuaHD(txtMaHD.Text, cboMaGoiHD.Text, cboMaChuKy.Text, txtMaNV.Text, cboMaKH.Text, dtmNgayHieuLuc.DateTime);
             XtraMessageBox.Show("Sửa thành công", "Thông báo");
             hopDongsBindingSource.DataSource = hd.loadtheoyeucau(nvd.getchucvutunhanvien(manvhientai), manvhientai);
             txtGiaTriBaoHiem.Text            = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "GoiHopDong.GiaTriBaoHiem").ToString();
         }
     }
     catch (Exception ex)
     {
         XtraMessageBox.Show("Có lỗi xảy ra", "Thông báo");
     }
 }