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); }
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); }
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)); }
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 <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); }
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)); }
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); }
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)); }
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); }
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 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); }