private void simpleButton2_Click(object sender, EventArgs e) { var db = new MyDBContextDataContext(); var khonvl = db.tbKhoNLVs.ToList(); var tong = 0; foreach (var item in khonvl) { if (item.MaPhieu != MaPhieutxt.Text) { continue; } tong = 1; var rp = new rpPhieuXuatKhoNVL(); rp.DataSource = knvlCtr.GetData("MaPhieu", MaPhieutxt.Text); rp.databing(); rp.ShowRibbonPreviewDialog(); break; } if (tong == 0) { MessageBox.Show("Vui lòng Lưu kho mã phiếu " + MaPhieutxt.Text + " này trước khi in"); } }
private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { var maphieu = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, colMaPhieu).ToString(); var rp = new rpPhieuXuatKhoNVL(); var dt = KnvlCtr.GetData("MaPhieu", maphieu); rp.DataSource = dt; rp.databing(); rp.ShowRibbonPreviewDialog(); }