public bool Contains(BusinessBase item) { return List.Contains(item); }
public void Remove(BusinessBase child) { List.Remove(child); }
public void Add(BusinessBase bb) { if (bb != null) this.Add(bb.BrokenRules); }
protected void SetValue(ref BusinessBase bb, BusinessBase value, ref int id) { if (value == null || bb == null || value.Id != bb.Id){ MarkDirty(); bb = value; if (value != null) id = value.Id; else id = -1; } }
public Times(Rollout parent) { Time obj; _parent = parent; using(MySqlConnection conn = Connections.Inst.item("QED_DB").MySqlConnection){ using(MySqlDataReader dr = MySqlDBLayer.LoadWhereColumnIs(conn, _table, "rollId", parent.Id)){ while(dr.Read()) { obj = new Time(dr); obj.BusinessCollection = this; List.Add(obj); } } } }
public static bool UpdateIfValid(IWin32Window owner, BusinessBase bb) { if (bb.IsValid){ bb.Update(); return true; }else{ MessageBox.Show(owner, "Could not save " + bb.GetType().Name + " because it was invalid. Reason:\r\n" + bb.BrokenRules.ToString(), "Error Saving", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); return false; } }
public Defects(BusinessBase parent) { Defect def; string SQL; _parent = parent; using(MySqlConnection conn = Connections.Inst.item("QED_DB").MySqlConnection){ conn.Open(); using(MySqlCommand cmd = conn.CreateCommand()){ if (parent is Effort){ SQL = "SELECT * FROM " + _table + " WHERE effId = @effId and forRoll = 0"; cmd.Parameters.Add("@effId", parent.Id); }else{ SQL = "SELECT * FROM " + _table + " WHERE rollId = @rollId and forRoll = 1"; cmd.Parameters.Add("@rollId", parent.Id); } cmd.CommandText = SQL; using(MySqlDataReader dr = cmd.ExecuteReader()){ while(dr.Read()) { def = new Defect(dr); def.BusinessCollection = this; List.Add(def); } conn.Close(); } } } }
public MySqlDBLayer(BusinessBase bb) { _bb = bb; }
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); } } } }