예제 #1
0
 public bool Contains(BusinessBase item)
 {
     return List.Contains(item);
 }
예제 #2
0
 public void Remove(BusinessBase child)
 {
     List.Remove(child);
 }
예제 #3
0
파일: BrokenRules.cs 프로젝트: jhogan/qed
 public void Add(BusinessBase bb)
 {
     if (bb != null)
         this.Add(bb.BrokenRules);
 }
예제 #4
0
파일: BusinessBase.cs 프로젝트: jhogan/qed
 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;
     }
 }
예제 #5
0
파일: Times.cs 프로젝트: 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);
             }
         }
     }
 }
예제 #6
0
파일: UI.cs 프로젝트: 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;
     }
 }
예제 #7
0
파일: Defects.cs 프로젝트: jhogan/qed
 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();
             }
         }
     }
 }
예제 #8
0
파일: MySqlDBLayer.cs 프로젝트: jhogan/qed
 public MySqlDBLayer(BusinessBase bb)
 {
     _bb = bb;
 }
예제 #9
0
파일: Messages.cs 프로젝트: jhogan/qed
 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);
             }
         }
     }
 }