/// <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); } }
/// <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); }
public static void Delete(int id, string cnString) { EventDB db = new EventDB(cnString); db.Delete(id); }
/// <summary> /// Deletes the customer identified by the id. /// </summary> public static void Delete(int id) { EventDB db = new EventDB(); db.Delete(id); }
public static DataTable GetTable() { EventDB db = new EventDB(); return(db.RetrieveTable()); }
// *** this is new public static DataTable GetTable(string cnString) { EventDB db = new EventDB(cnString); return(db.RetrieveTable()); }