예제 #1
0
        /// <summary>
        /// 验证信息完整性
        /// </summary>
        /// <returns></returns>
        private bool Check()
        {
            String str = String.Empty;

            str = TextBoxItemName.Text.Trim();
            if (str.Length == 0)
            {
                MessageBox.Show("请设置【项目名称】!", "操作提示");
                TextBoxItemName.Focus();
                return(false);
            }
            if (ComboBoxMethod.SelectedIndex < 0)
            {
                MessageBox.Show("请设置【检测方法】!", "操作提示");
                ComboBoxMethod.Focus();
                return(false);
            }
            str = TextBoxSampleNum.Text.Trim();
            if (str.Length == 0)
            {
                MessageBox.Show("请设置【样品编号】!", "操作提示");
                TextBoxSampleNum.Focus();
                return(false);
            }
            str = TextBoxInvalidC.Text.Trim();
            if (str.Length == 0)
            {
                MessageBox.Show("请设置【C值】最小值!", "操作提示");
                TextBoxInvalidC.Focus();
                return(false);
            }
            str = TextBoxUnit.Text.Trim();
            if (str.Length == 0)
            {
                MessageBox.Show("请设置【检测单位】!", "操作提示");
                TextBoxUnit.Focus();
                return(false);
            }
            List <CheckBox> listCheckBoxes = UIUtils.GetChildObjects <CheckBox>(StackPanelHole, typeof(CheckBox));

            for (int i = 0; i < Global.deviceHole.SxtCount; ++i)
            {
                listCheckBoxes[i].IsChecked = true;
            }
            str = TextBoxPassword.Text.Trim();
            if (str.Length == 0)
            {
                if (MessageBox.Show("【未设置密码】 确定保存无密码的检测项目吗?", "操作提示", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
                {
                    this.TextBoxPassword.Focus();
                    return(false);
                }
            }
            return(true);
        }
예제 #2
0
        /// <summary>
        /// 验证信息完整性
        /// </summary>
        /// <returns></returns>
        private bool Check()
        {
            String str = String.Empty;

            str = TextBoxItemName.Text.Trim();
            if (str.Length == 0)
            {
                MessageBox.Show(this, "请设置【项目名称】!", "操作提示", MessageBoxButton.OK, MessageBoxImage.Warning);
                TextBoxItemName.Focus();
                return(false);
            }
            if (ComboBoxMethod.SelectedIndex < 0)
            {
                MessageBox.Show(this, "请设置【检测方法】!", "操作提示", MessageBoxButton.OK, MessageBoxImage.Warning);
                ComboBoxMethod.Focus();
                return(false);
            }
            str = TextBoxUnit.Text.Trim();
            if (str.Length == 0)
            {
                MessageBox.Show(this, "请设置【单位】!", "操作提示", MessageBoxButton.OK, MessageBoxImage.Warning);
                TextBoxUnit.Focus();
                return(false);
            }
            str = ComboBoxWave.Text.Trim();
            if (str.Length == 0)
            {
                MessageBox.Show(this, "请设置【波长】!", "操作提示", MessageBoxButton.OK, MessageBoxImage.Warning);
                ComboBoxWave.Focus();
                return(false);
            }
            str = TextBoxPassword.Text.Trim();
            if (str.Length == 0)
            {
                if (MessageBox.Show("【未设置密码】 确定保存无密码的检测项目吗?", "操作提示", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
                {
                    TextBoxPassword.Focus();
                    return(false);
                }
            }
            return(true);
        }