Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
 private void Initialize()
 {
     rptnum   = GetRptnum();
     rpttitle = String.Format("Report #{0}", rptnum);
     rptdesc  = "";
     orders   = new SessionOrders();
 }
Exemplo n.º 3
0
 public InvoiceSummary(SessionOrders orders)
 {
     CreateTable();
     AddCharts(orders.chartorders);
     AddTables(orders.tableorders);
 }