Exemplo n.º 1
0
Arquivo: Times.cs Projeto: jhogan/qed
 public bool Contains(Time obj)
 {
     foreach(Time child in List) {
         if (obj.Equals(child)){
             return true;
         }
     }
     return false;
 }
Exemplo n.º 2
0
Arquivo: Times.cs Projeto: jhogan/qed
 public Time Add(Time obj)
 {
     obj.BusinessCollection = this;
     List.Add(obj); return obj;
 }
Exemplo n.º 3
0
Arquivo: Main.cs Projeto: jhogan/qed
		private void btnFindRollByScheduledRollDate_Click(object sender, System.EventArgs e) {
			try{
				bool cancel = false;
				Business.Time time = _times.item(_rollout);
				if (time != null){
					PromptTimerStop(time, ref cancel);
				}
				if (!cancel){
					Client client = (Client)this.cboClients.SelectedItem;
					Rollouts rolls = new Rollouts(client, this.dtpRoll.Value, SearchBy.ScheduledDate);
					Rollout roll = rolls[0];
					if (roll.IsNew) {
						if (MessageBox.Show(this, 
							"Rollout for " +  client.Name + " on " + dtpRoll.Value.ToLongDateString() + " doesn't exist. Create?", "Create", MessageBoxButtons.YesNo) == DialogResult.Yes){
							roll.Update();
							_rollout = roll;
							UpdateRolloutTab();
						}
					}else{
						_rollout = roll;
						UpdateRolloutTab();
					}
					if (_rollout != null){
						time = _times.item(_rollout);
						if (time == null){
							time = new QED.Business.Time(_rollout);
							PromptTimerStart(time);
						}else{
							HookUpTimer(time);
						}
					}
				}
			}
			catch(Exception ex) {
				MessageBox.Show(this, ex.Message, "Exception");
			}
		}
Exemplo n.º 4
0
Arquivo: Times.cs Projeto: 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);
             }
         }
     }
 }
Exemplo n.º 5
0
Arquivo: Main.cs Projeto: jhogan/qed
		private void btnSearchTestingEffort_Click(object sender, System.EventArgs e) {
			try{
				bool cancel = false;
				Business.Time time;
				if (_testingEff != null){
					time = _times.item(_testingEff);
					if (time != null){
						PromptTimerStop(time, ref cancel);
					}
				}
				if (!cancel){
					_testingEff = new Effort(this.txtEffortId.Text, true);
					if (_testingEff.IsNew){
						if (_testingEff.IsValid){
							_testingEff.Update();
						}else{
							MessageBox.Show(this, "Can't create local record for effort:\r\n" + _testingEff.BrokenRules);
						}
					}
					UpdateTestingTab();
					time = _times.item(_testingEff);
					if (time == null){
						time = new QED.Business.Time(_testingEff);
						PromptTimerStart(time);
					}else{
						HookUpTimer(time);
					}

				}
			}
			catch(Exception ex) {
				this.chkApproved.Enabled = false;
				txtTestROEffort.Text = "";
				this.lvTestNotes.Items.Clear();
				this.lvTestDefectNotes.Items.Clear();
				this.txtEffDesc.Text = "";
				MessageBox.Show(this, "There was a problem loading effort:\r\n" + ex.Message, "QED");
			}
		}