private void btnConfirm_Click(object sender, EventArgs e)
        {
            //System.Text.RegularExpressions.Regex reg = new System.Text.RegularExpressions.Regex("[\\*\\\\/:?<>|\"]");

            if (txtName.Text == string.Empty)
            {
                MessageBox.Show("算法名称不能为空!");
                return;
            }
            else
            {
                if (Verification.IsCheckSignleString(txtName.Text))
                {
                    MessageBox.Show("算法名称包含非法字符!");
                    txtName.Focus();
                    return;
                }
            }

            if (txtRemark.Text != string.Empty)
            {
                if (Verification.IsCheckRemarkString(txtRemark.Text))
                {
                    MessageBox.Show("算法备注包含非法字符!");
                    return;
                }
            }

            //更新节点
            waData.FormulaList.Clear();
            foreach (TreeNode node in treeViewWeightSortNode.Nodes[0].Nodes)
            {
                waData.FormulaList.Add((NodeFormula)node.Tag);
            }

            List <WeightParameter> templistpara = waData.GetParaList();
            bool bParaPrompt = false;

            foreach (WeightParameter wp in templistpara)
            {
                //if (wp.ParaType == 10 && wp.ParaUnit.Length == 0 && wp.ParaRemark.Length == 0)
                if (wp.ParaType == 10)
                {
                    bParaPrompt = true;
                    break;
                }
            }

            if (bParaPrompt)
            {
                if (MessageBox.Show("算法中含有未定义参数(临时参数)!\r\n保存算法前是否对这些参数进行设定?", "参数定义", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    List <WeightParameter> listparaforset = new List <WeightParameter>();
                    foreach (WeightParameter wp in templistpara)
                    {
                        // if (wp.ParaType == 10 && wp.ParaUnit.Length == 0 && wp.ParaRemark.Length == 0)
                        if (wp.ParaType == 10)
                        {
                            listparaforset.Add(wp);
                        }
                    }
                    TempWeightParaSet form = new TempWeightParaSet(listparaforset);
                    form.ShowDialog();
                }
            }

            bool bprompt = (strType == "edit") ? false : true;

            waData.Name           = txtName.Text;
            waData.CreateTime     = dateTimePickerCreateTime.Text;
            waData.LastModifyTime = dateTimePickerLastModifyTime.Text;
            waData.Remark         = txtRemark.Text;

            if (WriteArithmeticFile(waData, bprompt) == false)
            {
                return;
            }

            strCoreEnvelopeArithmeticFileName = waData.Name;

            this.DialogResult = DialogResult.OK;
            this.Close();
        }
コード例 #2
0
        private void btnConfirm_Click(object sender, EventArgs e)
        {
            if (txtName.Text == string.Empty)
            {
                MessageBox.Show("算法名称不能为空!");
                return;
            }
            else
            {
                if (Verification.IsCheckSignleString(txtName.Text))
                {
                    MessageBox.Show("算法名称包含非法字符!");
                    txtName.Focus();
                    return;
                }
            }

            if (txtRemark.Text != string.Empty)
            {
                if (Verification.IsCheckRemarkString(txtRemark.Text))
                {
                    MessageBox.Show("算法备注包含非法字符!");
                    return;
                }
            }

            List<ParaData> templistpara = waData.GetParaList();
            bool bParaPrompt = false;
            foreach (ParaData wp in templistpara)
            {
                //if (wp.ParaType == 10 && wp.ParaUnit.Length == 0 && wp.ParaRemark.Length == 0)
                if (wp.paraType == 10)
                {
                    bParaPrompt = true;
                    break;
                }
            }

            if (bParaPrompt)
            {
                if (MessageBox.Show("算法中含有未定义参数(临时参数)!\r\n保存算法前是否对这些参数进行设定?", "参数定义", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    List<ParaData> listparaforset = new List<ParaData>();
                    foreach (ParaData wp in templistpara)
                    {
                        //if (wp.ParaType == 10 && wp.ParaUnit.Length == 0 && wp.ParaRemark.Length == 0)
                        if (wp.paraType == 10)
                        {
                            listparaforset.Add(wp);
                        }
                    }
                    TempWeightParaSet form = new TempWeightParaSet(listparaforset);
                    form.ShowDialog();
                }
            }

            bool bprompt = (strType == "edit") ? false : true;

            waData.SortName = comboBoxWeightSort.Text;
            waData.Name = txtName.Text;
            waData.CreateTime = dateTimePickerCreateTime.Text;
            waData.LastModifyTime = dateTimePickerLastModifyTime.Text;
            waData.Remark = txtRemark.Text;

            if (WriteArithmeticFile(waData, bprompt) == false)
            {
                return;
            }

            strWeightSortName = waData.SortName;
            strWeightArithmeticFileName = waData.Name;

            this.DialogResult = DialogResult.OK;
            this.Close();
        }
コード例 #3
0
        private void btnConfirm_Click(object sender, EventArgs e)
        {
            if (txtName.Text == string.Empty)
            {
                MessageBox.Show("算法名称不能为空!");
                return;
            }
            else
            {
                if (Verification.IsCheckSignleString(txtName.Text))
                {
                    MessageBox.Show("算法名称包含非法字符!");
                    txtName.Focus();
                    return;
                }
            }

            if (txtRemark.Text != string.Empty)
            {
                if (Verification.IsCheckRemarkString(txtRemark.Text))
                {
                    MessageBox.Show("算法备注包含非法字符!");
                    return;
                }
            }

            List <WeightParameter> templistpara = waData.GetParaList();
            bool bParaPrompt = false;

            foreach (WeightParameter wp in templistpara)
            {
                //if (wp.ParaType == 10 && wp.ParaUnit.Length == 0 && wp.ParaRemark.Length == 0)
                if (wp.ParaType == 10)
                {
                    bParaPrompt = true;
                    break;
                }
            }

            if (bParaPrompt)
            {
                if (MessageBox.Show("算法中含有未定义参数(临时参数)!\r\n保存算法前是否对这些参数进行设定?", "参数定义", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    List <WeightParameter> listparaforset = new List <WeightParameter>();
                    foreach (WeightParameter wp in templistpara)
                    {
                        //if (wp.ParaType == 10 && wp.ParaUnit.Length == 0 && wp.ParaRemark.Length == 0)
                        if (wp.ParaType == 10)
                        {
                            listparaforset.Add(wp);
                        }
                    }
                    TempWeightParaSet form = new TempWeightParaSet(listparaforset);
                    form.ShowDialog();
                }
            }

            bool bprompt = (strType == "edit") ? false : true;

            waData.SortName       = comboBoxWeightSort.Text;
            waData.Name           = txtName.Text;
            waData.CreateTime     = dateTimePickerCreateTime.Text;
            waData.LastModifyTime = dateTimePickerLastModifyTime.Text;
            waData.Remark         = txtRemark.Text;

            if (WriteArithmeticFile(waData, bprompt) == false)
            {
                return;
            }

            strWeightSortName           = waData.SortName;
            strWeightArithmeticFileName = waData.Name;

            this.DialogResult = DialogResult.OK;
            this.Close();
        }
コード例 #4
0
        private void btnConfirm_Click(object sender, EventArgs e)
        {
            //System.Text.RegularExpressions.Regex reg = new System.Text.RegularExpressions.Regex("[\\*\\\\/:?<>|\"]");

            if (txtName.Text == string.Empty)
            {
                MessageBox.Show("算法名称不能为空!");
                return;
            }
            else
            {
                if (Verification.IsCheckSignleString(txtName.Text))
                {
                    MessageBox.Show("算法名称包含非法字符!");
                    txtName.Focus();
                    return;
                }
            }

            if (txtRemark.Text != string.Empty)
            {
                if (Verification.IsCheckRemarkString(txtRemark.Text))
                {
                    MessageBox.Show("算法备注包含非法字符!");
                    return;
                }
            }

            //更新节点
            waData.FormulaList.Clear();
            foreach (TreeNode node in treeViewWeightSortNode.Nodes[0].Nodes)
            {
                waData.FormulaList.Add((NodeFormula)node.Tag);
            }

            List<ParaData> templistpara = waData.GetParaList();
            bool bParaPrompt = false;
            foreach (ParaData wp in templistpara)
            {
                //if (wp.ParaType == 10 && wp.ParaUnit.Length == 0 && wp.ParaRemark.Length == 0)
                if (wp.paraType == 10)
                {
                    bParaPrompt = true;
                    break;
                }
            }

            if (bParaPrompt)
            {
                if (MessageBox.Show("算法中含有未定义参数(临时参数)!\r\n保存算法前是否对这些参数进行设定?", "参数定义", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    List<ParaData> listparaforset = new List<ParaData>();
                    foreach (ParaData wp in templistpara)
                    {
                        // if (wp.ParaType == 10 && wp.ParaUnit.Length == 0 && wp.ParaRemark.Length == 0)
                        if (wp.paraType == 10)
                        {
                            listparaforset.Add(wp);
                        }
                    }
                    TempWeightParaSet form = new TempWeightParaSet(listparaforset);
                    form.ShowDialog();
                }
            }

            bool bprompt = (strType == "edit") ? false : true;

            waData.Name = txtName.Text;
            waData.CreateTime = dateTimePickerCreateTime.Text;
            waData.LastModifyTime = dateTimePickerLastModifyTime.Text;
            waData.Remark = txtRemark.Text;

            if (WriteArithmeticFile(waData, bprompt) == false)
            {
                return;
            }

            strCoreEnvelopeArithmeticFileName = waData.Name;

            this.DialogResult = DialogResult.OK;
            this.Close();
        }