Esempio n. 1
0
        /// <summary>
        /// Instantiates mProps and mOldProps as new Props objects.
        /// Instantiates mbdReadable and mdbWriteable as new DB objects.
        /// </summary>
        protected override void SetUp()
        {
            mProps    = new EventProps();
            mOldProps = new EventProps();

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

            else
            {
                mdbReadable  = new EventDB(this.mConnectionString);
                mdbWriteable = new EventDB(this.mConnectionString);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Retrieves a list of Events.
        /// </summary>
        ///
        // *** I had to change this
        public static List <Customer> GetList(string cnString)
        {
            EventDB           db     = new EventDB(cnString);
            List <Customer>   events = new List <Customer>();
            List <EventProps> props  = new List <EventProps>();

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

            return(events);
        }
Esempio n. 3
0
        public static void Delete(int id, string cnString)
        {
            EventDB db = new EventDB(cnString);

            db.Delete(id);
        }
Esempio n. 4
0
        /// <summary>
        /// Deletes the customer identified by the id.
        /// </summary>
        public static void Delete(int id)
        {
            EventDB db = new EventDB();

            db.Delete(id);
        }
Esempio n. 5
0
        public static DataTable GetTable()
        {
            EventDB db = new EventDB();

            return(db.RetrieveTable());
        }
Esempio n. 6
0
        // *** this is new
        public static DataTable GetTable(string cnString)
        {
            EventDB db = new EventDB(cnString);

            return(db.RetrieveTable());
        }