private void txtTimKiem_KeyUp(object sender, KeyEventArgs e) { if (txtTimKiem.Text == "") { hienThiDSPhieuNhap(CPhieuNhapNguyenLieu_BUS.toList()); return; } // nếu combox tìm kiếm là 0 tức là tìm theo mã phiếu nhập if (cmbTimKiem.SelectedIndex == 0) { hienThiDSPhieuNhap(CPhieuNhapNguyenLieu_BUS.toListMa(txtTimKiem.Text)); } else { try { double tongThanhTien = double.Parse(txtTimKiem.Text); hienThiDSPhieuNhap(CPhieuNhapNguyenLieu_BUS.toListTongThanhTien(tongThanhTien)); } catch (ArgumentNullException) { MessageBox.Show("Dữ liệu không được để rỗng"); } catch (FormatException) { MessageBox.Show("Dữ liệu phải là số"); } catch (OverflowException) { MessageBox.Show("Dữ liệu có độ lớn vượt quá giới hạn cho phép"); } } }
public frmQuanLyNhapNguyenLieu(NhanVien nhanVien = null) { InitializeComponent(); hienThiDSPhieuNhap(CPhieuNhapNguyenLieu_BUS.toList()); if (nhanVien != null) { nhanVienSelect = nhanVien; } else { nhanVienSelect = new NhanVien(); } }
private void btnRefesh_Click(object sender, RoutedEventArgs e) { hienThiDSPhieuNhap(CPhieuNhapNguyenLieu_BUS.toList()); }