check order text null or empty
This commit is contained in:
@@ -690,17 +690,20 @@ namespace TetraPackOCR
|
||||
this.btn_OrderNum.Enabled = false;
|
||||
//通过订单号获取表格中需要的值
|
||||
string order = txt_OrderNum.Text;
|
||||
string laststr = order.Substring(order.Length - 1);
|
||||
if (string.IsNullOrEmpty(order))
|
||||
{
|
||||
log.Warn("订单号为空,请输入订单号。");
|
||||
btn_OrderNum.Enabled = true;
|
||||
return;
|
||||
}
|
||||
string laststr;
|
||||
if (order.Length > 1)
|
||||
laststr = order.Substring(order.Length - 1);
|
||||
else
|
||||
laststr = order;
|
||||
if (laststr == "C")
|
||||
{
|
||||
Coprinted_ordeFlag = true;
|
||||
if (order == null)
|
||||
{
|
||||
log.Warn("订单号为空,请输入订单号。");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
log.Info("当前订单号为:" + order);
|
||||
//读取表格内容
|
||||
ExcelPackage.License.SetNonCommercialOrganization("My Noncommercial organization");
|
||||
@@ -748,7 +751,6 @@ namespace TetraPackOCR
|
||||
if (num >= NumberOfLanes)
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -778,6 +780,7 @@ namespace TetraPackOCR
|
||||
if (string.IsNullOrEmpty(ProductStandard))
|
||||
{
|
||||
log.Debug("请检查订单号是否正确");
|
||||
btn_OrderNum.Enabled = true;
|
||||
return;
|
||||
}
|
||||
//根据产品规格获取距离坐标
|
||||
@@ -804,6 +807,7 @@ namespace TetraPackOCR
|
||||
if (DistX == 0 || DistY == 0)
|
||||
{
|
||||
log.Debug("请检查订单号是否正确");
|
||||
btn_OrderNum.Enabled = true;
|
||||
return;
|
||||
}
|
||||
log.Info("相关数据已获取完成,且已显示在界面中,请查看。");
|
||||
@@ -811,21 +815,14 @@ namespace TetraPackOCR
|
||||
else
|
||||
{
|
||||
log.Debug("请检查订单号是否正确");
|
||||
btn_OrderNum.Enabled = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Coprinted_ordeFlag = false;
|
||||
if (order == null)
|
||||
{
|
||||
log.Warn("订单号为空,请输入订单号。");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
log.Info("当前订单号为:" + order);
|
||||
//读取表格内容
|
||||
ExcelPackage.License.SetNonCommercialOrganization("My Noncommercial organization");
|
||||
@@ -887,6 +884,7 @@ namespace TetraPackOCR
|
||||
if (string.IsNullOrEmpty(ProductStandard))
|
||||
{
|
||||
log.Debug("请检查订单号是否正确");
|
||||
btn_OrderNum.Enabled = true;
|
||||
return;
|
||||
}
|
||||
//根据产品规格获取距离坐标
|
||||
@@ -913,6 +911,7 @@ namespace TetraPackOCR
|
||||
if (DistX == 0 || DistY == 0)
|
||||
{
|
||||
log.Debug("请检查订单号是否正确");
|
||||
btn_OrderNum.Enabled = true;
|
||||
return;
|
||||
}
|
||||
log.Info("相关数据已获取完成,且已显示在界面中,请查看。");
|
||||
@@ -920,11 +919,11 @@ namespace TetraPackOCR
|
||||
else
|
||||
{
|
||||
log.Debug("请检查订单号是否正确");
|
||||
btn_OrderNum.Enabled = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
///判断当前Lans决定结果显示数量
|
||||
switch (NumberOfLanes)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user