private void mnuItemTimeAdd_Click(object sender, System.EventArgs e) { try{ InputModal im = new InputModal("", "Minutes", "Date", "User", "Comments"); ((TextBox)im.AnswerTable["User"]).Text = System.Threading.Thread.CurrentPrincipal.Identity.Name; if (im.ShowDialog(this) == DialogResult.OK){ _time = new Business.Time(); _time.Minutes = Int32.Parse(im.Answer("Minutes")); _time.Date = DateTime.Parse(im.Answer("Date").Trim()); _time.User = im.Answer("User"); _time.Text = im.Answer("Comments"); if (_eff !=null){ _eff.Times.Add(_time); _time.Effort = _eff; }else{ _roll.Times.Add(_time); _time.Rollout = _roll; } if (_time.IsValid){ _time.Update(); ListViewItem lvi = new ListViewItem(new string[]{_time.Minutes.ToString(), _time.Date.ToShortDateString(), _time.User, _time.Text}); lvi.Tag = _time; lv.Items.Add(lvi); }else{ MessageBox.Show(this, _time.BrokenRules.ToString(), "QED"); } } } catch(Exception ex){ MessageBox.Show(this, ex.Message, "QED"); } }
private bool GetBranch(ref string branch){ const string CVS_BRANCH = "Enter Branch"; InputModal im = new InputModal("Enter Branches for this roll", CVS_BRANCH); ((TextBox)im.AnswerTable[CVS_BRANCH]).Text = "HEAD"; if (im.ShowDialog(this) == DialogResult.OK){ branch = im.Answer(CVS_BRANCH); return (branch.Trim() != ""); } return false; }
private void mnuItemGenListBoxAdd_Click(object sender, System.EventArgs e) { InputModal im = new InputModal("", "Connection Name"); if (im.ShowDialog(this) == DialogResult.OK) { _conn = new Connection(); _conn.SystemName = im.Answer("Connection Name"); _conns.Add(_conn); this.lstConns.Items.Add(_conn); this.UpdateScreen(); this.lstConns.SelectedItem = _conn; } }
private void GetMaxMergeInfo(ref string server, ref string user, ref string passwd, ref string branch, ref string comment, ref bool cancel){ const string MAX_SERVER = "Max Server"; const string MAX_USER = "******"; const string MAX_PW = "Max Password"; const string CVS_BRANCH = "CVS Branch"; const string CVS_COMMENT = "CVS Comment"; InputModal im = new InputModal("Enter Merge Information", MAX_SERVER, MAX_USER, MAX_PW, CVS_BRANCH, CVS_COMMENT); ((TextBox)im.AnswerTable[MAX_PW]).PasswordChar = '*'; ((TextBox)im.AnswerTable[MAX_USER]).Text = ((BusinessIdentity)System.Threading.Thread.CurrentPrincipal.Identity).UserName; if (im.ShowDialog(this) == DialogResult.OK){ server = im.Answer(MAX_SERVER); user = im.Answer(MAX_USER); passwd = im.Answer(MAX_PW); branch = im.Answer(CVS_BRANCH); comment = im.Answer(CVS_COMMENT); cancel = false; }else{ cancel = true; } }
private void GetPPAndOSRollData(ref string PPBranch, ref string OSBranch, ref RollType rt, ref bool cancel){ const string PP_CVS_BRANCH = "PP CVS Branch"; const string OS_CVS_BRANCH = "OS CVS Branch"; const string ROLL_CODE_TO = "Roll code to:"; const string REMOTE_UAT_ROLL = "Remote UAT Site"; const string LOCAL_UAT_ROLL = "Local UAT Site"; string rollType = ""; rt = RollType.Local_UAT; // Compiler wants a default ComboBox cbo = new ComboBox(); cbo.Name = ROLL_CODE_TO; cbo.DropDownStyle = ComboBoxStyle.DropDownList; cbo.Items.Add(LOCAL_UAT_ROLL); cbo.Items.Add(REMOTE_UAT_ROLL); InputModal im = new InputModal("Enter Branches for this roll", PP_CVS_BRANCH, OS_CVS_BRANCH); im.AddToPanel(cbo); ((TextBox)im.AnswerTable[PP_CVS_BRANCH]).Text = "HEAD"; ((TextBox)im.AnswerTable[OS_CVS_BRANCH]).Text = "HEAD"; if (im.ShowDialog(this) == DialogResult.OK){ PPBranch = im.Answer(PP_CVS_BRANCH); OSBranch = im.Answer(OS_CVS_BRANCH); rollType = im.Answer(ROLL_CODE_TO); if (rollType == REMOTE_UAT_ROLL) rt = RollType.Remote_UAT; else if (rollType == LOCAL_UAT_ROLL) rt = RollType.Local_UAT; cancel = false; }else{ cancel = true; } }
private void mnuItemIBM_UAT_MAX_Click(object sender, System.EventArgs e) { try{ const string SERVER = "Server: "; const string BRANCH = "Branch: "; string server = ""; string branch = ""; InputModal im = new InputModal("Enter information for production roll", SERVER, BRANCH); if (im.ShowDialog(this) == DialogResult.OK){ server = im.Answer(SERVER); branch = im.Answer(BRANCH); IBM_MAX_Roller roller = new IBM_MAX_Roller(RollType.Prod, server, branch); this.SetupRoller(roller); roller.Roll(); } } catch(Exception ex){ MessageBox.Show(this, ex.Message, "QED"); } }
private void lvKVP_DoubleClick(object sender, System.EventArgs e) { const string KEY= "Enter Key"; const string VAL = "Enter Value"; Entry ent = (Entry)lvKVP.SelectedItems[0].Tag; InputModal im = new InputModal("Edit Entry", KEY, VAL); ((TextBox)im.AnswerTable[KEY]).Text = ent.Key; ((TextBox)im.AnswerTable[VAL]).Text = ent.Value; if (im.ShowDialog(this) == DialogResult.OK){ ent.Key = im.Answer(KEY); ent.Value = im.Answer(VAL); if (ent.IsValid){ ent.Update(); lvKVP.SelectedItems[0].SubItems[0].Text = ent.Key; lvKVP.SelectedItems[0].SubItems[1].Text = ent.Value; }else{ MessageBox.Show("Entry could not be saved because it was invalid:\r\n" + ent.BrokenRules); } } }
private void AddEntToKVP(){ const string KEY= "Enter Key"; const string VAL = "Enter Value"; bool beenHere = false; Entry ent = (Entry)tvwHier.SelectedNode.Tag; DialogResult res; InputModal im = new InputModal("", KEY, VAL); do { if (beenHere) { MessageBox.Show(this, "All fields required", "Error"); }else{ } res = im.ShowDialog(this); beenHere = true; } while (res == DialogResult.OK && (im.Answer(KEY) == "" || im.Answer(VAL) == "")); if (res == DialogResult.OK){ Entry newEnt = ent.Entries.Add(im.Answer(KEY), im.Answer(VAL)); if (newEnt.IsValid){ newEnt.Update(); this.AddEntToKVP(newEnt); }else{ MessageBox.Show("Entry can not be saved:\r\n" + newEnt.BrokenRules); } } }
private void mnuItemListHierRename_Click(object sender, System.EventArgs e) { const string ENTER_NEW_NAME = "Enter New Name"; InputModal im = new InputModal("", ENTER_NEW_NAME); Entry ent = (Entry)tvwHier.SelectedNode.Tag; ((TextBox)im.AnswerTable[ENTER_NEW_NAME]).Text = ent.Key; if (im.ShowDialog(this) == DialogResult.OK){ string newKey = im.Answer(ENTER_NEW_NAME); if (newKey != "") { ent.Key = newKey; if (ent.IsValid){ ent.Update(); tvwHier.SelectedNode.Text = newKey; }else{ MessageBox.Show(this, "New entry could not be added because is was invalid:\r\n" + ent.BrokenRules.ToString()); } } } }
private void mnuItemListHierCatAdd_Click(object sender, System.EventArgs e) { const string CATEGORY_NAME = "Enter Category Name"; TreeNode tn; Entry ent; string key; if (tvwHier.SelectedNode != null) { ent = (JCSLA.Entry)tvwHier.SelectedNode.Tag; InputModal im = new InputModal("", CATEGORY_NAME ); if (im.ShowDialog(this) == DialogResult.OK){ key = im.Answer(CATEGORY_NAME); if (key != ""){ Entry newEnt = ent.Entries.Add(key); if (newEnt.IsValid){ newEnt.Update(); tn = new TreeNode(newEnt.Key); tn.Tag = newEnt; tvwHier.SelectedNode.Nodes.Add(tn); }else{ MessageBox.Show(this, "New entry could not be added because is was invalid:\r\n" + newEnt.BrokenRules.ToString()); } } } }else { InputModal im = new InputModal("", CATEGORY_NAME); if (im.ShowDialog(this) == DialogResult.OK){ key = im.Answer(CATEGORY_NAME); if (key.Trim() != ""){ ent = _pubList.AddRoot(key); if (ent.IsValid){ ent.Update(); tn = new TreeNode(ent.Key); tn.Tag = ent; tvwHier.Nodes.Add(tn); }else{ MessageBox.Show(this, "Entry is invalid\r\n" + ent.BrokenRules); } } } } }