private void frmQuanLyNhanVien_Load(object sender, EventArgs e) { try { SetGridViewStyle(dgvLichLamViec); BindGrid(LichLamViec.GetAll()); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnXoaLichLamViec_Click(object sender, EventArgs e) { try { int rowIndex = (int)dgvCapNhatLichLamViec.CurrentRow.Cells[4].Value; LichLamViec.Delete(rowIndex); BindGrid(LichLamViec.GetAll()); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void frmCapNhatLichLamViec_Load(object sender, EventArgs e) { try { SetGridViewStyle(dgvCapNhatLichLamViec); FillTenNhanVienCombobox(NhanVien.GetAll()); FillCaCombobox(LichLamViec.GetAll());; BindGrid(LichLamViec.GetAll()); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnSuaLichLamViec_Click(object sender, EventArgs e) { LichLamViec s = GetLichLamViec(); s.LichLamViecID = (int)dgvCapNhatLichLamViec.CurrentRow.Cells[4].Value; LichLamViec db = LichLamViec.GetLichLamViec(s.LichLamViecID); if (db != null) { db = s; db.InsertUpdate(); MessageBox.Show("Sửa thành công!"); } BindGrid(LichLamViec.GetAll()); }
private void btnThemLichLamViec_Click(object sender, EventArgs e) { try { LichLamViec s = GetLichLamViec(); LichLamViec db = LichLamViec.GetLichLamViec(s.LichLamViecID); if (db == null) { s.InsertUpdate(); MessageBox.Show("Thêm Lịch Làm Việc thành công!"); } BindGrid(LichLamViec.GetAll()); } catch (Exception ex) { MessageBox.Show(ex.Message); } }