protected override void SetUp()
        {
            mProps    = new CustomerProps();
            mOldProps = new CustomerProps();

            if (this.mConnectionString == "")
            {
                mdbReadable  = new CustomerDB();
                mdbWriteable = new CustomerDB();
            }

            else
            {
                mdbReadable  = new CustomerDB(this.mConnectionString);
                mdbWriteable = new CustomerDB(this.mConnectionString);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Retrieves a list of Events.
        /// </summary>
        ///
        // *** I had to change this
        public static List <Product> GetList(string cnString)
        {
            ProductDB           db       = new ProductDB(cnString);
            List <Product>      products = new List <Product>();
            List <ProductProps> props    = new List <ProductProps>();

            // *** methods in the textdb and sqldb classes don't match
            // Ideally, I should go back and fix the IReadDB interface!
            props = (List <ProductProps>)db.RetrieveAll(props.GetType());
            foreach (ProductProps prop in props)
            {
                // *** creates the business object from the props objet
                Product p = new Product(prop, cnString);
                Product.Add(p);
            }

            return(products);
        }
Beispiel #3
0
        /// <summary>
        /// Retrieves a list of Customers.
        /// </summary>
        public static List <Customer> GetList(string cnString)
        {
            CustomerDB           db        = new CustomerDB(cnString);
            List <Customer>      customers = new List <Customer>();
            List <CustomerProps> props     = new List <CustomerProps>();

            // *** methods in the textdb and sqldb classes don't match
            // Ideally, I should go back and fix the IReadDB interface!
            props = (List <CustomerProps>)db.RetrieveAll(props.GetType());
            foreach (CustomerProps prop in props)
            {
                // *** creates the business object from the props objet
                Customer c = new Customer(prop, cnString);
                customers.Add(c);
            }

            return(customers);
        }
Beispiel #4
0
        public static void Delete(CustomerProps c)
        {
            CustomerDB db = new CustomerDB();

            db.Delete(c);
        }
Beispiel #5
0
        public static void Delete(int id, string cnString)
        {
            ProductDB db = new ProductDB(cnString);

            db.Delete(id);
        }
Beispiel #6
0
        /// <summary>
        /// Deletes the customer identified by the id.
        /// </summary>
        public static void Delete(int id)
        {
            ProductDB db = new ProductDB();

            db.Delete(id);
        }
Beispiel #7
0
        public static DataTable GetTable()
        {
            ProductDB db = new ProductDB();

            return(db.RetrieveTable());
        }
Beispiel #8
0
        // *** this is new
        public static DataTable GetTable(string cnString)
        {
            ProductDB db = new ProductDB(cnString);

            return(db.RetrieveTable());
        }
Beispiel #9
0
        public static void Delete(int id, string cnString)
        {
            CustomerDB db = new CustomerDB(cnString);

            db.Delete(id);
        }
Beispiel #10
0
        /// <summary>
        /// Deletes the customer identified by the id.
        /// </summary>
        public static void Delete(int id)
        {
            CustomerDB db = new CustomerDB();

            db.Delete(id);
        }
Beispiel #11
0
        public static DataTable GetTable()
        {
            CustomerDB db = new CustomerDB();

            return(db.RetrieveTable());
        }
Beispiel #12
0
        // *** this is new
        public static DataTable GetTable(string cnString)
        {
            CustomerDB db = new CustomerDB(cnString);

            return(db.RetrieveTable());
        }