private void tb_CaseNO_Leave(object sender, EventArgs e) { if (this.tb_CaseNO.Text != "") { if (myManageDB.checkItem("ceCaseName", "CaseManager", this.tb_CaseNO.Text)) { MessageBox.Show("测试用例编号:" + this.tb_CaseNO.Text + "已存在,请尝试设置其他编号!", "消息提示:", MessageBoxButtons.OK, MessageBoxIcon.Information); this.tb_CaseNO.Text = ""; } } }
private void tsbSave_Click(object sender, EventArgs e) { if (this.tb_ProjectNO.Text != null && this.tb_ProjectNO.Text != "") { if (myManageDB.checkItem("proNO", "ProjectManager", this.tb_ProjectNO.Text)) { MessageBox.Show("项目编号重复,请重新填写!", "消息提示:", MessageBoxButtons.OK, MessageBoxIcon.Information); this.tb_ProjectNO.Text = ""; } else { myManageDB.InsertInto("insert into ProjectManager(proName,proShortName,proNO,proType,proPriority,proDepartment,proManager,proAssistant,proSetUpTime,proClosedTime,proCustomer,proDevelopmentSite,proAuthor,proBuildTime,proDescribe) values('" + this.tb_ProjectName.Text + "','" + this.tb_ShortName.Text + "','" + this.tb_ProjectNO.Text + "','" + this.cb_Type.Text + "','" + this.cb_Priority.Text + "','" + this.tb_Department.Text + "','" + this.tb_Manager.Text + "','" + this.tb_Assistant.Text + "','" + this.dtp_SetUpTime.Text + "','" + this.dtp_ClosedTime.Text + "','" + this.tb_Customer.Text + "','" + this.tb_DevelopmentSite.Text + "','" + this.tb_Author.Text + "','" + this.dtp_BuildTime.Text + "','" + this.rtb_Describe.Text + "')"); this.Visible = false; this.Close(); } } else { MessageBox.Show("请将必填项填写完整!", "消息提示:", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void tsbSave_Click(object sender, EventArgs e) { if (tb_CaseNO.Text != null && tb_CaseNO.Text != "") { if (myManageDB.checkItem("ceCaseNO", "CaseManager", this.tb_CaseNO.Text)) { MessageBox.Show("测试用例编号:" + this.tb_CaseNO.Text + "已存在,请重新填写!", "消息提示:", MessageBoxButtons.OK, MessageBoxIcon.Information); this.tb_CaseNO.Text = ""; } else { myManageDB.InsertInto("insert into CaseManager(ceProject,ceStruct,ceSuiteNO,ceSuiteName,ceCaseNO,ceCaseName,ceReqNO,ceCaseLevel,ceFatherModule,ceSubModule,ceAuthor,ceEditDate,ceIfAuto,cePrecondition,ceSteps,ceSamples,ceExcept,ceActually) values('" + this.tb_Project.Text + "','" + this.cb_Struct.Text + "','" + this.tb_SuiteNO.Text + "','" + this.tb_SuiteName.Text + "','" + this.tb_CaseNO.Text + "','" + this.tb_CaseName.Text + "','" + this.tb_ReqNO.Text + "','" + this.cb_CaseLevel.Text + "','" + this.tb_ParentModule.Text + "','" + this.tb_SubModule.Text + "','" + this.tb_Author.Text + "','" + this.dtpEditDate.Text + "','" + this.cb_IfAuto.Text + "','" + this.rtb_Precondition.Text + "','" + this.rtb_Steps.Text + "','" + this.rtb_Samples.Text + "','" + this.rtb_Except.Text + "','" + this.cb_Actually.Text + "')"); this.Visible = false; this.Close(); } } else { MessageBox.Show("请将必填项填写完整!", "消息提示:", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void searchQueryItems() { if (myManageDB.checkItem("ceCaseNO", "CaseManager", this.tb_QueryItems.Text)) { this.txtStatus.ForeColor = Color.Green; this.txtStatus.Text = "查询结果:查询成功!"; mySelectedItem = this.tb_QueryItems.Text; this.Visible = false; this.Close(); this.UpdateAfterQuery(); this.DataGridViewSeletedItem(); } else { this.txtStatus.ForeColor = Color.Red; this.txtStatus.Text = "查询结果:未能查询到此用例!"; } }
private void btnLaunch_Click(object sender, EventArgs e) { if (myManageDB.checkItem("revFullName", "用例评审", ManageDB.userFullName, "revEmail", ManageDB.userEmailAddress)) { MessageBox.Show("您已经发起了评审流程!", "消息提示:", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { myManageDB.InsertInto("insert into 用例评审(revFullName,revEmail) values('" + ManageDB.userFullName + "'," + "'" + ManageDB.userEmailAddress + "')"); string FilesPath = this.tbFilePath.Text; string[] excelFilesPath = FilesPath.Split(';'); foreach (string str in excelFilesPath) { if (str != "") { try { if (!Directory.Exists(testCasesPool())) { Directory.CreateDirectory(testCasesPool()); } File.Copy(str, testCasesPool() + Path.GetFileName(str), true); caseNameToReviewList.Add(Path.GetFileName(str) + "\r\n"); caseNameToReview = caseNameToReviewList.ToArray(); mailBody = Path.GetFileName(str) + "\r\n" + mailBody; } catch (Exception exception) { MessageBox.Show(exception.Message, "异常消息提示:", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } if ((cbIfAuto.Text != null) || (cbIfAuto.Text != "")) { this.cbIfCover.Enabled = true; string mailAddressStr = null; try { mailAddressStr = Regex.Match(cbIfAuto.Text.ToString(), @"(?<=\()[\s\S]*@sit.com.cn(?=\))").Value; } catch (ArgumentException exception) { MessageBox.Show(exception.Message, "异常消息提示:", MessageBoxButtons.OK, MessageBoxIcon.Error); } autoReviewerList.Add(mailAddressStr); autoReviewer = autoReviewerList.ToArray(); } if (autoReviewer != null) { sendMail("测试用例自动化评审流程", autoReviewer); } if (ifCoverReviewer != null) { sendMail("测试用例测试点覆盖评审流程", ifCoverReviewer); } foreach (string autoReviewTo in autoReviewer) { myManageDB.UpdateDB("用户管理", "autoReviewTo", "True", "email", autoReviewTo); } foreach (string coverReviewTo in ifCoverReviewer) { myManageDB.UpdateDB("用户管理", "coverReviewTo", "True", "email", coverReviewTo); } myManageDB.UpdateDB("用户管理", "reviewFrom", "True", "email", ManageDB.userEmailAddress); } }