Beispiel #1
0
        public Supplier SelectRandom()
        {
            DataRow row = (DataRow)GFXDDbi.Select(QualifyTableName(
                                                      DbDefault.GetSelectRandomStatement(TableName.SUPPLIER, 1)), QueryTypes.DATAROW);

            return(new Supplier(row));
        }
Beispiel #2
0
        public Category SelectRandom()
        {
            DataRow row = (DataRow)GFXDDbi.Select(QualifyTableName(
                                                      DbDefault.GetSelectRandomStatement(TableName.CATEGORY, 1)), QueryTypes.DATAROW);

            return(new Category(row));
        }
Beispiel #3
0
        public IList <Order> SelectByCustomer(long customerId)
        {
            String statement = QualifyTableName(DbDefault.GetSelectStatement(
                                                    TableName.ORDERS, String.Format("customer_id = {0}", customerId)));

            DataTable table = null;

            if (Connection != null)
            {
                table = (DataTable)GFXDDbi.Select(Connection, statement, QueryTypes.DATATABLE);
            }
            else
            {
                table = (DataTable)GFXDDbi.Select(statement, QueryTypes.DATATABLE);
            }

            IList <Order> orders = new List <Order>();

            foreach (DataRow row in table.Rows)
            {
                orders.Add(new Order(row));
            }

            return(orders);
        }
Beispiel #4
0
        public OrderDetail SelectRandom()
        {
            DataRow row = (DataRow)GFXDDbi.Select(QualifyTableName(
                                                      DbDefault.GetSelectRandomStatement(TableName.ORDERDETAIL, 1)), QueryTypes.DATAROW);

            return(new OrderDetail(row));
        }
Beispiel #5
0
        public Address SelectRandom()
        {
            DataRow row = (DataRow)GFXDDbi.Select(QualifyTableName(
                                                      DbDefault.GetSelectRandomStatement(TableName.ADDRESS, 1)), QueryTypes.DATAROW);

            return(new Address(row));
        }
        public Product SelectRandom()
        {
            DataRow row = (DataRow)GFXDDbi.Select(QualifyTableName(
                                                      DbDefault.GetSelectRandomStatement(TableName.PRODUCT, 1)), QueryTypes.DATAROW);

            return(new Product(row));
        }
Beispiel #7
0
        public IList <OrderDetail> Select(long orderId)
        {
            String statement = QualifyTableName(DbDefault.GetSelectStatement(
                                                    TableName.ORDERDETAIL, new long[] { orderId }));

            DataTable table = null;

            if (Connection != null)
            {
                table = (DataTable)GFXDDbi.Select(Connection, statement, QueryTypes.DATATABLE);
            }
            else
            {
                table = (DataTable)GFXDDbi.Select(statement, QueryTypes.DATATABLE);
            }

            IList <OrderDetail> orderdetails = new List <OrderDetail>();

            foreach (DataRow row in table.Rows)
            {
                orderdetails.Add(new OrderDetail(row));
            }

            return(orderdetails);
        }
Beispiel #8
0
        public Customer SelectRandom()
        {
            DataRow row = (DataRow)GFXDDbi.Select(QualifyTableName(
                                                      DbDefault.GetSelectRandomStatement(TableName.CUSTOMER, 1)), QueryTypes.DATAROW);

            return(new Customer(row));
        }
        public IList <Product> SelectRandom(int numRecords)
        {
            DataTable table = (DataTable)GFXDDbi.Select(QualifyTableName(
                                                            DbDefault.GetSelectRandomStatement(TableName.PRODUCT, numRecords)), QueryTypes.DATATABLE);

            IList <Product> products = new List <Product>();

            foreach (DataRow row in table.Rows)
            {
                products.Add(new Product(row));
            }

            return(products);
        }
Beispiel #10
0
        public IList <Customer> SelectRandom(int numRecords)
        {
            DataTable table = (DataTable)GFXDDbi.Select(QualifyTableName(
                                                            DbDefault.GetSelectRandomStatement(TableName.CUSTOMER, numRecords)), QueryTypes.DATATABLE);

            IList <Customer> customers = new List <Customer>();

            foreach (DataRow row in table.Rows)
            {
                customers.Add(new Customer(row));
            }

            return(customers);
        }
Beispiel #11
0
        public IList <Category> SelectRandom(int numRecords)
        {
            DataTable table = (DataTable)GFXDDbi.Select(QualifyTableName(
                                                            DbDefault.GetSelectRandomStatement(TableName.CATEGORY, numRecords)), QueryTypes.DATATABLE);

            IList <Category> categories = new List <Category>();

            foreach (DataRow row in table.Rows)
            {
                categories.Add(new Category(row));
            }

            return(categories);
        }
Beispiel #12
0
        public IList <Supplier> SelectRandom(int numRecords)
        {
            DataTable table = (DataTable)GFXDDbi.Select(QualifyTableName(
                                                            DbDefault.GetSelectRandomStatement(TableName.SUPPLIER, numRecords)), QueryTypes.DATATABLE);

            IList <Supplier> suppliers = new List <Supplier>();

            foreach (DataRow row in table.Rows)
            {
                suppliers.Add(new Supplier(row));
            }

            return(suppliers);
        }
Beispiel #13
0
        public IList <Address> SelectRandom(int numRecords)
        {
            DataTable table = (DataTable)GFXDDbi.Select(QualifyTableName(
                                                            DbDefault.GetSelectRandomStatement(TableName.ADDRESS, numRecords)), QueryTypes.DATATABLE);

            IList <Address> addresses = new List <Address>();

            foreach (DataRow row in table.Rows)
            {
                addresses.Add(new Address(row));
            }

            return(addresses);
        }
Beispiel #14
0
        public IList <OrderDetail> SelectRandom(int numRecords)
        {
            DataTable table = (DataTable)GFXDDbi.Select(QualifyTableName(
                                                            DbDefault.GetSelectRandomStatement(TableName.ORDERDETAIL, numRecords)), QueryTypes.DATATABLE);

            IList <OrderDetail> orderdetails = new List <OrderDetail>();

            foreach (DataRow row in table.Rows)
            {
                orderdetails.Add(new OrderDetail(row));
            }

            return(orderdetails);
        }
Beispiel #15
0
        public Category Select(long categoryId)
        {
            String statement = QualifyTableName(DbDefault.GetSelectStatement(
                                                    TableName.CATEGORY, new long[] { categoryId }));

            DataRow row = null;

            if (Connection != null)
            {
                row = (DataRow)GFXDDbi.Select(Connection, statement, QueryTypes.DATAROW);
            }
            else
            {
                row = (DataRow)GFXDDbi.Select(statement, QueryTypes.DATAROW);
            }

            if (row == null)
            {
                return(null);
            }

            return(new Category(row));
        }
        public Product Select(long productId)
        {
            String statement = QualifyTableName(DbDefault.GetSelectStatement(
                                                    TableName.PRODUCT, new long[] { productId }));

            DataRow row = null;

            if (Connection != null)
            {
                row = (DataRow)GFXDDbi.Select(Connection, statement, QueryTypes.DATAROW);
            }
            else
            {
                row = (DataRow)GFXDDbi.Select(statement, QueryTypes.DATAROW);
            }

            if (row == null)
            {
                return(null);
            }

            return(new Product(row));
        }
Beispiel #17
0
        public OrderDetail Select(long orderId, long productId)
        {
            String statement = QualifyTableName(DbDefault.GetSelectStatement(
                                                    TableName.ORDERDETAIL, new long[] { orderId, productId }));

            DataRow row = null;

            if (Connection != null)
            {
                row = (DataRow)GFXDDbi.Select(Connection, statement, QueryTypes.DATAROW);
            }
            else
            {
                row = (DataRow)GFXDDbi.Select(statement, QueryTypes.DATAROW);
            }

            if (row == null)
            {
                return(null);
            }

            return(new OrderDetail(row));
        }
        public IList <Product> Select()
        {
            String    statement = QualifyTableName(DbDefault.GetSelectStatement(TableName.PRODUCT));
            DataTable table     = null;

            if (Connection != null)
            {
                table = (DataTable)GFXDDbi.Select(Connection, statement, QueryTypes.DATATABLE);
            }
            else
            {
                table = (DataTable)GFXDDbi.Select(statement, QueryTypes.DATATABLE);
            }

            IList <Product> products = new List <Product>();

            foreach (DataRow row in table.Rows)
            {
                products.Add(new Product(row));
            }

            return(products);
        }
Beispiel #19
0
        public IList <Category> Select()
        {
            String    statement = QualifyTableName(DbDefault.GetSelectStatement(TableName.CATEGORY));
            DataTable table     = null;

            if (Connection != null)
            {
                table = (DataTable)GFXDDbi.Select(Connection, statement, QueryTypes.DATATABLE);
            }
            else
            {
                table = (DataTable)GFXDDbi.Select(statement, QueryTypes.DATATABLE);
            }

            IList <Category> categories = new List <Category>();

            foreach (DataRow row in table.Rows)
            {
                categories.Add(new Category(row));
            }

            return(categories);
        }
Beispiel #20
0
        public IList <Supplier> Select()
        {
            String    statement = QualifyTableName(DbDefault.GetSelectStatement(TableName.SUPPLIER));
            DataTable table     = null;

            if (Connection != null)
            {
                table = (DataTable)GFXDDbi.Select(Connection, statement, QueryTypes.DATATABLE);
            }
            else
            {
                table = (DataTable)GFXDDbi.Select(statement, QueryTypes.DATATABLE);
            }

            IList <Supplier> suppliers = new List <Supplier>();

            foreach (DataRow row in table.Rows)
            {
                suppliers.Add(new Supplier(row));
            }

            return(suppliers);
        }
Beispiel #21
0
        public Supplier Select(long supplierId)
        {
            String statement = QualifyTableName(DbDefault.GetSelectStatement(
                                                    TableName.SUPPLIER, new long[] { supplierId }));

            DataRow row = null;

            if (Connection != null)
            {
                row = (DataRow)GFXDDbi.Select(Connection, statement, QueryTypes.DATAROW);
            }
            else
            {
                row = (DataRow)GFXDDbi.Select(statement, QueryTypes.DATAROW);
            }

            if (row == null)
            {
                return(null);
            }

            return(new Supplier(row));
        }
Beispiel #22
0
        public Address Select(long addressId)
        {
            String statement = QualifyTableName(DbDefault.GetSelectStatement(
                                                    TableName.ADDRESS, new long[] { addressId }));

            DataRow row = null;

            if (Connection != null)
            {
                row = (DataRow)GFXDDbi.Select(Connection, statement, QueryTypes.DATAROW);
            }
            else
            {
                row = (DataRow)GFXDDbi.Select(statement, QueryTypes.DATAROW);
            }

            if (row == null)
            {
                return(null);
            }

            return(new Address(row));
        }
Beispiel #23
0
        public IList <Address> Select()
        {
            String statement = QualifyTableName(DbDefault.GetSelectStatement(TableName.ADDRESS));

            DataTable table = null;

            if (Connection != null)
            {
                table = (DataTable)GFXDDbi.Select(Connection, statement, QueryTypes.DATATABLE);
            }
            else
            {
                table = (DataTable)GFXDDbi.Select(statement, QueryTypes.DATATABLE);
            }

            IList <Address> addresses = new List <Address>();

            foreach (DataRow row in table.Rows)
            {
                addresses.Add(new Address(row));
            }

            return(addresses);
        }
Beispiel #24
0
 public long SelectCount()
 {
     return(Convert.ToInt64(GFXDDbi.Select(Connection, QualifyTableName(
                                               DbDefault.GetSelectCountStatement(TableName.ADDRESS)), QueryTypes.SCALAR)));
 }