示例#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
 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
 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);
             }
         }
     }
 }