private void LoadFromDB(int rptpk) { SQL_utils sql = new SQL_utils("data"); DataTable dt = sql.DataTable_from_SQLstring("select dataproj_pk, rpttitle, rptdesc, rptnum, rptfilename from dp.Report where rptpk=" + rptpk.ToString()); rptnum = Convert.ToInt32(dt.Rows[0]["rptnum"].ToString()); rpttitle = dt.Rows[0]["rpttitle"].ToString(); rptdesc = dt.Rows[0]["rptdesc"].ToString(); //Load the orders DataTable dt_orders = sql.DataTable_from_SQLstring("select orderpk, ordernum, ordertype, worksheet, filter, vars, objects, orderbinary from dp.ReportOrder where rptpk=" + rptpk.ToString()); if (dt_orders.HasRows()) { orders = new SessionOrders(); foreach (DataRow row in dt_orders.Rows) { byte[] orderbytes = (byte[])(row["orderbinary"]); DxChartOrder neworderC = new DxChartOrder(); using (MemoryStream ms = new MemoryStream(orderbytes)) { var ser2 = new BinaryFormatter(); neworderC = (DxChartOrder)(ser2.Deserialize(ms)); orders.chartorders.Add(neworderC); orders.orders.Add(neworderC); } } } sql.Close(); }
private void Initialize() { rptnum = GetRptnum(); rpttitle = String.Format("Report #{0}", rptnum); rptdesc = ""; orders = new SessionOrders(); }
public InvoiceSummary(SessionOrders orders) { CreateTable(); AddCharts(orders.chartorders); AddTables(orders.tableorders); }