private void btnSearch_Click(object sender, RoutedEventArgs e) { if (txbSearch.Text.Length > 0) { page = new Paging(Common.connection, "NhanVien where TrangThai = 0 and NhanVienId = '" + txbSearch.Text + "'", "NhanVienId desc"); QLVTDataSet.NhanVienDataTable nhanViens = new QLVTDataSet.NhanVienDataTable(); nhanViens.Rows.Clear(); DataTable dataTable = page.getPage(0); if (dataTable != null) { nhanViens.Merge(dataTable); nhanViens.DefaultView.RowFilter = "TrangThai <> 1"; } dgContent.ItemsSource = nhanViens; tableLog = new DataTableLog((DataTable)nhanViens); tblNumPage.Text = (page.currentIndex + 1) + "/" + (page.totalPage + 1); //QLVTDataSet.NhanVienDataTable nhanViens = new QLVTDataSet.NhanVienDataTable(); //try //{ // DataTable table = ((QLVTDataSet.NhanVienDataTable)dgContent.ItemsSource).Select("NhanVienId=" + txbSearch.Text).CopyToDataTable(); // nhanViens.Merge(table); // dgContent.ItemsSource = nhanViens; //} //catch (Exception ex) //{ // MessageBox.Show("Result not found!"); //} } }
public void loadData(int p) { try { Common.LoaiHangTableAdapter.Connection = Common.connection; Common.LoaiHangTableAdapter.Fill(Common.LoaiHangDataTable); page = new Paging(Common.connection, "MatHang", "MatHangId desc"); QLVTDataSet.MatHangDataTable VatTus = new QLVTDataSet.MatHangDataTable(); DataTable dataTable = page.getPage(p); if (dataTable != null) { VatTus.Merge(dataTable); } dgContent.ItemsSource = VatTus; tableLog = new DataTableLog((DataTable)dgContent.ItemsSource); tblNumPage.Text = (page.currentIndex + 1) + "/" + (page.totalPage + 1); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnSearch_Click(object sender, RoutedEventArgs e) { page = new Paging(Common.connection, "Kho where KhoId = '" + txbSearch.Text + "'", "KhoId desc"); QLVTDataSet.KhoDataTable khos = new QLVTDataSet.KhoDataTable(); DataTable dataTable = page.getPage(0); if (dataTable != null) { khos.Merge(dataTable); } dgContent.ItemsSource = khos; tableLog = new DataTableLog((DataTable)khos); tblNumPage.Text = (page.currentIndex + 1) + "/" + (page.totalPage + 1); }
private void btnSearch_Click(object sender, RoutedEventArgs e) { page = new Paging(Common.connection, "LoaiHang where LoaiHangId= '" + txbSearch.Text + "'", "LoaiHangId desc"); QLVTDataSet.LoaiHangDataTable DanhMucVatTus = new QLVTDataSet.LoaiHangDataTable(); DataTable dataTable = page.getPage(0); if (dataTable != null) { DanhMucVatTus.Merge(dataTable); } dgContent.ItemsSource = DanhMucVatTus; tableLog = new DataTableLog((DataTable)dgContent.ItemsSource); tblNumPage.Text = (page.currentIndex + 1) + "/" + (page.totalPage + 1); }
public void loadData(int p) { try { page = new Paging(Common.connection, "Kho", "KhoId desc"); QLVTDataSet.KhoDataTable khos = new QLVTDataSet.KhoDataTable(); DataTable dataTable = page.getPage(p); if (dataTable != null) { khos.Merge(dataTable); } dgContent.ItemsSource = khos; tableLog = new DataTableLog((DataTable)khos); tblNumPage.Text = (page.currentIndex + 1) + "/" + (page.totalPage + 1); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void loadData(int p) { try { page = new Paging(Common.connection, "NhanVien where TrangThai = 0", "NhanVienId desc"); QLVTDataSet.NhanVienDataTable nhanViens = new QLVTDataSet.NhanVienDataTable(); nhanViens.Rows.Clear(); DataTable dataTable = page.getPage(p); if (dataTable != null) { nhanViens.Merge(dataTable); } nhanViens.DefaultView.RowFilter = "TrangThai <> 1"; dgContent.ItemsSource = nhanViens; tableLog = new DataTableLog((DataTable)nhanViens); tblNumPage.Text = (page.currentIndex + 1) + "/" + (page.totalPage + 1); }catch (Exception ex) { MessageBox.Show(ex.Message); } }