private bool QualityCheck()
 {
     if (carType.SelectedIndex == -1)
     {
         MessageBox.Show("请选择车型名称", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
         carType.Focus();
         return(false);
     }
     if (wireName.SelectedIndex == -1)
     {
         MessageBox.Show("请输入车型编号", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
         wireName.Focus();
         return(false);
     }
     if (projectName.Text.Trim().Length == 0)
     {
         MessageBox.Show("请输入工程名称", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
         projectName.Focus();
         return(false);
     }
     if (projectNO.Text.Trim().Length == 0)
     {
         MessageBox.Show("请输入工程编号", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
         projectName.Focus();
         return(false);
     }
     if (Operation == WindowOperation.Add && SQliteDbContext.CheckCarNOExist(projectNO.Text.Trim()))
     {
         MessageBox.Show("车型编号已经存在请重新输入", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
         projectName.Focus();
         return(false);
     }
     if (filename.Text.Trim().Length == 0 && Operation == WindowOperation.Add)
     {
         MessageBox.Show("请导入文件路径", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
         projectName.Focus();
         return(false);
     }
     return(true);
 }
示例#2
0
        private bool  QualityCheck()
        {
            if (carname.Text.Trim().Length == 0)
            {
                MessageBox.Show("请输入车型名称", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
                carname.Focus();
                return(false);
            }
            if (typeno.Text.Trim().Length == 0)
            {
                MessageBox.Show("请输入车型编号", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
                carname.Focus();
                return(false);
            }
            if (Operation == WindowOperation.Add && SQliteDbContext.CheckCarNOExist(typeno.Text.Trim()))
            {
                MessageBox.Show("车型编号已经存在请重新输入", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
                carname.Focus();
                return(false);
            }
            if (Operation == WindowOperation.Update && tempCarNo.Trim() != typeno.Text.Trim())
            {
                if (SQliteDbContext.CheckCarNOExist(typeno.Text.Trim()))
                {
                    MessageBox.Show("车型编号已经存在请重新输入", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
                    carname.Focus();
                    return(false);
                }
                else
                {
                    return(true);
                }
            }

            return(true);
        }