public override void Run(object context)
        {
            DbController dbc      = null;
            Relation     relation = Relation.ORDER_CUSTOMER;

            try
            {
                dbc = new DbController(Connection);
                dbc.CreateView(relation);

                DataTable dt = dbc.GetView(relation.ToString());

                if (dt.Rows.Count <= 0)
                {
                    Fail("Failed to create database view");
                }
                else
                {
                    ParseDataTable(dt);
                }
            }
            catch (Exception e)
            {
                Fail(e);
            }
            finally
            {
                dbc.DropView(relation.ToString());
                base.Run(context);
            }
        }
Exemplo n.º 2
0
        public override void Run(object context)
        {
            DbController dbc = null;
            try
            {
                Log(DbDefault.GetCreateViewStatement(Relation.CUSTOMER_ADDRESS));

                dbc = new DbController(Connection);
                dbc.CreateView(Relation.CUSTOMER_ADDRESS);

                DataTable table = Connection.GetSchema("Views");

                if (table.Rows.Count <= 0)
                    Fail("GetSchema('Views') did not return information.");


                table.Clear();
                Command.CommandText = "SELECT * FROM " + Relation.CUSTOMER_ADDRESS.ToString();
                DataAdapter.Fill(table);
                                
                ParseDataTable(table);
            }
            catch (Exception e)
            {
                Fail(e);
            }
            finally
            {
                dbc.DropView(Relation.CUSTOMER_ADDRESS.ToString());
                base.Run(context);
            }
        }
        public override void Run(object context)
        {
            DbController dbc = null;
            Relation relation = Relation.ORDERDETAIL_ORDER;

            try
            {
                dbc = new DbController(Connection);
                dbc.CreateView(relation);

                DataTable dt = dbc.GetView(relation.ToString());

                if (dt.Rows.Count <= 0)
                    Fail("Failed to create database view");
                else
                    ParseDataTable(dt);
            }
            catch (Exception e)
            {
                Fail(e);
            }
            finally
            {
                dbc.DropView(relation.ToString());
                base.Run(context);
            }
        }
Exemplo n.º 4
0
        public override void Run(object context)
        {
            DbController dbc = null;

            try
            {
                Log(DbDefault.GetCreateViewStatement(Relation.CUSTOMER_ADDRESS));

                dbc = new DbController(Connection);
                dbc.CreateView(Relation.CUSTOMER_ADDRESS);

                DataTable table = Connection.GetSchema("Views");

                if (table.Rows.Count <= 0)
                {
                    Fail("GetSchema('Views') did not return information.");
                }


                table.Clear();
                Command.CommandText = "SELECT * FROM " + Relation.CUSTOMER_ADDRESS.ToString();
                DataAdapter.Fill(table);

                ParseDataTable(table);
            }
            catch (Exception e)
            {
                Fail(e);
            }
            finally
            {
                dbc.DropView(Relation.CUSTOMER_ADDRESS.ToString());
                base.Run(context);
            }
        }