public Message Add(Message obj) { obj.BusinessCollection = this; obj.Parent = this._parent; List.Add(obj); return obj; }
public bool Contains(Message obj) { foreach(Message child in List) { if (obj.Equals(child)){ return true; } } return false; }
public Messages(BusinessBase parent) { Message msg; int fkVal; string fk; _parent = parent; if (parent is Effort){ fk = "effId"; fkVal = parent.Id; }else{ fkVal = parent.Id; fk = "rollId"; } using(MySqlConnection conn = Connections.Inst.item("QED_DB").MySqlConnection){ using(MySqlDataReader dr = MySqlDBLayer.LoadWhereColumnIs(conn, _table, fk, fkVal)){ while(dr.Read()) { msg = new Message(dr); msg.BusinessCollection = this; List.Add(msg); } } } }