|
|
@@ -405,7 +405,14 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
catch (Exception)
|
|
|
{
|
|
|
- dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (MaxNum + 1) + "'", "rmn_nrcode='" + (NrCode == "" ? "Default" : NrCode) + "' and rmn_prefix='" + Prefix + "' and nvl(rmn_type,' ')='" + ReSetType + "'");
|
|
|
+ if (ReSetType != " ")
|
|
|
+ {
|
|
|
+ dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (MaxNum + 1) + "'", "rmn_nrcode='" + (NrCode == "" ? "Default" : NrCode) + "' and nvl(rmn_type,' ')='" + ReSetType + "'");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (MaxNum + 1) + "'", "rmn_nrcode='" + (NrCode == "" ? "Default" : NrCode) + "' and rmn_prefix='" + Prefix + "'");
|
|
|
+ }
|
|
|
CollectInputData();
|
|
|
return;
|
|
|
}
|
|
|
@@ -1400,9 +1407,9 @@ namespace UAS_LabelMachine
|
|
|
sql.Clear();
|
|
|
sql.Append("select " + Fileds.Substring(0, Fileds.Length - 1) + " from ExportView where pib_inoutno='" + pi_inoutno.Text + "'");
|
|
|
string finnalSQL = "";
|
|
|
- LogicHandler.GetExportDataSQL(pi_inoutno.Text,pi_cardcode.Text, type, sql.ToString(), out finnalSQL);
|
|
|
+ LogicHandler.GetExportDataSQL(pi_inoutno.Text, pi_cardcode.Text, type, sql.ToString(), out finnalSQL);
|
|
|
dt = (DataTable)dh.ExecuteSql(finnalSQL, "select");
|
|
|
- eh.ExportExcel(dt, Field, ExportFileDialog.SelectedPath, pi_date.Text + "-" + pi_inoutno.Text+ type);
|
|
|
+ eh.ExportExcel(dt, Field, ExportFileDialog.SelectedPath, pi_date.Text + "-" + pi_inoutno.Text + type);
|
|
|
string close = MessageBox.Show(this.ParentForm, "导出成功,是否打开文件", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
|
|
|
if (close.ToString() == "Yes")
|
|
|
Process.Start(ExportFileDialog.SelectedPath + "\\" + pi_date.Text + "-" + pi_inoutno.Text + type + ".xls");
|
|
|
@@ -1688,26 +1695,45 @@ namespace UAS_LabelMachine
|
|
|
break;
|
|
|
//流水需要通过MaxNumber去取
|
|
|
case "流水":
|
|
|
- string maxnum = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + (NrCode == "" ? "Default" : NrCode) + "' and rmn_prefix='" + Prefix + "' and nvl(rmn_type,' ')='" + ReSetType + "'").ToString();
|
|
|
+ string maxnum = "";
|
|
|
+ if (ReSetType != " ")
|
|
|
+ {
|
|
|
+ maxnum = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + (NrCode == "" ? "Default" : NrCode) + "' and nvl(rmn_type,' ')='" + ReSetType + "'").ToString();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ maxnum = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + (NrCode == "" ? "Default" : NrCode) + "' and rmn_prefix='" + Prefix + "' ").ToString();
|
|
|
+ }
|
|
|
//设置当前流水
|
|
|
if (maxnum == "")
|
|
|
{
|
|
|
- maxnum = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + (NrCode == "" ? "Default" : NrCode) + "' and nvl(rmn_type,' ')='" + ReSetType + "'").ToString();
|
|
|
- if (maxnum != "")
|
|
|
+ if (ReSetType != " ")
|
|
|
{
|
|
|
- Count = int.Parse(maxnum) + Count;
|
|
|
+ maxnum = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + (NrCode == "" ? "Default" : NrCode) + "' and nvl(rmn_type,' ')='" + ReSetType + "'").ToString();
|
|
|
}
|
|
|
else
|
|
|
+ {
|
|
|
+ maxnum = dh.getFieldDataByCondition("RuleMaxNum", "rmn_maxnumber", "rmn_nrcode='" + (NrCode == "" ? "Default" : NrCode) + "' and rmn_prefix='" + Prefix + "' ").ToString();
|
|
|
+ }
|
|
|
+ if (maxnum == "")
|
|
|
{
|
|
|
maxnum = "1";
|
|
|
}
|
|
|
+ Count = int.Parse(maxnum) + Count;
|
|
|
dh.ExecuteSql("insert into RuleMaxNum(rmn_id,rmn_nrcode,rmn_prefix,rmn_maxnumber,rmn_type) values(RuleMaxNum_seq.nextval,'" + (NrCode == "" ? "Default" : NrCode) + "','" + Prefix + "','" + Count + "','" + ReSetType + "')", "insert");
|
|
|
MaxNum = int.Parse(maxnum);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
MaxNum = int.Parse(maxnum);
|
|
|
- dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (MaxNum + Count) + "'", "rmn_nrcode='" + (NrCode == "" ? "Default" : NrCode) + "' and rmn_prefix='" + Prefix + "' and nvl(rmn_type,' ')='" + ReSetType + "'");
|
|
|
+ if (ReSetType != " ")
|
|
|
+ {
|
|
|
+ dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (MaxNum + Count) + "'", "rmn_nrcode='" + (NrCode == "" ? "Default" : NrCode) + "' and nvl(rmn_type,' ')='" + ReSetType + "'");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (MaxNum + Count) + "'", "rmn_nrcode='" + (NrCode == "" ? "Default" : NrCode) + "' and rmn_prefix='" + Prefix + "'");
|
|
|
+ }
|
|
|
}
|
|
|
SerialNumLength = int.Parse(Nr.Rows[m]["nrd_length"].ToString());
|
|
|
Radix = int.Parse(Nr.Rows[m]["nrd_radix"].ToString());
|
|
|
@@ -1949,7 +1975,14 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (MaxNum + 1) + "'", "rmn_nrcode='" + (NrCode == "" ? "Default" : NrCode) + "' and rmn_prefix='" + Prefix + "' and nvl(rmn_type,' ')='" + ReSetType + "'");
|
|
|
+ if (ReSetType != " ")
|
|
|
+ {
|
|
|
+ dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (MaxNum + 1) + "'", "rmn_nrcode='" + (NrCode == "" ? "Default" : NrCode) + "' and nvl(rmn_type,' ')='" + ReSetType + "'");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (MaxNum + 1) + "'", "rmn_nrcode='" + (NrCode == "" ? "Default" : NrCode) + "' and rmn_prefix='" + Prefix + "'");
|
|
|
+ }
|
|
|
Pack_Click(sender, e);
|
|
|
return;
|
|
|
}
|