private void button1_Click(object sender, EventArgs e) { try { int Order_ID = Convert.ToInt32(dataGridView1.CurrentRow.Cells[0].Value); this.Cursor = Cursors.WaitCursor; RPT.RPT_Orders RPT = new RPT.RPT_Orders(); RPT.FRM_RPT_Medicine FRM = new RPT.FRM_RPT_Medicine(); RPT.SetDataSource(Order.Get_Order_Details(Order_ID)); FRM.crystalReportViewer1.ReportSource = RPT; FRM.ShowDialog(); this.Cursor = Cursors.Default; } catch { MessageBox.Show("حدث خطأ ما", "خطأ", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void button5_Click(object sender, EventArgs e) { try { //Get the last order int Order_ID = Convert.ToInt32(Order.Get_Last_Order_ID_For_Print().Rows[0][0]); this.Cursor = Cursors.WaitCursor; RPT.RPT_Orders RPT = new RPT.RPT_Orders(); RPT.FRM_RPT_Medicine FRM = new RPT.FRM_RPT_Medicine(); RPT.SetDataSource(Order.Get_Order_Details(Order_ID)); FRM.crystalReportViewer1.ReportSource = RPT; FRM.ShowDialog(); this.Cursor = Cursors.Default; } catch { MessageBox.Show("حدث خطأ ما", "خطأ", MessageBoxButtons.OK, MessageBoxIcon.Error); } }