/// <summary> /// The List method is used to fetch all objects within the corresponding database table. It uses /// the generic List method of the DataSQL class to fetch the instances. It uses Reflection to dynamically /// instantiate the object based on the generic type. /// </summary> /// <param name="id">The Customer primary key.</param> /// <returns>Returns a List of the transactions relating to a Customer.</returns> public static List <Transaction> List(int customerID) { Dictionary <string, object> parameters = new Dictionary <string, object>(); parameters.Add("@CustomerID", customerID); return(DataSQL <Transaction> .List(SQL_LIST_CUSTOMER, parameters)); }
/// <summary> /// The List method is used to fetch all objects within the corresponding database table. It uses /// the generic List method of the DataSQL class to fetch the instances. It uses Reflection to dynamically /// instantiate the object based on the generic type. /// </summary> /// <param name="id">The Customer primary key.</param> /// <returns>Returns a List of the Credit Cards.</returns> public static List <CreditCard> List(int customerID) { Dictionary <string, object> parameters = new Dictionary <string, object>(); parameters.Add("@CustomerID", customerID); return(DataSQL <CreditCard> .List(SQL_LIST, parameters)); }
/// <summary> /// The List method is used to fetch all objects within the corresponding database table. It uses /// the generic List method of the DataSQL class to fetch the instances. It uses Reflection to dynamically /// instantiate the object based on the generic type. /// </summary> /// <param name="id">The DVD primary key.</param> /// <returns>Returns a List of the DVD Copies.</returns> public static List <DVDCopy> List(int dvdID) { Dictionary <string, object> parameters = new Dictionary <string, object>(); parameters.Add("@dvdID", dvdID); return(DataSQL <DVDCopy> .List(SQL_LIST, parameters)); }
/// <summary> /// The List method is used to fetch all objects within the corresponding database table. It uses /// the generic List method of the DataSQL class to fetch the instances. It uses Reflection to dynamically /// instantiate the object based on the generic type. It doesn't however return a List of TransactionItem, /// instead it will return the DVDCopy objects relating to the Item. /// </summary> /// <param name="transactionID">The Transaction primary key.</param> /// <param name="TransactionType">The Transaction Type.</param> /// <returns>Returns a List of the DVD Copies.</returns> public static List <DVDCopy> List(int transactionID, TransactionItem.TransactionType type) { // Instantiates a empty list of DVDCopy. List <DVDCopy> list = new List <DVDCopy>(); // Prepares and adds the paramaters to the dictionary. Dictionary <string, object> parameters = new Dictionary <string, object>(); parameters.Add("@TransactionID", transactionID); parameters.Add("@Type", (int)type); // Executes the query through the helper, then iterates the resulting TransactionItems. foreach (TransactionItem item in DataSQL <TransactionItem> .List(SQL_LIST, parameters)) { // Adds each item's relating DVDCopy instance to the DVD Copy list. list.Add(item.copy); } return(list); // Returns the List. }
/// <summary> /// The List method is used to fetch all objects within the corresponding database table. It uses /// the generic List method of the DataSQL class to fetch the instances. It uses Reflection to dynamically /// instantiate the object based on the generic type. /// </summary> /// <returns>Returns a List of the objects.</returns> public static List <DVD> List() { return(DataSQL <DVD> .List(SQL_LIST, null)); }
/// <summary> /// The List method is used to fetch all objects within the corresponding database table. It uses /// the generic List method of the DataSQL class to fetch the instances. It uses Reflection to dynamically /// instantiate the object based on the generic type. /// </summary> /// <returns>Returns a List of the objects.</returns> public static List <Customer> List() { return(DataSQL <Customer> .List(SQL_LIST, null)); }
/// <summary> /// The List method is used to fetch all objects within the corresponding database table. It uses /// the generic List method of the DataSQL class to fetch the instances. It uses Reflection to dynamically /// instantiate the object based on the generic type. /// </summary> /// <returns>Returns a List of the objects.</returns> public static List <Transaction> List() { return(DataSQL <Transaction> .List(SQL_LIST, null)); }