private void gridViewDSNhanVien_Click(object sender, EventArgs e) { try { var rowHandle = gridViewDSNhanVien.FocusedRowHandle; this.nhanvienId_Select = O2S_Common.TypeConvert.Parse.ToInt32(gridViewDSNhanVien.GetRowCellValue(rowHandle, "NhanVienId").ToString()); NHANVIEN hocVien = NhanVienLogic.SelectSingle(this.nhanvienId_Select); LoadPanelControl(hocVien); LockAndUnlockPanelControl(false); } catch (Exception ex) { O2S_Common.Logging.LogSystem.Error(ex); } }
private void btnXoa_Click(object sender, EventArgs e) { try { if (MessageBox.Show("Bạn có muốn xóa?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { if (NhanVienLogic.Delete(this.nhanvienId_Select)) { O2S_Common.Utilities.ThongBao.frmThongBao frmthongbao = new O2S_Common.Utilities.ThongBao.frmThongBao(Base.ThongBaoLable.XOA_THANH_CONG); frmthongbao.Show(); LoadDanhSachNhanVien(); ResetPanelControl(); } } } catch (Exception ex) { O2S_Common.Utilities.ThongBao.frmThongBao frmthongbao = new O2S_Common.Utilities.ThongBao.frmThongBao(Base.ThongBaoLable.CO_LOI_XAY_RA); frmthongbao.Show(); O2S_Common.Logging.LogSystem.Error(ex); } }
private void btnLuuThongTin_Click(object sender, EventArgs e) { try { ValidateLuu(); if (isInsert) { ValidateTrungTaiKhoan(txtTenDangNhap.Text); if (NhanVienLogic.InsertAndTaiKhoan(LoadNhanVien(), LoadTaiKhoan())) { LoadDanhSachNhanVien(); O2S_Common.Utilities.ThongBao.frmThongBao frmthongbao = new O2S_Common.Utilities.ThongBao.frmThongBao(Base.ThongBaoLable.THEM_MOI_THANH_CONG); frmthongbao.Show(); LockAndUnlockPanelControl(false); } } else { if (NhanVienLogic.Update(LoadNhanVien(), LoadTaiKhoan())) { LoadDanhSachNhanVien(); O2S_Common.Utilities.ThongBao.frmThongBao frmthongbao = new O2S_Common.Utilities.ThongBao.frmThongBao(Base.ThongBaoLable.CAP_NHAT_THANH_CONG); frmthongbao.Show(); LockAndUnlockPanelControl(false); } } } catch (ArgumentException ex) { MessageBox.Show(ex.Message, "Cảnh báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } catch (Exception ex) { O2S_Common.Utilities.ThongBao.frmThongBao frmthongbao = new O2S_Common.Utilities.ThongBao.frmThongBao(Base.ThongBaoLable.CO_LOI_XAY_RA); frmthongbao.Show(); O2S_Common.Logging.LogSystem.Error(ex); } }
private void LoadDanhSachNhanVien() { try { NhanVienFilter _filter = new NhanVienFilter(); _filter.NgayBatDauLamViec_Tu = date_TuNgay.DateTime; _filter.NgayBatDauLamViec_Den = date_DenNgay.DateTime; List <NhanVien_PlusDTO> _lstNhanVien = NhanVienLogic.Select(_filter); if (_lstNhanVien != null && _lstNhanVien.Count > 0) { gridControlDSNhanVien.DataSource = _lstNhanVien; lblTongCong.Text = string.Format("Tổng cộng: {0} nhân viên)", _lstNhanVien.Count); } else { gridControlDSNhanVien.DataSource = null; lblTongCong.Text = string.Format("Tổng cộng: {0} nhân viên)", 0); } } catch (Exception ex) { O2S_Common.Logging.LogSystem.Warn(ex); } }