|
|
@@ -14,6 +14,7 @@ using System.Threading;
|
|
|
using System.IO;
|
|
|
using System.IO.Ports;
|
|
|
using UAS_LabelMachine.CustomControl;
|
|
|
+using System.Reflection;
|
|
|
|
|
|
namespace UAS_LabelMachine
|
|
|
{
|
|
|
@@ -114,7 +115,14 @@ namespace UAS_LabelMachine
|
|
|
|
|
|
public UAS_出货标签打印(string Master)
|
|
|
{
|
|
|
+ //设置窗体的双缓冲
|
|
|
+ this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint, true);
|
|
|
+ this.UpdateStyles();
|
|
|
InitializeComponent();
|
|
|
+ //利用反射设置DataGridView的双缓冲
|
|
|
+ Type dgvType = this.LabelInf.GetType();
|
|
|
+ PropertyInfo pi = dgvType.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
|
|
|
+ pi.SetValue(this.LabelInf, true, null);
|
|
|
Text = Text + "-" + Master;
|
|
|
}
|
|
|
|
|
|
@@ -142,8 +150,11 @@ namespace UAS_LabelMachine
|
|
|
adh = SystemInf.adh;
|
|
|
back_adh = SystemInf.back_adh;
|
|
|
CheckForIllegalCrossThreadCalls = false;
|
|
|
+ pi_inoutno.TableName = "prodinout";
|
|
|
+ pi_inoutno.Field = "pi_inoutno";
|
|
|
+ pi_inoutno.ValueField = "pi_inoutno";
|
|
|
+ pi_inoutno.Condition = "pi_class in('出货单','拨出单')";
|
|
|
pi_inoutno.Focus();
|
|
|
-
|
|
|
Point pt = new Point();
|
|
|
//禁止所有列的排序
|
|
|
foreach (DataGridViewColumn dgv in LabelInf.Columns)
|
|
|
@@ -162,7 +173,7 @@ namespace UAS_LabelMachine
|
|
|
OutBoxCapacity.Value = Properties.Settings.Default.OutboxCapacity;
|
|
|
asc.controllInitializeSize(this);
|
|
|
asc.controlAutoSize(this);
|
|
|
-
|
|
|
+ pi_inoutno.BringToFront();
|
|
|
//实例化打印进程
|
|
|
try
|
|
|
{
|
|
|
@@ -614,7 +625,7 @@ namespace UAS_LabelMachine
|
|
|
MessageLog.AppendText(msg + "\n");
|
|
|
string[] msgArr = msg.Split(back_sg_separator.Text.ToCharArray());
|
|
|
//如果包含则分隔符则需要解析,如果不包含则直接前端解析
|
|
|
- if (msg.Contains(back_sg_separator.Text))
|
|
|
+ if (!cu_print_checkonly.Checked)
|
|
|
{
|
|
|
//需要校验2项数据,完成校验后此项的值需要为2则表示校验成功
|
|
|
List<string> CheckItem = new List<string>();
|
|
|
@@ -890,6 +901,7 @@ namespace UAS_LabelMachine
|
|
|
if (SingleLabelCombox.Text != "")
|
|
|
{
|
|
|
SingleDoc = lbl.Documents.Open(ftpOperater.DownLoadTo + SingleLabelCombox.Text);
|
|
|
+ SingleDoc.Printer.SwitchTo(SingleLabelPrinter.Text);
|
|
|
SingleLabelParam = (DataTable)dh.ExecuteSql("select lp_name,lp_sql,lp_valuetype from label left join LABELPARAMETER on la_id= lp_laid where la_id=" + SingleLabelCombox.SelectedValue.ToString().Split('#')[0], "select");
|
|
|
}
|
|
|
sql.Clear();
|
|
|
@@ -915,6 +927,7 @@ namespace UAS_LabelMachine
|
|
|
if (MidLabelCombox.Text != "")
|
|
|
{
|
|
|
MidDoc = lbl.Documents.Open(ftpOperater.DownLoadTo + MidLabelCombox.Text);
|
|
|
+ MidDoc.Printer.SwitchTo(MidLabelPrinter.Text);
|
|
|
MidLabelParam = (DataTable)dh.ExecuteSql("select lp_name,lp_sql,lp_valuetype from label left join LABELPARAMETER on la_id= lp_laid where la_id=" + MidLabelCombox.SelectedValue.ToString().Split('#')[0], "select");
|
|
|
}
|
|
|
//缓存中盒参数
|
|
|
@@ -941,6 +954,7 @@ namespace UAS_LabelMachine
|
|
|
if (OutBoxCombox.Text != "")
|
|
|
{
|
|
|
OutBoxDoc = lbl.Documents.Open(ftpOperater.DownLoadTo + OutBoxCombox.Text);
|
|
|
+ OutBoxDoc.Printer.SwitchTo(OutBoxPrinter.Text);
|
|
|
OutLabelParam = (DataTable)dh.ExecuteSql("select lp_name,lp_sql,lp_valuetype from label left join LABELPARAMETER on la_id= lp_laid where la_id=" + OutBoxCombox.SelectedValue.ToString().Split('#')[0], "select");
|
|
|
}
|
|
|
//缓存外箱参数
|
|
|
@@ -1421,7 +1435,6 @@ namespace UAS_LabelMachine
|
|
|
MidDoc.Variables.FormVariables.Item(j + 1).Value = dr1[0]["lp_sql"].ToString();
|
|
|
}
|
|
|
}
|
|
|
- MidDoc.Printer.SwitchTo(MidLabelPrinter.Text);
|
|
|
MidDoc.PrintDocument();
|
|
|
}
|
|
|
|
|
|
@@ -1511,7 +1524,6 @@ namespace UAS_LabelMachine
|
|
|
OutBoxDoc.Variables.FormVariables.Item(j + 1).Value = dr1[0]["lp_sql"].ToString();
|
|
|
}
|
|
|
}
|
|
|
- OutBoxDoc.Printer.SwitchTo(OutBoxPrinter.Text);
|
|
|
OutBoxDoc.PrintDocument();
|
|
|
}
|
|
|
}
|
|
|
@@ -1702,7 +1714,7 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
if (LabelInf.Rows[e.RowIndex].Cells["pib_ifrecheck"].FormattedValue.ToString() == "True")
|
|
|
{
|
|
|
- if (LabelInf.Columns[e.ColumnIndex].Name == "pib_custbarcode")
|
|
|
+ if (LabelInf.Columns[e.ColumnIndex].Name == "pib_barcode")
|
|
|
{
|
|
|
SolidBrush solidBrush = new SolidBrush(Color.FromArgb(51, 153, 255));
|
|
|
e.Graphics.FillRectangle(Brushes.CadetBlue, e.CellBounds);
|
|
|
@@ -1760,6 +1772,14 @@ namespace UAS_LabelMachine
|
|
|
string close = MessageBox.Show(this.ParentForm, "是否注销", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
|
|
|
if (close.ToString() == "Yes")
|
|
|
{
|
|
|
+ if (FrontendCheck.IsOpen)
|
|
|
+ FrontendCheck.Close();
|
|
|
+ if (BackendCheck.IsOpen)
|
|
|
+ BackendCheck.Close();
|
|
|
+ if (PLC1.IsOpen)
|
|
|
+ PLC1.Close();
|
|
|
+ if (ManBackendCheck.IsOpen)
|
|
|
+ ManBackendCheck.Close();
|
|
|
Login login = new Login();
|
|
|
//注销的时候需要将拼接的连接字符串置空
|
|
|
DataHelper.DBConnectionString = null;
|
|
|
@@ -1913,69 +1933,7 @@ namespace UAS_LabelMachine
|
|
|
|
|
|
private void ButtonSetting_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
- ListButtonMenu.BringToFront();
|
|
|
- ListButtonMenu.Visible = true;
|
|
|
- }
|
|
|
-
|
|
|
- private void ListButtonMenu_SelectedIndexChanged(object sender, EventArgs e)
|
|
|
- {
|
|
|
- ListButtonMenu.Visible = false;
|
|
|
- switch (ListButtonMenu.SelectedItem.ToString())
|
|
|
- {
|
|
|
- case "采集策略设置":
|
|
|
- 采集策略_NEW form = new 采集策略_NEW();
|
|
|
- form.FormClosed += Form_FormClosed;
|
|
|
- BaseUtil.SetFormCenter(form);
|
|
|
- form.ShowDialog();
|
|
|
- break;
|
|
|
- case "生成条码":
|
|
|
- 生成条码 form3 = new 生成条码(pi_inoutno.Text);
|
|
|
- form3.FormClosed += Form_FormClosed;
|
|
|
- BaseUtil.SetFormCenter(form3);
|
|
|
- form3.ShowDialog();
|
|
|
- break;
|
|
|
- case "附加信息设置":
|
|
|
- if (pi_cardcode.Text != "")
|
|
|
- {
|
|
|
- 附件内容打印 att = new 附件内容打印(pi_cardcode.Text);
|
|
|
- att.FormClosed += Attach_Closed;
|
|
|
- att.ShowDialog();
|
|
|
- }
|
|
|
- else MessageBox.Show("请先获取出库单信息");
|
|
|
- break;
|
|
|
- case "客户标签维护":
|
|
|
- 客户标签维护 form1 = new 客户标签维护();
|
|
|
- form1.FormClosed += Form_FormClosed;
|
|
|
- BaseUtil.SetFormCenter(form1);
|
|
|
- if (SingleDoc != null)
|
|
|
- SingleDoc.Close();
|
|
|
- if (MidDoc != null)
|
|
|
- MidDoc.Close();
|
|
|
- if (OutBoxDoc != null)
|
|
|
- OutBoxDoc.Close();
|
|
|
- form1.FormClosed += LabelFormClose;
|
|
|
- form1.ShowDialog();
|
|
|
- break;
|
|
|
- case "客户采集规则":
|
|
|
- CustomerRule cust = new CustomerRule();
|
|
|
- cust.FormClosed += Form_FormClosed;
|
|
|
- BaseUtil.SetFormCenter(cust);
|
|
|
- cust.ShowDialog();
|
|
|
- break;
|
|
|
- case "参数配置":
|
|
|
- ParamSetting form2 = new ParamSetting();
|
|
|
- form2.FormClosed += Form_FormClosed;
|
|
|
- BaseUtil.SetFormCenter(form2);
|
|
|
- form2.ShowDialog();
|
|
|
- break;
|
|
|
- case "权限管理":
|
|
|
- PowerSetting pws = new PowerSetting();
|
|
|
- BaseUtil.SetFormCenter(pws);
|
|
|
- pws.ShowDialog();
|
|
|
- break;
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
+ LogMenu.Show(new Point(ButtonSetting.Location.X, ButtonSetting.Location.Y + 20));
|
|
|
}
|
|
|
|
|
|
private void Form_FormClosed(object sender, FormClosedEventArgs e)
|
|
|
@@ -2031,7 +1989,7 @@ namespace UAS_LabelMachine
|
|
|
private void PLCStart_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
//查询前端检验的端口号
|
|
|
- DataTable dt = (DataTable)adh.ExecuteSql("select * from cominfo", "select");
|
|
|
+ DataTable dt = (DataTable)adh.ExecuteSql("select comtype,BaudRate,com,datawait,outtime from cominfo", "select");
|
|
|
DataRow[] dr = dt.Select("comtype='PLC1'");
|
|
|
if (dr.Length > 0)
|
|
|
{
|
|
|
@@ -2348,6 +2306,7 @@ namespace UAS_LabelMachine
|
|
|
{
|
|
|
dh.ExecuteSql("delete from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "'", "delete");
|
|
|
adh.ExecuteSql("delete from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "'", "delete");
|
|
|
+ LoadGridData();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -2370,171 +2329,176 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
}
|
|
|
catch (Exception) { }
|
|
|
- int outboxcode1 = int.Parse(Process_midboxcode.Text == "" ? "1" : Process_midboxcode.Text);
|
|
|
- int outboxcode2 = int.Parse(Process_outboxcode.Text == "" ? "1" : Process_outboxcode.Text);
|
|
|
+ int outboxcode1 = Outbox1;
|
|
|
+ int outboxcode2 = Outbox2;
|
|
|
string pd_id = LabelInf.Rows[CurrentRowIndex].Cells["pd_id"].Value.ToString();
|
|
|
//如果满容量获取过箱号就不再重复获取了
|
|
|
- bool GetBarcode = false;
|
|
|
+ //bool GetBarcode = false;
|
|
|
//获取当前的行号
|
|
|
- int CurrentRowNum = int.Parse(LabelInf.Rows[CurrentRowIndex].Cells["rownum"].Value.ToString());
|
|
|
+ decimal CurrentRowNum = decimal.Parse(LabelInf.Rows[CurrentRowIndex].Cells["rownum"].Value.ToString());
|
|
|
//超过中盒容量中盒号+1
|
|
|
if (adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1=" + outboxcode1) >= MidBoxCapacity.Value)
|
|
|
{
|
|
|
outboxcode1 = outboxcode1 + 1;
|
|
|
- GetBarcode = true;
|
|
|
- LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
|
|
|
- LogicHandler.SendDataToPLC(PLC1, PLCInstruct.MaterialTray, adh);
|
|
|
+ //GetBarcode = true;
|
|
|
+ //LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
+ //LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
|
|
|
+ //LogicHandler.SendDataToPLC(PLC1, PLCInstruct.MaterialTray, adh);
|
|
|
}
|
|
|
else if (CurrentRowNum - 1 > 0)
|
|
|
{
|
|
|
//获取上一行的数据
|
|
|
DataTable LastRowData = (DataTable)adh.ExecuteSql("select pib_lotno,pib_custmidboxcode,pib_custoutboxcode,pd_pocode,pd_custprodcode,pd_custprodspec,pib_datecode from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and rownum=" + (CurrentRowNum - 1), "select");
|
|
|
- string custmidboxcode = LastRowData.Rows[0]["pib_custmidboxcode"].ToString();
|
|
|
- if (custmidboxcode == "")
|
|
|
- {
|
|
|
- LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
|
|
|
- }
|
|
|
+ //string custmidboxcode = LastRowData.Rows[0]["pib_custmidboxcode"].ToString();
|
|
|
+ //if (custmidboxcode == "")
|
|
|
+ //{
|
|
|
+ // LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
+ // LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
|
|
|
+ //}
|
|
|
//或者不符合合并条件中盒号+1
|
|
|
if (cu_print_midlotno.Checked)
|
|
|
{
|
|
|
string TempData = LastRowData.Rows[0]["pib_lotno"].ToString();
|
|
|
- if (TempData != "" && TempData != LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value.ToString() && !GetBarcode)
|
|
|
+ if (TempData != "" && TempData != LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value.ToString()/* /* && !GetBarcode/)
|
|
|
{
|
|
|
- LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
- LogicHandler.SendDataToPLC(PLC1, PLCInstruct.MaterialTray, adh);
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
|
|
|
+ //LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
+ //LogicHandler.SendDataToPLC(PLC1, PLCInstruct.MaterialTray, adh);
|
|
|
+ //LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
|
|
|
outboxcode1 = outboxcode1 + 1;
|
|
|
}
|
|
|
}
|
|
|
else if (cu_print_midpo.Checked)
|
|
|
{
|
|
|
string TempData = LastRowData.Rows[0]["pd_pocode"].ToString();
|
|
|
- if (TempData != "" && TempData != LabelInf.Rows[CurrentRowIndex].Cells["pd_pocode"].Value.ToString() && !GetBarcode)
|
|
|
+ if (TempData != "" && TempData != LabelInf.Rows[CurrentRowIndex].Cells["pd_pocode"].Value.ToString() /* && !GetBarcode*/)
|
|
|
{
|
|
|
- LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
- LogicHandler.SendDataToPLC(PLC1, PLCInstruct.MaterialTray, adh);
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
|
|
|
+ //LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
+ //LogicHandler.SendDataToPLC(PLC1, PLCInstruct.MaterialTray, adh);
|
|
|
+ //LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
|
|
|
outboxcode1 = outboxcode1 + 1;
|
|
|
}
|
|
|
}
|
|
|
else if (cu_print_midprod.Checked)
|
|
|
{
|
|
|
string TempData = LastRowData.Rows[0]["pd_custprodcode"].ToString();
|
|
|
- if (TempData != "" && TempData != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodcode"].Value.ToString() && !GetBarcode)
|
|
|
+ if (TempData != "" && TempData != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodcode"].Value.ToString() /* && !GetBarcode*/)
|
|
|
{
|
|
|
- LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
- LogicHandler.SendDataToPLC(PLC1, PLCInstruct.MaterialTray, adh);
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
|
|
|
+ //LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
+ //LogicHandler.SendDataToPLC(PLC1, PLCInstruct.MaterialTray, adh);
|
|
|
+ //LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
|
|
|
outboxcode1 = outboxcode1 + 1;
|
|
|
}
|
|
|
}
|
|
|
else if (cu_print_midspec.Checked)
|
|
|
{
|
|
|
string TempData = LastRowData.Rows[0]["pd_custprodspec"].ToString();
|
|
|
- if (TempData != "" && TempData != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodspec"].Value.ToString() && !GetBarcode)
|
|
|
+ if (TempData != "" && TempData != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodspec"].Value.ToString() /* && !GetBarcode*/)
|
|
|
{
|
|
|
- LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
- LogicHandler.SendDataToPLC(PLC1, PLCInstruct.MaterialTray, adh);
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
|
|
|
+ //LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
+ //LogicHandler.SendDataToPLC(PLC1, PLCInstruct.MaterialTray, adh);
|
|
|
+ //LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
|
|
|
outboxcode1 = outboxcode1 + 1;
|
|
|
}
|
|
|
}
|
|
|
else if (cu_print_middc.Checked)
|
|
|
{
|
|
|
string TempData = LastRowData.Rows[0]["pib_datecode"].ToString();
|
|
|
- if (TempData != "" && TempData != LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value.ToString() && !GetBarcode)
|
|
|
+ if (TempData != "" && TempData != LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value.ToString() /* && !GetBarcode*/)
|
|
|
{
|
|
|
- LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
- LogicHandler.SendDataToPLC(PLC1, PLCInstruct.MaterialTray, adh);
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
|
|
|
+ //LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
+ //LogicHandler.SendDataToPLC(PLC1, PLCInstruct.MaterialTray, adh);
|
|
|
+ //LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
|
|
|
outboxcode1 = outboxcode1 + 1;
|
|
|
}
|
|
|
}
|
|
|
- if (LastRowData.Rows[0]["pib_custmidboxcode"].ToString() == MidBoxBarCode)
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = LastRowData.Rows[0]["pib_custmidboxcode"].ToString();
|
|
|
- else
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
|
|
|
+ //if (LastRowData.Rows[0]["pib_custmidboxcode"].ToString() == MidBoxBarCode)
|
|
|
+ // LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = LastRowData.Rows[0]["pib_custmidboxcode"].ToString();
|
|
|
+ //else
|
|
|
+ // LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
|
|
|
+ //LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
+ //LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
|
|
|
}
|
|
|
- GetBarcode = false;
|
|
|
+ //GetBarcode = false;
|
|
|
if (adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2=" + outboxcode2) >= OutBoxCapacity.Value)
|
|
|
{
|
|
|
- GetBarcode = true;
|
|
|
+ //GetBarcode = true;
|
|
|
outboxcode2 = outboxcode2 + 1;
|
|
|
- LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
+ //LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
|
|
|
+ //LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
}
|
|
|
else if (CurrentRowNum - 1 > 0)
|
|
|
{
|
|
|
//获取上一行数据
|
|
|
DataTable LastRowData = (DataTable)adh.ExecuteSql("select pib_lotno,pib_custmidboxcode,pib_custoutboxcode,pd_pocode,pd_custprodcode,pd_custprodspec,pib_datecode from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and rownum=" + (CurrentRowNum - 1), "select");
|
|
|
- string custoutboxcode = LastRowData.Rows[0]["pib_custoutboxcode"].ToString();
|
|
|
- if (custoutboxcode == "")
|
|
|
- {
|
|
|
- LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
- }
|
|
|
+ //string custoutboxcode = LastRowData.Rows[0]["pib_custoutboxcode"].ToString();
|
|
|
+ //if (custoutboxcode == "")
|
|
|
+ //{
|
|
|
+ // LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
|
|
|
+ // LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
+ //}
|
|
|
//或者不符合合并条件中盒号+1
|
|
|
if (cu_print_outlotno.Checked)
|
|
|
{
|
|
|
string TempData = LastRowData.Rows[0]["pib_lotno"].ToString();
|
|
|
- if (TempData != "" && TempData != LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value.ToString() && !GetBarcode)
|
|
|
+ if (TempData != "" && TempData != LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value.ToString() /* && !GetBarcode*/)
|
|
|
{
|
|
|
- LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
+ //LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
|
|
|
+ //LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
+ outboxcode2 = outboxcode2 + 1;
|
|
|
}
|
|
|
}
|
|
|
else if (cu_print_outpo.Checked)
|
|
|
{
|
|
|
string TempData = LastRowData.Rows[0]["pd_pocode"].ToString();
|
|
|
- if (TempData != "" && TempData != LabelInf.Rows[CurrentRowIndex].Cells["pd_pocode"].Value.ToString() && !GetBarcode)
|
|
|
+ if (TempData != "" && TempData != LabelInf.Rows[CurrentRowIndex].Cells["pd_pocode"].Value.ToString() /* && !GetBarcode*/)
|
|
|
{
|
|
|
- LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
+ //LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
|
|
|
+ //LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
+ outboxcode2 = outboxcode2 + 1;
|
|
|
}
|
|
|
}
|
|
|
else if (cu_print_outprod.Checked)
|
|
|
{
|
|
|
string TempData = LastRowData.Rows[0]["pd_custprodcode"].ToString();
|
|
|
- if (TempData != "" && TempData != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodcode"].Value.ToString() && !GetBarcode)
|
|
|
+ if (TempData != "" && TempData != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodcode"].Value.ToString() /* && !GetBarcode*/)
|
|
|
{
|
|
|
- LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
+ //LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
|
|
|
+ //LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
+ outboxcode2 = outboxcode2 + 1;
|
|
|
}
|
|
|
}
|
|
|
else if (cu_print_outspec.Checked)
|
|
|
{
|
|
|
string TempData = LastRowData.Rows[0]["pd_custprodspec"].ToString();
|
|
|
- if (TempData != "" && TempData != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodspec"].Value.ToString() && !GetBarcode)
|
|
|
+ if (TempData != "" && TempData != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodspec"].Value.ToString() /* && !GetBarcode*/)
|
|
|
{
|
|
|
- LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
+ //LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
|
|
|
+ //LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
+ outboxcode2 = outboxcode2 + 1;
|
|
|
}
|
|
|
}
|
|
|
else if (cu_print_outdc.Checked)
|
|
|
{
|
|
|
string TempData = LastRowData.Rows[0]["pib_datecode"].ToString();
|
|
|
- if (TempData != "" && TempData != LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value.ToString() && !GetBarcode)
|
|
|
+ if (TempData != "" && TempData != LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value.ToString() /* && !GetBarcode*/)
|
|
|
{
|
|
|
- LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
+ //LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
|
|
|
+ //LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
+ outboxcode2 = outboxcode2 + 1;
|
|
|
}
|
|
|
}
|
|
|
- if (OutBoxBarCode == LastRowData.Rows[0]["pib_custoutboxcode"].ToString())
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = LastRowData.Rows[0]["pib_custoutboxcode"].ToString();
|
|
|
- else
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
+ //if (OutBoxBarCode == LastRowData.Rows[0]["pib_custoutboxcode"].ToString())
|
|
|
+ // LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = LastRowData.Rows[0]["pib_custoutboxcode"].ToString();
|
|
|
+ //else
|
|
|
+ // LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
|
|
|
- LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
+ //LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
|
|
|
+ //LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
|
|
|
}
|
|
|
//设置中盒外箱号
|
|
|
LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode1"].Value = outboxcode1;
|
|
|
@@ -2600,7 +2564,6 @@ namespace UAS_LabelMachine
|
|
|
SingleDoc.Variables.FormVariables.Item(j + 1).Value = dr1[0]["lp_sql"].ToString();
|
|
|
}
|
|
|
}
|
|
|
- SingleDoc.Printer.SwitchTo(SingleLabelPrinter.Text);
|
|
|
SingleDoc.PrintDocument();
|
|
|
LogicHandler.UpdateRowPrinted(pib_id);
|
|
|
}
|
|
|
@@ -2646,5 +2609,98 @@ namespace UAS_LabelMachine
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ int Outbox1;
|
|
|
+ int Outbox2;
|
|
|
+ private void Process_midboxcode_TextChanged(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ int.TryParse(Process_midboxcode.Text, out Outbox1);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void Process_outboxcode_TextChanged(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ int.TryParse(Process_outboxcode.Text, out Outbox2);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void LabelPrinter_UserOnSelectIndexChange(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ switch ((sender as Control).Parent.Name)
|
|
|
+ {
|
|
|
+ case "SingleLabelPrinter":
|
|
|
+ if (SingleDoc != null)
|
|
|
+ SingleDoc.Printer.SwitchTo(SingleLabelPrinter.Text);
|
|
|
+ break;
|
|
|
+ case "MidLabelPrinter":
|
|
|
+ if (MidDoc != null)
|
|
|
+ MidDoc.Printer.SwitchTo(MidLabelPrinter.Text);
|
|
|
+ break;
|
|
|
+ case "OutBoxPrinter":
|
|
|
+ if (OutBoxDoc != null)
|
|
|
+ OutBoxDoc.Printer.SwitchTo(OutBoxLabelPrint.Text);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void LogMenu_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
|
|
|
+ {
|
|
|
+ switch (e.ClickedItem.Text)
|
|
|
+ {
|
|
|
+ case "采集策略设置":
|
|
|
+ 采集策略_NEW form = new 采集策略_NEW();
|
|
|
+ form.FormClosed += Form_FormClosed;
|
|
|
+ BaseUtil.SetFormCenter(form);
|
|
|
+ form.ShowDialog();
|
|
|
+ break;
|
|
|
+ case "生成条码":
|
|
|
+ 生成条码 form3 = new 生成条码(pi_inoutno.Text);
|
|
|
+ form3.FormClosed += Form_FormClosed;
|
|
|
+ BaseUtil.SetFormCenter(form3);
|
|
|
+ form3.ShowDialog();
|
|
|
+ break;
|
|
|
+ case "附加信息设置":
|
|
|
+ if (pi_cardcode.Text != "")
|
|
|
+ {
|
|
|
+ 附件内容打印 att = new 附件内容打印(pi_cardcode.Text);
|
|
|
+ att.FormClosed += Attach_Closed;
|
|
|
+ att.ShowDialog();
|
|
|
+ }
|
|
|
+ else MessageBox.Show("请先获取出库单信息");
|
|
|
+ break;
|
|
|
+ case "客户标签维护":
|
|
|
+ 客户标签维护 form1 = new 客户标签维护();
|
|
|
+ form1.FormClosed += Form_FormClosed;
|
|
|
+ BaseUtil.SetFormCenter(form1);
|
|
|
+ if (SingleDoc != null)
|
|
|
+ SingleDoc.Close();
|
|
|
+ if (MidDoc != null)
|
|
|
+ MidDoc.Close();
|
|
|
+ if (OutBoxDoc != null)
|
|
|
+ OutBoxDoc.Close();
|
|
|
+ form1.FormClosed += LabelFormClose;
|
|
|
+ form1.ShowDialog();
|
|
|
+ break;
|
|
|
+ case "客户采集规则":
|
|
|
+ CustomerRule cust = new CustomerRule();
|
|
|
+ cust.FormClosed += Form_FormClosed;
|
|
|
+ BaseUtil.SetFormCenter(cust);
|
|
|
+ cust.ShowDialog();
|
|
|
+ break;
|
|
|
+ case "参数配置":
|
|
|
+ ParamSetting form2 = new ParamSetting();
|
|
|
+ form2.FormClosed += Form_FormClosed;
|
|
|
+ BaseUtil.SetFormCenter(form2);
|
|
|
+ form2.ShowDialog();
|
|
|
+ break;
|
|
|
+ case "权限管理":
|
|
|
+ PowerSetting pws = new PowerSetting();
|
|
|
+ BaseUtil.SetFormCenter(pws);
|
|
|
+ pws.ShowDialog();
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|