|
|
@@ -456,6 +456,20 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
|
DateCode = matchs1.Groups[reg.GroupNumberFromName(groupName)].Value;
|
|
|
}
|
|
|
+ string year = "";
|
|
|
+ string month = "";
|
|
|
+ string day = "";
|
|
|
+ string date = "";
|
|
|
+ LogicHandler.GetTimeFromDatecode(DateCode, pi_cardcode.Text, out year, out month, out day, out date);
|
|
|
+ System.DateTime dtime;
|
|
|
+ //有效期比对
|
|
|
+ if (System.DateTime.TryParseExact(date, "yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, out dtime))
|
|
|
+ {
|
|
|
+ if ((System.DateTime.Now - dtime).Days > cu_print_limiteddate.Value)
|
|
|
+ {
|
|
|
+ MessageLog.AppendText(">>超出有效期\n", Color.Red);
|
|
|
+ }
|
|
|
+ }
|
|
|
break;
|
|
|
case "LotNo":
|
|
|
LotNo = matchs1.Groups[reg.GroupNumberFromName(groupName)].Value;
|
|
|
@@ -508,13 +522,11 @@ namespace UAS_LabelMachine
|
|
|
if (si_expression != "")
|
|
|
{
|
|
|
si_exp = new Regex(si_expression);
|
|
|
- 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;
|
|
|
}
|
|
|
}
|
|
|
@@ -680,6 +692,7 @@ namespace UAS_LabelMachine
|
|
|
string year = "0";
|
|
|
string month = "0";
|
|
|
string day = "0";
|
|
|
+ string date = "";
|
|
|
DataRow[] dr = LabelInfDataTable.Select("pib_id=" + pibid1 + " and pr_orispeccode='" + PN + "'");
|
|
|
if (dr.Length > 0)
|
|
|
{
|
|
|
@@ -688,7 +701,7 @@ namespace UAS_LabelMachine
|
|
|
dr[0]["pib_datecode"] = DateCode;
|
|
|
try
|
|
|
{
|
|
|
- LogicHandler.GetTimeFromDatecode(DateCode, "", out year, out month, out day);
|
|
|
+ LogicHandler.GetTimeFromDatecode(DateCode, pi_cardcode.Text, out year, out month, out day, out date);
|
|
|
dr[0]["pib_year"] = year;
|
|
|
dr[0]["pib_month"] = month;
|
|
|
dr[0]["pib_day"] = day;
|
|
|
@@ -759,11 +772,12 @@ namespace UAS_LabelMachine
|
|
|
string year = "0";
|
|
|
string month = "0";
|
|
|
string day = "0";
|
|
|
+ string date = "";
|
|
|
LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value = DateCode;
|
|
|
//解析DateCode,将值设置到年月日
|
|
|
try
|
|
|
{
|
|
|
- LogicHandler.GetTimeFromDatecode(DateCode, "", out year, out month, out day);
|
|
|
+ LogicHandler.GetTimeFromDatecode(DateCode, pi_cardcode.Text, out year, out month, out day, out date);
|
|
|
LabelInf.Rows[CurrentRowIndex].Cells["pib_year"].Value = year;
|
|
|
LabelInf.Rows[CurrentRowIndex].Cells["pib_month"].Value = month;
|
|
|
LabelInf.Rows[CurrentRowIndex].Cells["pib_day"].Value = day;
|
|
|
@@ -956,7 +970,7 @@ namespace UAS_LabelMachine
|
|
|
//}
|
|
|
//获取客户自定义设置
|
|
|
sql.Clear();
|
|
|
- sql.Append("select cu_print_middc,cu_print_outdc,cu_print_dateformat,cu_print_checkdatecode,cu_print_midlotno,nvl(cu_print_custprodmatchmodel,'Equal')cu_print_custprodmatchmodel,cu_print_midspec,cu_print_midpo,cu_print_midprod,cu_print_outlotno,cu_print_outspec,cu_print_outpo");
|
|
|
+ sql.Append("select cu_print_middc,cu_print_limiteddate,cu_print_outdc,cu_print_dateformat,cu_print_checkdatecode,cu_print_midlotno,nvl(cu_print_custprodmatchmodel,'Equal')cu_print_custprodmatchmodel,cu_print_midspec,cu_print_midpo,cu_print_midprod,cu_print_outlotno,cu_print_outspec,cu_print_outpo");
|
|
|
sql.Append(",cu_print_outprod,cu_print_checkonly,nvl(cu_print_papercount,0)cu_print_papercount,cu_print_regexpression,cu_print_recheck from customer where cu_code='" + pi_cardcode.Text + "'");
|
|
|
dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
|
|
|
if (dt.Rows.Count > 0)
|
|
|
@@ -1384,7 +1398,6 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
sql.Append("1,");
|
|
|
DataTable dt = (DataTable)adh.ExecuteSql("select " + sql.ToString().Substring(0, sql.Length - 1) + " from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1=" + (pib_outboxcode1 == "" ? "0" : pib_outboxcode1), "select");
|
|
|
- Console.WriteLine("select " + sql.ToString().Substring(0, sql.Length - 1) + " from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1=" + (pib_outboxcode1 == "" ? "0" : pib_outboxcode1));
|
|
|
for (int j = 0; j < MidDoc.Variables.FormVariables.Count; j++)
|
|
|
{
|
|
|
DataRow[] dr1 = MidLabelParam.Select("lp_name='" + MidDoc.Variables.FormVariables.Item(j + 1).Name.ToLower() + "'");
|
|
|
@@ -2310,7 +2323,8 @@ namespace UAS_LabelMachine
|
|
|
string year = "0";
|
|
|
string month = "0";
|
|
|
string day = "0";
|
|
|
- LogicHandler.GetTimeFromDatecode(datecode, "", out year, out month, out day);
|
|
|
+ string date = "";
|
|
|
+ LogicHandler.GetTimeFromDatecode(DateCode, pi_cardcode.Text, out year, out month, out day, out date);
|
|
|
adh.ExecuteSql("update prodiobarcode set pib_ifpick=-1,pib_ifmodify=-1,pib_lotno='" + lotno + "',pib_datecode='" + datecode + "',pib_year='" + year + "',pib_month='" + month + "',pib_day='" + day + "' where pib_inoutno='" + pi_inoutno.Text + "' and pib_pdno=" + pdno, "update");
|
|
|
LoadGridData();
|
|
|
setvalue.FindForm().Close();
|
|
|
@@ -2325,7 +2339,8 @@ namespace UAS_LabelMachine
|
|
|
string year = "0";
|
|
|
string month = "0";
|
|
|
string day = "0";
|
|
|
- LogicHandler.GetTimeFromDatecode(datecode, "", out year, out month, out day);
|
|
|
+ string date = "";
|
|
|
+ LogicHandler.GetTimeFromDatecode(DateCode, pi_cardcode.Text, out year, out month, out day, out date);
|
|
|
adh.ExecuteSql("update prodiobarcode set pib_ifpick=-1,pib_ifmodify=-1,pib_ifprint=-1,pib_lotno='" + lotno + "',pib_datecode='" + datecode + "',pib_year='" + year + "',pib_month='" + month + "',pib_day='" + day + "' where pib_inoutno='" + pi_inoutno.Text + "' and pib_pdno=" + pdno, "update");
|
|
|
LoadGridData();
|
|
|
DataTable pibid_dt = (DataTable)adh.ExecuteSql("select pib_id from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_pdno=" + pdno, "select");
|
|
|
@@ -2353,10 +2368,11 @@ namespace UAS_LabelMachine
|
|
|
string year = "0";
|
|
|
string month = "0";
|
|
|
string day = "0";
|
|
|
+ string date = "";
|
|
|
//解析DateCode,将值设置到年月日
|
|
|
try
|
|
|
{
|
|
|
- LogicHandler.GetTimeFromDatecode(DateCode, "", out year, out month, out day);
|
|
|
+ LogicHandler.GetTimeFromDatecode(DateCode, pi_cardcode.Text, out year, out month, out day, out date);
|
|
|
LabelInf.Rows[CurrentRowIndex].Cells["pib_year"].Value = year;
|
|
|
LabelInf.Rows[CurrentRowIndex].Cells["pib_month"].Value = month;
|
|
|
LabelInf.Rows[CurrentRowIndex].Cells["pib_day"].Value = day;
|