Browse Source

喷涂获取颜色,分割为英文逗号的处理

master
ruoxing.wang 2 months ago
parent
commit
294d20e078
  1. 17
      PaintingPC/FrmQuality.cs

17
PaintingPC/FrmQuality.cs

@ -571,7 +571,20 @@ namespace PaintingPC
/// <returns></returns> /// <returns></returns>
bool CheckColor(ref string colorName,ref string partName) bool CheckColor(ref string colorName,ref string partName)
{ {
string[] ss = labProductInfo.Text.Split(','); string[] ss = null;
if (string.IsNullOrEmpty(labProductInfo.Text))
{
MessageBox.Show("颜色信息有误,请重新扫描");
return false;
}
if (labProductInfo.Text.Contains(","))
{
ss = labProductInfo.Text.Split(',');
}
else
{
ss = labProductInfo.Text.Split(',');
}
if (ss.Length >= 1) if (ss.Length >= 1)
{ {
if (string.IsNullOrWhiteSpace(ss[0])) if (string.IsNullOrWhiteSpace(ss[0]))
@ -582,7 +595,7 @@ namespace PaintingPC
} }
else else
{ {
MessageBox.Show("条码有误,请重新扫描"); MessageBox.Show("颜色信息有误1,请重新扫描");
return false; return false;
} }
colorName = ss[0]; colorName = ss[0];

Loading…
Cancel
Save