private void btnExport_Click(object sender, EventArgs e) { if (this.dataGridView.Rows.Count > 0) { this.btnExport.Enabled = false; this.progressBar.Visible = true; if (trf == null) { //业务开始 trf = new UIReFresher { UIRefresh = UIRefresh } } ; Task start = new Task(ExportResult); start.Start(); } else { MessageBox.Show("没有可以导出的数据!", "提示"); } }
/// <summary> /// 第一步计算分组 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnGroup_Click(object sender, EventArgs e) { try { if (step1 == null) { step1 = CalculateTool.Step1.CrtStep1(); } string strErrmsg = Check(); if (string.IsNullOrEmpty(strErrmsg)) { this.btnGroup.Enabled = false; //第三步取值范围 nrange1_up = Convert.ToInt32(numRange1_up.Text); nrange2_up = Convert.ToInt32(numRange2_up.Text); nrange3_up = Convert.ToInt32(numRange3_up.Text); nrange1_low = Convert.ToInt32(numRange1_low.Text); nrange2_low = Convert.ToInt32(numRange2_low.Text); nrange3_low = Convert.ToInt32(numRange3_low.Text); //第四步平均下限 nlowlimit = (int)Convert.ToDouble(cmbLowLimit.Text) * 2; nuplimit = (int)Convert.ToDouble(cmbUpLimit.Text) * 2; //第五步 //第六步 nsubup1 = Convert.ToInt32(numSubUp1.Text); nsubup2 = Convert.ToInt32(numSubUp2.Text); nsublow1 = Convert.ToInt32(numSubLow1.Text); nsublow2 = Convert.ToInt32(numSubLow2.Text); AutoSelStore(); if (trf == null) { //业务开始 trf = new UIReFresher { UIRefresh = UIRefresh } } ; if (this.rad3_0.Checked) { Task start = new Task(Start3_0); start.Start(); } if (this.rad3_1.Checked) { Task start = new Task(Start3_1); start.Start(); } if (this.rad2_2.Checked) { Task start = new Task(Start2_2); start.Start(); } } else { MessageBox.Show(strErrmsg, "提示"); } } catch (Exception exception) { MessageBox.Show("程序出现错误:" + exception, "提示"); } }