/// <summary> /// 从旧数据中拷贝检测数据、实现装配数据到新区域 /// </summary> private void CopyMeasureData() { if (txtOldCheckData.Text == "") { return; } txtCheckData.Text = StapleFunction.GetNonNumericString(txtOldCheckData.Text); txtResultData.Text = StapleFunction.GetNonNumericString(txtOldResultData.Text); }
/// <summary> /// 检查录入的信息是否正确 /// </summary> /// <returns>正确返回true</returns> private bool CheckData() { if (m_dataRow["父总成编码"] == "") { MessageDialog.ShowPromptMessage("一级总成不允许进行此操作"); return(false); } if (m_updateMode != UpdateModeEnum.调整 && txtBatchNo.Text.Length == 0) { numBarcode.Focus(); MessageDialog.ShowPromptMessage("请获取返修件的条形码后再进行此操作"); return(false); } if (numAssemblyAmount.Value == 0m) { numAssemblyAmount.Focus(); MessageDialog.ShowPromptMessage("请录入装配数量后再进行此操作"); return(false); } if (txtRemark.Text.Trim().Length == 0) { txtRemark.Focus(); MessageDialog.ShowPromptMessage("请录入备注信息后再进行此操作"); return(false); } if (m_electronFileServer.IsAssemblyPart(m_dataRow["零部件编码"])) { return(true); } string error; if (txtOldCheckData.Text.Length > 0) { if (StapleFunction.GetNonNumericString(txtOldCheckData.Text) != StapleFunction.GetNonNumericString(txtCheckData.Text) || !CheckNumericInfo(txtCheckData.Text)) { txtCheckData.Focus(); MessageDialog.ShowPromptMessage("请录入正确的检测数据后再进行此操作(效仿数据区的检测数据录入格式)"); return(false); } if (!CheckSpec(out error)) { txtCheckData.Focus(); MessageDialog.ShowPromptMessage(error); return(false); } int index = txtResultData.Text.LastIndexOf(':'); double value = 0; if (index + 1 == txtResultData.Text.Length || StapleFunction.GetNonNumericString(txtResultData.Text) != StapleFunction.GetNonNumericString(txtResultData.Text) || !CheckNumericInfo(txtResultData.Text) || !Double.TryParse(txtResultData.Text.Substring(index + 1), out value)) { txtResultData.Focus(); MessageDialog.ShowPromptMessage("请录入正确的测量数据后再进行此操作(效仿数据区的测量数据录入格式)"); return(false); } } else { if (txtSpec.Text != m_dataRow["规格"]) { numBarcode.Focus(); MessageDialog.ShowPromptMessage("扫描零件的规格必须与原规格一致"); return(false); } } if (m_dataRow["零件标识码"].Length > 0 && txtPartID.Text.Trim().Length == 0) { txtPartID.Focus(); MessageDialog.ShowPromptMessage("请录入零件标识码后再进行此操作"); return(false); } return(true); }