Example #1
0
 private void btnXoa_Click(object sender, EventArgs e)
 {
     try
     {
         int idktkl = Convert.ToInt32(grvKTKL.GetFocusedDataRow()["KHENTHUONGKYLUATID"].ToString());
         int idnv   = (int)cboNhanVien.SelectedValue;
         if (KhenThuongKyLuatDAO.DeleteKTKL(idktkl) == 1)
         {
             MessageBox.Show("Thành công");
         }
         else
         {
             MessageBox.Show("Thất bại");
         }
         LoadKhenThuongKyLuat(idnv);
     }
     catch
     {
         return;
     }
 }
Example #2
0
 private void btnThem_Click(object sender, EventArgs e)
 {
     try
     {
         int      idnv     = (int)cboNhanVien.SelectedValue;
         int      hinhthuc = cboKTKL.SelectedIndex;
         string   noidung  = txbNoiDung.Text;
         DateTime thoigian = dtpThoiGian.DateTime;
         if (KhenThuongKyLuatDAO.InsertKTKL(idnv, hinhthuc, noidung, thoigian) == 1)
         {
             MessageBox.Show("Thành công");
         }
         else
         {
             MessageBox.Show("Thất bại");
         }
         LoadKhenThuongKyLuat(idnv);
     }
     catch
     {
         return;
     }
 }
Example #3
0
 private void btnSua_Click(object sender, EventArgs e)
 {
     try
     {
         int      idktkl   = Convert.ToInt32(grvKTKL.GetFocusedDataRow()["KHENTHUONGKYLUATID"].ToString());
         int      idnv     = (int)cboNhanVien.SelectedValue;
         int      hinhthuc = cboKTKL.SelectedIndex;
         string   noidung  = txbNoiDung.Text;
         DateTime thoigian = dtpThoiGian.DateTime;
         if (KhenThuongKyLuatDAO.UpdateKTKL(idktkl, idnv, hinhthuc, noidung, thoigian) == 1)
         {
             MessageBox.Show("Thành công");
         }
         else
         {
             MessageBox.Show("Thất bại");
         }
         LoadKhenThuongKyLuat(idnv);
     }
     catch
     {
         return;
     }
 }
Example #4
0
 void LoadKhenThuongKyLuat(int idnv)
 {
     list.DataSource = KhenThuongKyLuatDAO.LoadKhenThuongKyLuat(idnv);
 }