示例#1
0
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         rptPurchaseForm report = new rptPurchaseForm(id);
         report.ShowDialog();
         this.SuspendLayout();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message.ToString());
     }
 }
示例#2
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            string id = "";

            if (gridView.SelectedCells.Count != 0)
            {
                try
                {
                    DataGridViewCell cell = gridView.SelectedCells[0];
                    DataGridViewRow  row  = cell.OwningRow;
                    id = row.Cells[0].Value.ToString();

                    rptPurchaseForm report = new rptPurchaseForm(id);
                    report.ShowDialog();
                    this.SuspendLayout();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message.ToString());
                }
            }
        }