Exemplo n.º 1
0
    public static void IgnoreRequest(string id, string str1or0)
    {
        bool        ignore = str1or0 == "1";
        TestRequest tr     = new TestRequest(id)
        {
            USERID = CurrentContext.UserID.ToString(), IGNORE = ignore ? "true" : ""
        };

        tr.Store();

        if (!ignore)
        {
            return;
        }

        string emal = tr.PROGABB;
        string ttid = tr.TTID;
        string comm = tr.COMMENT;

        Version v    = new Version(tr.VERSIONID);
        string  vers = v.VERSION;

        //----update TestTrack DB
        string tasknumber = Regex.Match(ttid.ToUpper(), "TT[0-9]+").Value.Replace("TT", "");

        if (!String.IsNullOrEmpty(tasknumber))
        {
            DefectConnector.UpdateDefect(tasknumber, "", CurrentContext.User.PHONE);
        }
        //----update end

        string body = string.Format(@"
		Your request to test version ({0}) was processed by {1}<br>
		Your version: <a href='http://{2}/runs.aspx?R.RequestID={3}'>{0}</a> will be <b>IGNORED</b><br>
		{4}<br>
		{5}<br><br>
		Person responsible: <b>{1}</b><br><br>
		Best regards, {1}
		"        , vers, CurrentContext.UserName(), Settings.CurrentSettings.BSTADDRESS, id, ttid, comm);

        AddEmail(
            emal
            , string.Format("Your request to test version({0}) was processed by {1}", vers, CurrentContext.UserName())
            , body
            , IgnoreTT);
    }
Exemplo n.º 2
0
    protected void CommentButton_Click(object sender, EventArgs e)
    {
        if ((TestOK.Checked == false) && (TestFailed.Checked == false))
        {
            LabelError.Text = "<b> [Please choose result] </b>";
            return;
        }

        string strPutColor = GoodTT;
        string strText     = TestOK.Text;

        if (TestFailed.Checked)
        {
            strPutColor = BadTT; strText = TestFailed.Text;
        }

        LabelError.Text = "";

        String strCommentTest = CMT.Text;

        strCommentTest = strCommentTest.Replace("\r\n", "<br>");

        ArrayList list = GetCaseNameList();

        string[] arrfiles    = GetFilesList(RequestID);
        string   TestRunIDs  = string.Empty;
        string   TestsInMail = string.Empty;

        foreach (CheckBox cb in list)
        {
            if (!String.IsNullOrEmpty(cb.Attributes["TEST_RUN_ID"]))
            {
                if (TestRunIDs == string.Empty)
                {
                    TestRunIDs = cb.Attributes["TEST_RUN_ID"];
                }
                else
                {
                    TestRunIDs += "," + cb.Attributes["TEST_RUN_ID"];
                }

                TestsInMail += string.Format("<a href='http://{0}/", Settings.CurrentSettings.BSTADDRESS) + cb.Attributes["TEST_LINK"] + "'>" + cb.Attributes["CASE_NAME"] + "</a><br>";
            }
        }

        if (TestsInMail != string.Empty)
        {
            TestsInMail = "<br>Tests which were affected by your task:<br>" + TestsInMail + "<br>";
        }

        DB_PutDependentFilesFromTT(TestRunIDs, arrfiles);

        TestRequest tr = new TestRequest(RequestID)
        {
            USERID = CurrentContext.UserID.ToString(), TESTED = strPutColor == GoodTT ? "true" : "false"
        };

        tr.Store();

        //----update TestTrack DB
        string tasknumber = Regex.Match(strTTID.ToUpper(), "TT[0-9]+").Value.Replace("TT", "");

        if (!String.IsNullOrEmpty(tasknumber))
        {
            DefectConnector.UpdateDefect(tasknumber, TestFailed.Checked.ToString(), CurrentContext.User.PHONE);
        }
        //----update end

        string body = string.Format(@"
			Your version: ({0} <a href='http://{1}/runs.aspx?R.RequestID={2}'>{3}</a>)
			<br>{4}
			<br>{5}
			<br>
			<br><b>{6}</b>
			<br>
			<br>Result:
			<br><a href='http://{1}/CompareVersion.aspx?Version1={3}&Version2={7}'>Compare Version</a>
			<br>
			<br>{8}
			<br>{9}
			<br>
			<br>Best regards, <b>{10}</b>"
                                    , strDT, Settings.CurrentSettings.BSTADDRESS, RequestID, strFiPVersion, strTTID, strComment, strText, strFiPVersionBase, strCommentTest, TestsInMail, CurrentContext.UserName());

        /*AddEmail(
         *      strProgrammer
         *      , string.Format("Your request for version ({0}) was tested. Request info: ({1})", strFiPVersion, strTTID)
         *      , body
         *      , strPutColor);*/

        LabelError.Visible = false;
        if (getBackUrl != null)
        {
            Response.Redirect(getBackUrl);
        }
    }