public Time(Effort eff) { InitializeComponent(); _eff = eff; this.lblTimeFor.Text = "Time data for effort: " + _eff.ConventionalId; _times = _eff.Times; this.UpdateLv(); }
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; }
public void ToggleRolledState(Effort eff) { EffortRollout effRoll =_effortRollouts.item(eff); effRoll.Rolled = !effRoll.Rolled; }
public void Roll(Effort eff) { _effortRollouts.item(eff).Rolled = true; }
public EffortRollout GetEffortRollout(Effort eff) { foreach (EffortRollout er in this.EffortRollouts){ if (er.Effort.Id == eff.Id){ return er; } } return null; }
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; }
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); } }
public bool Contains(Effort obj) { foreach(Effort child in List) { if (obj.Equals(child)){ return true; } } return false; }
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; }
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); } } } }
public Time(Effort eff) { this.Effort = eff; Setup(); base.MarkNew(); }
public Time item(Effort eff) { foreach(Time obj in List) { if (obj.ForEffort){ if (eff.Id == obj.Effort.Id){ return obj; } } } return null; }
private void ShowTestingTab(Effort eff) { this._testingEff = eff; UpdateTestingTab(); this.tabMain.SelectedTab = this.tabTesting; }
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"); } }
public void Unroll(Effort eff) { _effortRollouts.item(eff).Rolled = false; }
public EffortRollout item(Effort eff) { foreach(EffortRollout obj in List) { if (obj.Effort.Id == eff.Id) return obj; } return null; }
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; }
public void AddUnrolled(Effort eff) { EffortRollout effRoll = new EffortRollout(); effRoll.Effort = eff; _effortRollouts.Add(effRoll); }
public Effort Add(Effort obj) { obj.BusinessCollection = this; List.Add(obj); return obj; }
public void Delete(Effort eff) { EffortRollout effRoll = _effortRollouts.item(eff); effRoll.Delete(); }
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); } } } }
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"); } }