Beispiel #1
0
        private void dtGridView_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 11 && e.RowIndex >= 0)
            {
                if (iCurTaskStep == 0)
                {
                    frm_Info_02 frm = new frm_Info_02("删除记录", "确定要删除选中记录吗?");
                    frm.ShowDialog();
                    if (frm.sChageMark == "1")
                    {
                        int i = DbHelper.ExecuteNonQuery("DELETE D_TestInfo WHERE ID = '" + this.dtGridView["id", e.RowIndex].Value.ToString() + "'");



                        frmLogic.TaskSet.TubeNum[int.Parse(this.cmb_TubeNum.Text) - 1] = 0;

                        frmLogic.TaskSet.ExperimentNum[int.Parse(this.cmb_TubeNum.Text) - 1] = 0;

                        frmLogic.TaskSet.ConcentrationEstimate[int.Parse(this.cmb_TubeNum.Text) - 1] = 0;

                        this.CreateComboBox(cmb_TubeNum, 32);
                        this.CreateGridView();
                    }
                }
                else
                {
                    frm_Info frm = new frm_Info("任务已启动,不能做删除操作了!");
                    frm.ShowDialog();
                }
            }
        }
Beispiel #2
0
        private void picAdd_Click(object sender, EventArgs e)
        {
            if (this.txt_Man.Text == "")
            {
                frm_Info frm = new frm_Info("实验员不能为空");
                frm.ShowDialog();
                this.txt_Man.Focus();
            }
            else if (this.txt_WaterAddress.Text == "")
            {
                frm_Info frm = new frm_Info("水源信息不能为空");
                frm.ShowDialog();
                this.txt_WaterAddress.Focus();
            }
            else
            {
                int i = DbHelper.ExecuteNonQuery("INSERT INTO  D_TestInfo(TubeNum,ExperimentNum,ConcentrationEstimate,TestMan,Mark,WaterAddress) VALUES('" + this.cmb_TubeNum.Text + "','" + this.txt_ExperimentNum.Text + "','" + this.cmb_MD.SelectedValue.ToString() + "','" + this.txt_Man.Text + "','0','" + this.txt_WaterAddress.Text + "')");



                frmLogic.TaskSet.TubeNum[int.Parse(this.cmb_TubeNum.Text) - 1] = int.Parse(this.cmb_TubeNum.Text);

                frmLogic.TaskSet.ExperimentNum[int.Parse(this.cmb_TubeNum.Text) - 1] = int.Parse(this.txt_ExperimentNum.Text);

                frmLogic.TaskSet.ConcentrationEstimate[int.Parse(this.cmb_TubeNum.Text) - 1] = (frmLogic.enumRangeState) int.Parse(this.cmb_MD.SelectedValue.ToString());


                this.CreateComboBox(cmb_TubeNum, 32);
                this.CreateGridView();
            }
        }
Beispiel #3
0
        private void btn_OK_Click(object sender, EventArgs e)
        {
            string sMark = "0";

            if (this.txtShuRi.Text != "")
            {
                if (sType != "3")
                {
                    if (clsData.IsNumber(this.txtShuRi.Text))
                    {
                        if (BoolNum(this.txtShuRi.Text))
                        {
                            if (sNum1 != "")
                            {
                                if (double.Parse(this.txtShuRi.Text) < double.Parse(sNum1))
                                {
                                    frm_Info frm = new frm_Info("必须大于或等于数值下限!");
                                    frm.ShowDialog();

                                    sMark = "1";
                                }
                            }

                            if (sMark == "0")
                            {
                                if (sNum2 != "")
                                {
                                    if (double.Parse(this.txtShuRi.Text) > double.Parse(sNum2))
                                    {
                                        frm_Info frm = new frm_Info("必须小于或等于数值上限!");
                                        frm.ShowDialog();

                                        sMark = "1";
                                    }
                                }
                            }

                            if (sMark == "0")
                            {
                                sNUM = this.txtShuRi.Text;
                                this.Close();
                            }
                        }
                        else
                        {
                            frm_Info frm = new frm_Info("必须为数字!");
                            frm.ShowDialog();
                        }
                    }
                    else
                    {
                        frm_Info frm = new frm_Info("必须为数字!");
                        frm.ShowDialog();
                        this.txtShuRi.Focus();
                    }
                }
                else  //IP地址
                {
                    sNUM = this.txtShuRi.Text;
                    this.Close();
                }
            }
            else
            {
                frm_Info frm = new frm_Info("数字不能为空!");
                frm.ShowDialog();
                this.txtShuRi.Focus();
            }
        }