private void PrintReport() { List <int> id_card = new List <int>(); List <ACS> checkedACS = dgvACS.GetCheckedRecords <ACS>(); if (checkedACS.Count > 0) { foreach (ACS acs in checkedACS) { id_card.Add(acs.PersCard_Id); } } else { if (dgvACS.CurrentRow != null) { ACS acs = dgvACS.CurrentRow.DataBoundItem as ACS; if (acs != null) { id_card.Add(acs.PersCard_Id); } } } fmReport report = new fmReport(this, id_card, true); report.ShowDialog(); }
/// <summary> /// Báo cáo / Thống kê /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnReport_Click(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; fmReport fm = new fmReport(); this.Hide(); this.Cursor = Cursors.Default; fm.ShowDialog(); this.Show(); } catch (Exception ex) { MessageBox.Show("Lỗi\n" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); this.Close(); } }