|
|
@@ -445,7 +445,12 @@ namespace UAS_LabelMachine
|
|
|
if (si_expression != "")
|
|
|
{
|
|
|
si_exp = new Regex(si_expression);
|
|
|
- DateCode = si_exp.Match(matchs1.Groups[reg.GroupNumberFromName(groupName)].Value).Value;
|
|
|
+ Match mat = si_exp.Match(matchs1.Groups[reg.GroupNumberFromName(groupName)].Value);
|
|
|
+ foreach (var dtgroup in si_exp.GetGroupNames())
|
|
|
+ {
|
|
|
+ if (dtgroup == dt.Rows[j]["si_name"].ToString())
|
|
|
+ DateCode = mat.Groups[si_exp.GroupNumberFromName(dtgroup)].Value;
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -503,7 +508,16 @@ namespace UAS_LabelMachine
|
|
|
if (si_expression != "")
|
|
|
{
|
|
|
si_exp = new Regex(si_expression);
|
|
|
- QTY = si_exp.Match(matchs1.Groups[reg.GroupNumberFromName(groupName)].Value).Value;
|
|
|
+ Console.WriteLine(matchs1.Groups[reg.GroupNumberFromName(groupName)].Value);
|
|
|
+ Match mat = si_exp.Match(matchs1.Groups[reg.GroupNumberFromName(groupName)].Value);
|
|
|
+ foreach (var dtgroup in si_exp.GetGroupNames())
|
|
|
+ {
|
|
|
+ if (dtgroup == dt.Rows[j]["si_name"].ToString())
|
|
|
+ {
|
|
|
+ Console.WriteLine(mat.Groups[si_exp.GroupNumberFromName(dtgroup)].Value);
|
|
|
+ QTY = mat.Groups[si_exp.GroupNumberFromName(dtgroup)].Value;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -614,9 +628,21 @@ namespace UAS_LabelMachine
|
|
|
else if (Expression.Checked)
|
|
|
{
|
|
|
Regex re = new Regex(cu_print_regexpression.Text);
|
|
|
- if (re.Match(msgArr[i]).Value == LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodcode"].Value.ToString())
|
|
|
+ Match matchs1 = re.Match(msgArr[i]);
|
|
|
+ foreach (var groupName in re.GetGroupNames())
|
|
|
{
|
|
|
- CheckItem.Remove("客户料号");
|
|
|
+ if (groupName == "custPN")
|
|
|
+ {
|
|
|
+ if (LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodcode"].Value.ToString() == matchs1.Groups[re.GroupNumberFromName(groupName)].Value)
|
|
|
+ {
|
|
|
+ pibid = back_adh.getFieldDataByCondition("prodiobarcode", "min(pib_id)", "pib_inoutno='" + pi_inoutno.Text + "' and pd_custprodcode='" + msgArr[i] + "' and pib_ifrecheck=0").ToString();
|
|
|
+ if (pibid != "")
|
|
|
+ {
|
|
|
+ pibid1 = pibid;
|
|
|
+ CheckItem.Remove("客户料号");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if (RegexMatch("BackCheck", msgArr[i], out ErrorMsg))
|
|
|
@@ -1386,16 +1412,19 @@ namespace UAS_LabelMachine
|
|
|
if (dr1[0]["lp_sql"].ToString().Contains("pib_year"))
|
|
|
{
|
|
|
string date = dt1.Rows[0][0].ToString();
|
|
|
- System.DateTime dtime = System.DateTime.ParseExact(date, "yyyymmdd", System.Globalization.CultureInfo.CurrentCulture);
|
|
|
- try
|
|
|
+ System.DateTime dtime;
|
|
|
+ if (System.DateTime.TryParseExact(date, "yyyymmdd", System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, out dtime))
|
|
|
{
|
|
|
- date = dtime.ToString(cu_print_dateformat.Text);
|
|
|
- }
|
|
|
- catch (Exception)
|
|
|
- {
|
|
|
- date = dtime.ToString("yyyymmdd");
|
|
|
+ try
|
|
|
+ {
|
|
|
+ date = dtime.ToString(cu_print_dateformat.Text);
|
|
|
+ }
|
|
|
+ catch (Exception)
|
|
|
+ {
|
|
|
+ date = dtime.ToString("yyyymmdd");
|
|
|
+ }
|
|
|
+ MidDoc.Variables.FormVariables.Item(k + 1).Value = date;
|
|
|
}
|
|
|
- MidDoc.Variables.FormVariables.Item(k + 1).Value = date;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -1470,16 +1499,19 @@ namespace UAS_LabelMachine
|
|
|
if (dr1[0]["lp_sql"].ToString().Contains("pib_year"))
|
|
|
{
|
|
|
string date = dt1.Rows[0][0].ToString();
|
|
|
- System.DateTime dtime = System.DateTime.ParseExact(date, "yyyymmdd", System.Globalization.CultureInfo.CurrentCulture);
|
|
|
- try
|
|
|
- {
|
|
|
- date = dtime.ToString(cu_print_dateformat.Text);
|
|
|
- }
|
|
|
- catch (Exception)
|
|
|
+ System.DateTime dtime;
|
|
|
+ if (System.DateTime.TryParseExact(date, "yyyymmdd", System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, out dtime))
|
|
|
{
|
|
|
- date = dtime.ToString("yyyymmdd");
|
|
|
+ try
|
|
|
+ {
|
|
|
+ date = dtime.ToString(cu_print_dateformat.Text);
|
|
|
+ }
|
|
|
+ catch (Exception)
|
|
|
+ {
|
|
|
+ date = dtime.ToString("yyyymmdd");
|
|
|
+ }
|
|
|
+ OutBoxDoc.Variables.FormVariables.Item(k + 1).Value = date;
|
|
|
}
|
|
|
- OutBoxDoc.Variables.FormVariables.Item(k + 1).Value = date;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -2520,16 +2552,19 @@ namespace UAS_LabelMachine
|
|
|
if (dr1[0]["lp_sql"].ToString().Contains("pib_year"))
|
|
|
{
|
|
|
string date = dt1.Rows[0][0].ToString();
|
|
|
- System.DateTime dtime = System.DateTime.ParseExact(date, "yyyymmdd", System.Globalization.CultureInfo.CurrentCulture);
|
|
|
- try
|
|
|
+ System.DateTime dtime;
|
|
|
+ if (System.DateTime.TryParseExact(date, "yyyymmdd", System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, out dtime))
|
|
|
{
|
|
|
- date = dtime.ToString(cu_print_dateformat.Text);
|
|
|
- }
|
|
|
- catch (Exception)
|
|
|
- {
|
|
|
- date = dtime.ToString("yyyymmdd");
|
|
|
+ try
|
|
|
+ {
|
|
|
+ date = dtime.ToString(cu_print_dateformat.Text);
|
|
|
+ }
|
|
|
+ catch (Exception)
|
|
|
+ {
|
|
|
+ date = dtime.ToString("yyyymmdd");
|
|
|
+ }
|
|
|
+ SingleDoc.Variables.FormVariables.Item(j + 1).Value = date;
|
|
|
}
|
|
|
- SingleDoc.Variables.FormVariables.Item(j + 1).Value = date;
|
|
|
}
|
|
|
}
|
|
|
}
|