コード例 #1
0
        public void DeleteOrder(int ordernum_todelete)
        {
            DxOrder order_to_del = null;

            try
            {
                order_to_del = this.orders.Where(o => o.ordernum == ordernum_todelete).First();

                foreach (DxOrder ord in this.orders)
                {
                    if (ord.ordernum > ordernum_todelete)
                    {
                        ord.ordernum--;
                    }
                }
            }
            catch (Exception ex) { }


            if (order_to_del != null)
            {
                OrderType otype = order_to_del.ordertype;
                this.orders.Remove(order_to_del);

                if (otype == OrderType.chart)
                {
                    DxChartOrder chartorder_to_del = null;
                    try
                    {
                        chartorder_to_del = this.chartorders.Where(o => o.ordernum == ordernum_todelete).First();
                    }
                    catch (Exception ex) { }
                    if (order_to_del != null)
                    {
                        this.chartorders.Remove(chartorder_to_del);
                    }
                }
                else if (otype == OrderType.table)
                {
                    DxTableOrder tableorder_to_del = null;
                    try
                    {
                        tableorder_to_del = this.tableorders.Where(o => o.ordernum == ordernum_todelete).First();
                    }
                    catch (Exception ex) { }
                    if (order_to_del != null)
                    {
                        this.tableorders.Remove(tableorder_to_del);
                    }
                }
            }
        }
コード例 #2
0
        public void ProcessOrder(DxTableOrder order)
        {
            if (order.batches.Count > 0)
            {
                order.batches.Clear();
            }


            bool hassameworksheet = order.HasSameWorksheet(_dpdata);

            if (!hassameworksheet)
            {
                //Need new DPData
                _dataproject.selectedsheet = order.worksheet;
                _dpdata = new DPData(_dataproject, order.filter);
            }


            bool hassamefilter = order.HasSameFilter(_dpdata);

            if (!hassamefilter)
            {
                _dpdata.filter = order.filter;
            }

            _dt = _dpdata.dt;


            //Each order will result in a list of batches
            //List<DxBatchOcharts> batchlist = new List<DxBatchOcharts>();
            List <DxTableBatch> batchlist = new List <DxTableBatch>();

            foreach (DxTableSettings settings in order.list_settings)
            {
                if (settings.outputtype == DxOutputtype.Crosstabs)
                {
                    DxCrosstabsSettings mysettings = (DxCrosstabsSettings)settings;
                    DxTableBatch        batch      = new DxTableBatch(mysettings, dt);
                    PrepareBatch(batch, settings);
                    batchlist.Add(batch);
                }
            }

            order.batches.AddRange(batchlist);

            //The invoice serves as a table of contents for what was actually created
            order.PrepareInvoice();
        }
コード例 #3
0
 public void SaveOrder(DxTableOrder order)
 {
     order.ordernum = orders.Count + 1;
     orders.Add(order);
     tableorders.Add(order);
 }