Esempio n. 1
0
 public bool Contains(BusinessBase item)
 {
     return List.Contains(item);
 }
Esempio n. 2
0
 public void Remove(BusinessBase child)
 {
     List.Remove(child);
 }
Esempio n. 3
0
 public void Add(BusinessBase bb)
 {
     if (bb != null)
         this.Add(bb.BrokenRules);
 }
Esempio n. 4
0
 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;
     }
 }
Esempio n. 5
0
File: Times.cs Progetto: jhogan/qed
 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);
             }
         }
     }
 }
Esempio n. 6
0
File: UI.cs Progetto: jhogan/qed
 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;
     }
 }
Esempio n. 7
0
 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();
             }
         }
     }
 }
Esempio n. 8
0
 public MySqlDBLayer(BusinessBase bb)
 {
     _bb = bb;
 }
Esempio n. 9
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);
             }
         }
     }
 }