Exemplo n.º 1
0
    /// <summary>
    /// 实时更新试验进度
    /// </summary>
    public void UpdateState()
    {
        ThermalTestReport report = new ThermalTestReport();
        report.TestBegin = Convert.ToDateTime(this.calSYStartTime.Text);
        int curReportId = report.GetMaxReportId();
        string state = report.GetTest(curReportId).Rows[0]["TESTSTATE"].ToString();
        double roral = report.GetDiffTime(curReportId) / Convert.ToInt32(this.txtSYTime.Value) * 100;
        if (state != "4" && state != "8" && state != "9" && state != "10" && state != "11")
        {
            this.Label1.Text = this.txtReportName.Value + "试验正在进行已完成" + roral.ToString("0") + "%";
        }
        else if (state == "8")
        {
            this.Timer1.Enabled = false;
            //JScript.Alert("不明泄漏率计算失败,试验终止!");
            ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "updateScript", "alert('不明泄漏率计算失败,试验终止!');", true);
            report.BDEndTest(curReportId,5);
            this.Timer1.Enabled = false;
            //this.btnView.Enabled = true;
            //this.hddMaxReportID.Value = curReportId.ToString();
        }
        else if (state == "10")
        {
            string x = report.GetX(curReportId);
            string y = report.GetY(ddlUnit.SelectedValue.Trim(), ddlSYName.SelectedValue.Trim(),ddlSYGK.SelectedItem.Text.Trim());
            ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "updateScript", "confir('"+x+"','"+y+"')", true);
            //this.ClientScript.RegisterStartupScript(this.GetType(), "msgbox", "return confirm('" + x + "?');", true);
            //return confirm('不明泄漏率为x,超出限值y,是否继续试验?')
            if (hidvalue.Value == "1")
            {
                report.BDEndTest(curReportId, 12);
                this.Timer1.Enabled = false;
            }
            else
            {
                report.BDEndTest(curReportId, 5);
            }
        }
        else if (state == "11")
        {
            ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "updateScript", "alert('数据处理失败,试验终止!');", true);
            report.BDEndTest(curReportId, 5);
            this.Timer1.Enabled = false;
        }
        else if (state == "9")
        {
            string x = report.GetX(curReportId);
            string y = report.GetY(ddlUnit.SelectedValue.Trim(), ddlSYName.SelectedValue.Trim(), ddlSYGK.SelectedItem.Text.Trim());
            ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "updateScript", "alert('不明泄漏率'" + x + "'在限值'" + y + "'范围内,试验继续!');", true);
            report.BDEndTest(curReportId, 12);
        }
        else
        {
            this.Label1.Text = this.txtReportName.Value + "试验已完成100%";
            btnStartEnd.Text = "开始试验";
            this.btnView.Enabled = true;
            this.hddMaxReportID.Value = curReportId.ToString();
            this.Timer1.Enabled = false;

        }
    }
Exemplo n.º 2
0
    /// <summary>
    /// 改变试验状态(点击确认后)
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnHelp_Click(object sender, EventArgs e)
    {
        ThermalTestReport report = new ThermalTestReport();
        int curReportId = report.GetMaxReportId();
        if (hidvalue.Value == "0")
        {
            report.BDEndTest(curReportId, 12);
            //this.Timer1.Enabled = false;
        }
        else if (hidvalue.Value == "1")
        {
            report.BDEndTest(curReportId, 5);
            this.Timer1.Enabled = false;

            btnStartEnd.Text = "开始试验";
            btnStartEnd.Enabled = true;
            this.Label1.Text = "试验已中止";
        }
    }