|
|
@@ -405,7 +405,7 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
catch (Exception)
|
|
|
{
|
|
|
- dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (MaxNum + 1) + "'", "rmn_nrcode='" + (NrCode == "" ? "Default" : NrCode) + "' and rmn_prefix='" + Prefix + "'");
|
|
|
+ dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (MaxNum + 1) + "'", "rmn_nrcode='" + (NrCode == "" ? "Default" : NrCode) + "' and rmn_prefix='" + Prefix + "' and rmn_type='" + ReSetType + "'");
|
|
|
CollectInputData();
|
|
|
return;
|
|
|
}
|
|
|
@@ -1582,7 +1582,7 @@ namespace UAS_LabelMachine
|
|
|
if (OutBox != "新增" && OutBox != "")
|
|
|
OutBoxNum.Text = OutBox;
|
|
|
}
|
|
|
-
|
|
|
+ string ReSetType = "";
|
|
|
/// <summary>
|
|
|
/// 获取条码规则
|
|
|
/// </summary>
|
|
|
@@ -1601,16 +1601,16 @@ namespace UAS_LabelMachine
|
|
|
MaxNum = 0;
|
|
|
SerialNumLength = 0;
|
|
|
Radix = 0;
|
|
|
- DataTable Nr = (DataTable)dh.ExecuteSql("select nr_resettype,nr_sharerule,nr_code,nrd_detno,nrd_name,nrd_type,nrd_radix,nrd_sql,nrd_length from NoRuleDetail left join norule on nrd_nrid=nr_id where nr_custcode='" + pi_cardcode.Text + "' order by nrd_detno", "select");
|
|
|
+ DataTable Nr = (DataTable)dh.ExecuteSql("select nvl(nr_resettype,' ')nr_resettype,nr_sharerule,nr_code,nrd_detno,nrd_name,nrd_type,nrd_radix,nrd_sql,nrd_length from NoRuleDetail left join norule on nrd_nrid=nr_id where nr_custcode='" + pi_cardcode.Text + "' order by nrd_detno", "select");
|
|
|
//如果没有则取公共规则
|
|
|
if (Nr.Rows.Count == 0)
|
|
|
- Nr = (DataTable)dh.ExecuteSql("select nr_resettype,nr_sharerule,nr_code,nrd_detno,nrd_name,nrd_radix,nrd_type,nrd_sql,nrd_length from NoRuleDetail left join norule on nrd_nrid=nr_id where nr_custcode is null and nr_isdefault <> 0 order by nrd_detno", "select");
|
|
|
+ Nr = (DataTable)dh.ExecuteSql("select nvl(nr_resettype,' ')nr_resettype,nr_sharerule,nr_code,nrd_detno,nrd_name,nrd_radix,nrd_type,nrd_sql,nrd_length from NoRuleDetail left join norule on nrd_nrid=nr_id where nr_custcode is null and nr_isdefault <> 0 order by nrd_detno", "select");
|
|
|
//用于过滤参数的正则表达式
|
|
|
- string ReSetType = "";
|
|
|
+ ReSetType = "";
|
|
|
if (Nr.Rows.Count > 0)
|
|
|
{
|
|
|
string ShareRule = Nr.Rows[0]["nr_sharerule"].ToString();
|
|
|
- DataTable dt1 = (DataTable)dh.ExecuteSql("select nr_resettype,nr_sharerule,nr_code,nrd_detno,nrd_name,nrd_radix,nrd_type,nrd_sql,nrd_length from NoRuleDetail left join norule on nrd_nrid=nr_id where nr_code='" + ShareRule + "' order by nrd_detno", "select");
|
|
|
+ DataTable dt1 = (DataTable)dh.ExecuteSql("select nvl(nr_resettype,' ')nr_resettype,nr_sharerule,nr_code,nrd_detno,nrd_name,nrd_radix,nrd_type,nrd_sql,nrd_length from NoRuleDetail left join norule on nrd_nrid=nr_id where nr_code='" + ShareRule + "' order by nrd_detno", "select");
|
|
|
if (dt1.Rows.Count > 0)
|
|
|
{
|
|
|
Nr = dt1;
|
|
|
@@ -1644,7 +1644,7 @@ namespace UAS_LabelMachine
|
|
|
sql.Clear();
|
|
|
sql.Append("to_char(sysdate,'yyyyMMdd')");
|
|
|
break;
|
|
|
- case "":
|
|
|
+ case " ":
|
|
|
sql.Clear();
|
|
|
sql.Append("' '");
|
|
|
break;
|