Esempio n. 1
0
File: Time.cs Progetto: jhogan/qed
 public Time(Effort eff)
 {
     InitializeComponent();
     _eff = eff;
     this.lblTimeFor.Text = "Time data for effort: " + _eff.ConventionalId;
     _times = _eff.Times;
     this.UpdateLv();
 }
Esempio n. 2
0
 public EffortData(Effort eff)
 {
     InitializeComponent();
     CatLists cls = new CatLists(Connections.Inst.item("QED_DB").MySqlConnection);
     CatList system = cls.item("System");
      _defaultUserDomain = system.Entry("/Defaults/UserDomain").Value;
     _eff = eff; this.Text = eff.ConventionalId;
     this.txtDBResx.Text = eff.DBResource;
     this.txtPM.Text = (eff.PMResource == "") ? _defaultUserDomain : eff.PMResource;
     this.txtTestedBy.Text = (eff.TestedBy == "") ? _defaultUserDomain : eff.TestedBy;
     this.txtWebResx.Text = (eff.WebResource == "") ? _defaultUserDomain : eff.WebResource;
     this.txtDBResx.Text = (eff.DBResource == "") ? _defaultUserDomain : eff.DBResource;
     this.txtMaxResx.Text = (eff.MaxResource == "") ? _defaultUserDomain : eff.MaxResource;
     this.txtUATApprovedBy.Text = (eff.UATApprovedBy == "") ? _defaultUserDomain : _eff.UATApprovedBy;
     // if (eff.IsTicket) this.txtRequester.Enabled = false;
     this.txtRequester.Text = (eff.Requester == "") ? _defaultUserDomain : _eff.Requester;
     this.chkUATApproved.Checked = eff.UATApproved;
     this.txtEnv.Text = eff.Environment;
     this.txtBranchFileHierarchy.Text = eff.BranchFileHierarchy;
 }
Esempio n. 3
0
 public void ToggleRolledState(Effort eff)
 {
     EffortRollout effRoll =_effortRollouts.item(eff);
     effRoll.Rolled = !effRoll.Rolled;
 }
Esempio n. 4
0
 public void Roll(Effort eff)
 {
     _effortRollouts.item(eff).Rolled = true;
 }
Esempio n. 5
0
 public EffortRollout GetEffortRollout(Effort eff)
 {
     foreach (EffortRollout er in this.EffortRollouts){
         if (er.Effort.Id == eff.Id){
             return er;
         }
     }
     return null;
 }
Esempio n. 6
0
 public Defects GetDefects(Effort eff)
 {
     Defects ret = new Defects();
     ret.Parent = this;
     foreach(Defect def in this.Defects){
         if (def.Effort.Id == eff.Id){
             ret.Add(def);
         }
     }
     return ret;
 }
Esempio n. 7
0
File: Main.cs Progetto: jhogan/qed
		private void mnuItemGenListBoxAdd_Click(object sender, System.EventArgs e) {
			try{
				ComboBox cb = new ComboBox();
				cb.Name = "Select Effort";
				cb.DisplayMember = "ExternalId_Desc";
				cb.DropDownStyle = ComboBoxStyle.DropDown;
				Efforts rolloutEfforts = _rollout.Efforts;
				foreach (Effort eff in Efforts.Unrolled()){
					if ( !rolloutEfforts.Contains(eff.Id) &&  eff.Approved && (eff.EffortType == EffortType.Project || (eff.Client.Id == _rollout.Client.Id)))
						cb.Items.Add(eff);
				}
				InputModal im = new InputModal("", cb);
				if (im.ShowDialog(this) == DialogResult.OK) {
					if (cb.Text.Trim() != ""){
						Effort eff = (Effort)cb.SelectedItem;
						if (eff == null) {
							eff = new Effort(cb.Text, true);
							if (rolloutEfforts.Contains(eff.Id)){
								MessageBox.Show(this, "This effort has already been assigned. Can't re-assign", "QED");
								return;
							}
							if (!eff.Approved){
								MessageBox.Show(this, "This effort has not been marked approved yet.", "QED");
								return;
							}
							if (eff.Rolled){
								MessageBox.Show(this, "This effort has been rolled. Can't add.", "QED");
								return;
							}
						}
						_rollout.AddUnrolled(eff);
						if (_rollout.IsValid) {
							_rollout.Update();
							lstUnrolled.Items.Add(eff);
						}else{
							MessageBox.Show(this, _rollout.BrokenRules.ToString(), "Error");
						}
					}
				}
				UpdateRolloutTab();
			}
			catch(Exception ex){
				UI.ShowException(this, ex);
			}
		}
Esempio n. 8
0
 public bool Contains(Effort obj)
 {
     foreach(Effort child in List) {
         if (obj.Equals(child)){
             return true;
         }
     }
     return false;
 }
Esempio n. 9
0
        public static Efforts Unrolled()
        {
            Efforts effs = new Efforts();
            Effort eff;
            bool beenHere = false;
            System.Text.StringBuilder inList = new System.Text.StringBuilder();
            using(MySqlConnection conn = Connections.Inst.item("QED_DB").MySqlConnection){
                conn.Open();
                MySqlCommand cmd = conn.CreateCommand();
                cmd.CommandText =	 "SELECT effId FROM effortRollouts WHERE rolled = 1";
                using(MySqlDataReader dr = cmd.ExecuteReader()){
                    while(dr.Read()){
                        if (beenHere) inList.Append(","); else beenHere = true;
                        inList.Append(Convert.ToString(dr[0]));
                    }
                }
                if (inList.Length > 0){
                    cmd.CommandText =	 "SELECT * FROM efforts WHERE id not in (" + inList.ToString() + ")";
                }else{
                    cmd.CommandText =	 "SELECT * FROM efforts";
                }
                using(MySqlDataReader dr = cmd.ExecuteReader()){
                    while(dr.Read()) {
                        eff = new Effort(dr, true);
                        eff.BusinessCollection = effs;
                        effs.Add(eff);
                    }
                }

            }
            return effs;
        }
Esempio n. 10
0
 public EffortRollouts(Effort parent)
 {
     EffortRollout obj;
     this.Parent = parent;
     using(MySqlConnection conn = Connections.Inst.item("QED_DB").MySqlConnection){
         using(MySqlDataReader dr = MySqlDBLayer.LoadWhereColumnIs(conn, _table, "effId", parent.Id)){
             while(dr.Read()) {
                 obj = new EffortRollout(dr);
                 obj.BusinessCollection = this;
                 List.Add(obj);
             }
         }
     }
 }
Esempio n. 11
0
File: Times.cs Progetto: jhogan/qed
 public Time(Effort eff)
 {
     this.Effort = eff;
     Setup();
     base.MarkNew();
 }
Esempio n. 12
0
File: Times.cs Progetto: jhogan/qed
 public Time item(Effort eff)
 {
     foreach(Time obj in List) {
         if (obj.ForEffort){
             if (eff.Id == obj.Effort.Id){
                 return obj;
             }
         }
     }
     return null;
 }
Esempio n. 13
0
File: Main.cs Progetto: jhogan/qed
		private void ShowTestingTab(Effort eff) {
			this._testingEff = eff;
			UpdateTestingTab();
			this.tabMain.SelectedTab = this.tabTesting;
		}
Esempio n. 14
0
File: Main.cs Progetto: jhogan/qed
		private void MoveEff(Effort eff, ListBox lstFrom, ListBox lstTo) {								   
			if (UI.UpdateIfValid(this, _rollout)){
				lstFrom.Items.Remove(eff);
				lstTo.Items.Add(eff);
			}else{
				_rollout.ToggleRolledState(eff);
				throw new Exception("Aborted move");
			}
		}
Esempio n. 15
0
 public void Unroll(Effort eff)
 {
     _effortRollouts.item(eff).Rolled = false;
 }
Esempio n. 16
0
 public EffortRollout item(Effort eff)
 {
     foreach(EffortRollout obj in List) {
         if (obj.Effort.Id == eff.Id)
             return obj;
     }
     return null;
 }
Esempio n. 17
0
 public static Efforts AllEfforts()
 {
     Efforts effs = new Efforts();
     Effort eff;
     using(MySqlConnection conn = Connections.Inst.item("QED_DB").MySqlConnection){
         conn.Open();
         MySqlCommand cmd = conn.CreateCommand();
         cmd.CommandText =	 "SELECT * FROM efforts";
         using(MySqlDataReader dr = cmd.ExecuteReader()){
             while(dr.Read()) {
                 eff = new Effort(dr, true);
                 eff.BusinessCollection = effs;
                 effs.Add(eff);
             }
         }
     }
     return effs;
 }
Esempio n. 18
0
 public void AddUnrolled(Effort eff)
 {
     EffortRollout effRoll = new EffortRollout();
     effRoll.Effort = eff;
     _effortRollouts.Add(effRoll);
 }
Esempio n. 19
0
 public Effort Add(Effort obj)
 {
     obj.BusinessCollection = this;
     List.Add(obj); return obj;
 }
Esempio n. 20
0
 public void Delete(Effort eff)
 {
     EffortRollout effRoll = _effortRollouts.item(eff);
     effRoll.Delete();
 }
Esempio n. 21
0
 public Efforts(Rollout rollout)
 {
     Effort obj;
     _rollout= rollout;
     using(MySqlConnection conn = Connections.Inst.item("QED_DB").MySqlConnection){
         conn.Open();
         using(MySqlDataReader dr = MySqlDBLayer.LoadWhereColumnIs(conn, _table, "rolloutId", rollout.Id)){
             while(dr.Read()) {
                 obj = new Effort(dr, true);
                 obj.BusinessCollection = this;
                 List.Add(obj);
             }
         }
     }
 }
Esempio n. 22
0
File: Main.cs Progetto: 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");
			}
		}