Ejemplo n.º 1
0
 public bool Contains(BusinessBase item)
 {
     return List.Contains(item);
 }
Ejemplo n.º 2
0
 public void Remove(BusinessBase child)
 {
     List.Remove(child);
 }
Ejemplo n.º 3
0
 public void Add(BusinessBase bb)
 {
     if (bb != null)
         this.Add(bb.BrokenRules);
 }
Ejemplo 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;
     }
 }
Ejemplo n.º 5
0
Archivo: Times.cs Proyecto: 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);
             }
         }
     }
 }
Ejemplo n.º 6
0
Archivo: UI.cs Proyecto: 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;
     }
 }
Ejemplo 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();
             }
         }
     }
 }
Ejemplo n.º 8
0
 public MySqlDBLayer(BusinessBase bb)
 {
     _bb = bb;
 }
Ejemplo 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);
             }
         }
     }
 }