Ejemplo n.º 1
0
 public Message Add(Message obj)
 {
     obj.BusinessCollection = this;
     obj.Parent = this._parent;
     List.Add(obj); return obj;
 }
Ejemplo n.º 2
0
 public bool Contains(Message obj)
 {
     foreach(Message child in List) {
         if (obj.Equals(child)){
             return true;
         }
     }
     return false;
 }
Ejemplo n.º 3
0
 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);
             }
         }
     }
 }