@ -10,6 +10,7 @@ using System.Text;
using System.Threading.Tasks ;
using System.Windows.Forms ;
using grproLib ;
using MESClassLibrary ;
using MESClassLibrary.BLL ;
using MESClassLibrary.BLL.BasicInfo ;
using MESClassLibrary.BLL.Injection ;
@ -31,6 +32,7 @@ namespace InjectionSearch
private BarCodeBLL _ bll = new BarCodeBLL ( ) ;
private WmsBLL _ wmsBll = new WmsBLL ( ) ;
private string _l astBoxNo = string . Empty ;
private BarCodeBLL _ barCodeBLL = new BarCodeBLL ( ) ;
public FrmBarCodeSearch2408 ( )
{
InitializeComponent ( ) ;
@ -138,9 +140,9 @@ namespace InjectionSearch
comboBox2 . Items . Add ( "IM19" ) ;
comboBox2 . Items . Add ( "IM20" ) ;
GetClass ( ) ;
textBox3 . Text = Program . ProductDate . Substring ( 2 , 2 ) + Program . ProductDate . Substring ( 5 , 2 ) +
Program . ProductDate . Substring ( 8 , 2 ) ; //批次
//textBox3.Text = Program.ProductDate.Substring(2, 2) + Program.ProductDate.Substring(5, 2) +
// Program.ProductDate.Substring(8, 2); //批次
textBox3 . Text = GetBatch ( true ) ;
//comBoxSizeL.DataSource = _basicBLL1.GetPackageSize();
//comBoxSizeL.DisplayMember = "describe";
//comBoxSizeL.ValueMember = "Count";
@ -177,101 +179,7 @@ namespace InjectionSearch
}
}
//private void label18_Click(object sender, EventArgs e)
//{
// string code = "",name="";
// BarCodeModel md = new BarCodeModel();
// BarCodeBLL bll = new BarCodeBLL();
// ProductBLL pbll=new ProductBLL();
// string filename = "", partNo = "", OneCode="";
// try
// {
// if (glacialList1.SelectedItems.Count == 0)
// {
// MessageBox.Show("请选择要补打的条码!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
// return;
// }
// else
// {
// GlacialComponents.Controls.GLItem gv;
// gv = glacialList1.SelectedItems[0] as GlacialComponents.Controls.GLItem;
// code = gv.Text;
// string[] aa = code.Split('.');
// partNo = aa[0];
// DataTable dt = bll.SearchInfoByBarCode(code);
// if (dt != null && dt.Rows.Count > 0)
// {
// name = dt.Rows[0]["ProductName"].ToString();
// md.ID = Guid.NewGuid().ToString();
// md.BarCode = code;
// md.StationID = Program.StationID;
// md.StockNo = dt.Rows[0]["StockNo"].ToString();
// md.OneBarCode = dt.Rows[0]["OneBarCode"].ToString();
// md.StationID2 = dt.Rows[0]["StationID"].ToString();
// md.PrintType = 2;
// DataTable pdt = pbll.SearchIsImportByStockNo(md.StockNo);
// if (pdt != null && pdt.Rows.Count > 0)
// {
// if (pdt.Rows[0]["isImport"].ToString() == "1")
// {
// md.Import = "国产料Kingfa";
// }
// else
// {
// md.Import = "";
// }
// }
// }
// //if (bll.Add_Info_New(md, "tb_BarCode5") == false)
// //{
// // return;
// //}
// if (SaveBarCode(md, "tb_BarCode5", false) == false)
// {
// return;
// }
// #region 打印条码
// PlasticBLL plbll = new PlasticBLL();
// //filename = System.AppDomain.CurrentDomain.BaseDirectory + "单个条码.grf";
// filename = System.AppDomain.CurrentDomain.BaseDirectory + PrintMoudleName();
// DataTable headTable = new DataTable();
// headTable.Columns.Add("PrintTime");
// headTable.Columns.Add("PartNo");
// headTable.Columns.Add("PartName");
// headTable.Columns.Add("OneBarCode");
// headTable.Columns.Add("BarCode");
// DataRow row = headTable.NewRow();
// row["PrintTime"] = GetDateTime().ToString("yyyy/MM/dd HH:mm:ss");
// row["PartNo"] = partNo;
// row["PartName"] = name;
// row["OneBarCode"] = md.OneBarCode;
// row["BarCode"] = code;
// string reportName = ConfigurationManager.AppSettings["Printer1"].ToString();
// headTable.Rows.Add(row);
// ReportHelper rp = new ReportHelper(filename, headTable, null, (int)GRPaperOrientation.grpoDefault, 1, reportName);
// rp.Report.Print(false);
// #endregion
// initBarCode();
// }
// }
// catch (Exception ex)
// {
// LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
// }
//}
public DateTime GetDateTime ( )
{
@ -453,7 +361,7 @@ namespace InjectionSearch
}
else
{
packageCode = lbPackageCodeL . Text . Trim ( ) ;
lbPackageCodeL . Text = packageCode ;
}
if ( string . IsNullOrEmpty ( packageCode ) )
{
@ -506,12 +414,13 @@ namespace InjectionSearch
//}
if ( SaveBarCode ( md , "tb_BarCode5" , i = = Convert . ToInt32 ( textBox4 . Text . Trim ( ) ) ) = = false )
{
return ;
LogErrBLL . AddInfo ( "手动批量打印条码" + md . OneBarCode + "报错" , MethodBase . GetCurrentMethod ( ) ) ;
//return;
}
#region 214TrunkBox存入质检表
if ( partNo = = "A2146106203kz" )
if ( partNo = = "A2146106203kz" )
{
tb_Inspection_tx imd = new tb_Inspection_tx ( ) ;
InspectionBLL ibll = new InspectionBLL ( ) ;
@ -530,7 +439,7 @@ namespace InjectionSearch
#region 打印条码
//filename = System.AppDomain.CurrentDomain.BaseDirectory + "单个条码.grf";
filename = System . AppDomain . CurrentDomain . BaseDirectory + PrintMoudleName ( ) ;
filename = System . AppDomain . CurrentDomain . BaseDirectory + PrintMoudleName ( "0" ) ;
DataTable headTable = new DataTable ( ) ;
headTable . Columns . Add ( "PrintTime" ) ;
headTable . Columns . Add ( "PartNo" ) ;
@ -556,183 +465,6 @@ namespace InjectionSearch
}
}
#region 原有打印代码
//DataTable dt = bll.SearchSerialNoByBarCodeNew(partNo + "." + textBox3.Text.Trim(),"");
//if (dt != null && dt.Rows.Count > 0)
//{
// OneCode = dt.Rows[0]["OneBarCode"].ToString().Trim();
// code = dt.Rows[0]["BarCode"].ToString().TrimEnd();
// for (int i = 1; i <= Convert.ToInt32(textBox4.Text.Trim()); i++)
// {
// //newcode = code.Substring(0, code.Length - 4) +
// // (Convert.ToInt32(code.Substring(code.Length - 4, 4)) + i)
// // .ToString()
// // .PadLeft(4, '0');
// //NewOneCode = OneCode.Substring(0, OneCode.Length - 4) +
// // (Convert.ToInt32(OneCode.Substring(OneCode.Length - 4, 4)) + i).ToString()
// // .PadLeft(4, '0');
// GetSjBarCode(stockNo, partNo, ref NewOneCode, ref newcode);
// string[] part = newcode.Split('.');
// //存入tb_BarCode表
// md.ID = Guid.NewGuid().ToString();
// md.StationID = Program.StationID;
// md.StationID2 = stationID;
// md.StockNo = stockNo;
// md.OneBarCode = NewOneCode;
// md.BarCode = newcode;
// md.PrintType = 1;
// md.PartNo = partNo;
// md.PlanID = planID;
// md.ProductNature = ProductNature;
// DataTable pdt = pbll.SearchIsImportByStockNo(stockNo);
// if (pdt != null && pdt.Rows.Count > 0)
// {
// PartName = pdt.Rows[0]["ProductName"].ToString();
// if (pdt.Rows[0]["isImport"].ToString() == "1")
// {
// md.Import = "国产料Kingfa";
// }
// else
// {
// md.Import = "";
// }
// }
// if (bll.Add_Info_New(md, "tb_BarCode5") == false)
// {
// return;
// }
// #region 214TrunkBox存入质检表
// if (partNo == "A2146106203kz")
// {
// tb_Inspection_tx imd = new tb_Inspection_tx();
// InspectionBLL ibll = new InspectionBLL();
// imd.BarCode = NewOneCode;
// imd.IsOK =1;
// imd.Station = 1;
// ibll.AddInfo(imd);
// }
// #endregion
// if (IsPrint == "1")
// {
// #region 打印条码
// filename = System.AppDomain.CurrentDomain.BaseDirectory + "单个条码.grf";
// DataTable headTable = new DataTable();
// headTable.Columns.Add("PrintTime");
// headTable.Columns.Add("PartNo");
// headTable.Columns.Add("PartName");
// headTable.Columns.Add("OneBarCode");
// headTable.Columns.Add("BarCode");
// DataRow row = headTable.NewRow();
// row["PrintTime"] = GetDateTime().ToString("yyyy/MM/dd HH:mm:ss");
// row["PartNo"] = partNo;
// row["PartName"] = PartName;
// row["OneBarCode"] = NewOneCode;
// row["BarCode"] = newcode;
// string reportName = ConfigurationManager.AppSettings["Printer1"].ToString();
// headTable.Rows.Add(row);
// ReportHelper rp = new ReportHelper(filename, headTable, null, (int)GRPaperOrientation.grpoDefault, 1, reportName);
// rp.Report.Print(false);
// #endregion
// }
// }
//}
//else
//{
// for (int i = 1; i <= Convert.ToInt32(textBox4.Text.Trim()); i++)
// {
// newcode = partNo + "." + textBox3.Text.Trim() + "." + i.ToString().PadLeft(4, '0');
// NewOneCode = stockNo + textBox3.Text.Trim() + i.ToString().PadLeft(4, '0');
// string[] part = newcode.Split('.');
// //存入tb_BarCode表
// md.ID = Guid.NewGuid().ToString();
// md.StationID = Program.StationID;
// md.StationID2 = stationID;
// md.StockNo = stockNo;
// md.OneBarCode = NewOneCode;
// md.BarCode = newcode;
// md.PrintType = 1;
// md.PartNo = partNo;
// md.PlanID = planID;
// md.ProductNature = ProductNature;
// DataTable pdt = pbll.SearchIsImportByStockNo(stockNo);
// if (pdt != null && pdt.Rows.Count > 0)
// {
// PartName = pdt.Rows[0]["ProductName"].ToString();
// if (pdt.Rows[0]["isImport"].ToString() == "1")
// {
// md.Import = "国产料Kingfa";
// }
// else
// {
// md.Import = "";
// }
// }
// if (bll.Add_Info_New(md, "tb_BarCode5") == false)
// {
// return;
// }
// #region 214TrunkBox存入质检表
// if (partNo == "A2146106203kz")
// {
// tb_Inspection_tx imd = new tb_Inspection_tx();
// InspectionBLL ibll = new InspectionBLL();
// imd.BarCode = NewOneCode;
// imd.IsOK = 1;
// imd.Station = 1;
// ibll.AddInfo(imd);
// }
// #endregion
// if (IsPrint == "1")
// {
// #region 打印条码
// filename = System.AppDomain.CurrentDomain.BaseDirectory + "单个条码.grf";
// DataTable headTable = new DataTable();
// headTable.Columns.Add("PrintTime");
// headTable.Columns.Add("PartNo");
// headTable.Columns.Add("PartName");
// headTable.Columns.Add("OneBarCode");
// headTable.Columns.Add("BarCode");
// DataRow row = headTable.NewRow();
// row["PrintTime"] = GetDateTime().ToString("yyyy/MM/dd HH:mm:ss");
// row["PartNo"] = partNo;
// row["PartName"] = PartName;
// row["OneBarCode"] = NewOneCode;
// row["BarCode"] = newcode;
// string reportName = ConfigurationManager.AppSettings["Printer1"].ToString();
// headTable.Rows.Add(row);
// ReportHelper rp = new ReportHelper(filename, headTable, null, (int)GRPaperOrientation.grpoDefault, 1, reportName);
// rp.Report.Print(false);
// #endregion
// }
// }
//}
#endregion
}
#endregion
@ -760,6 +492,15 @@ namespace InjectionSearch
MessageBox . Show ( "箱单生成失败,请重新操作!" ) ;
return ;
}
else
{
lbPackageCodeL . Text = packageCode ;
}
if ( string . IsNullOrEmpty ( packageCode ) )
{
MessageBox . Show ( "箱单生成失败,请重新操作!" ) ;
return ;
}
}
else
{
@ -813,7 +554,8 @@ namespace InjectionSearch
//}
if ( SaveBarCode ( md , "tb_BarCode5" , i = = Convert . ToInt32 ( textBox4 . Text . Trim ( ) ) ) = = false )
{
return ;
LogErrBLL . AddInfo ( "手动批量打印条码" + md . OneBarCode + "报错" , MethodBase . GetCurrentMethod ( ) ) ;
//return;
}
#endregion
@ -823,7 +565,7 @@ namespace InjectionSearch
#region 打印条码
//filename = System.AppDomain.CurrentDomain.BaseDirectory + "单个条码1.grf";
filename = System . AppDomain . CurrentDomain . BaseDirectory + PrintMoudleName ( ) ;
filename = System . AppDomain . CurrentDomain . BaseDirectory + PrintMoudleName ( "1" ) ;
DataTable headTable = new DataTable ( ) ;
headTable . Columns . Add ( "PrintTime" ) ;
@ -850,156 +592,6 @@ namespace InjectionSearch
}
}
#region 原来打印代码
//DataTable dt = bll.SearchSerialNoByBarCodeNew1(partNo + "#" + QLevel + "#" + textBox3.Text.Trim() + "#");
//if (dt != null && dt.Rows.Count > 0)
//{
// code = dt.Rows[0]["BarCode"].ToString().Trim();
// for (int i = 1; i <= Convert.ToInt32(textBox2.Text.Trim()); i++)
// {
// newcode = code.Substring(0, code.Length - 4) +
// (Convert.ToInt32(code.Substring(23, 3)) +
// i).ToString()
// .PadLeft(3, '0') + "#";
// #region 插入数据tb_barCode
// md.ID = Guid.NewGuid().ToString();
// md.StationID = Program.StationID;
// md.StationID2 = stationID;
// md.StockNo = stockNo;
// md.OneBarCode = "";
// md.BarCode = newcode;
// md.PrintType = 1;
// md.PartNo = partNo;
// md.PlanID = planID;
// md.ProductNature = ProductNature;
// DataTable dt2 = pbll.SearchIsImportByPartNo(partNo);
// if (dt2 != null && dt2.Rows.Count > 0)
// {
// if (dt2.Rows[0]["isImport"].ToString() == "1")
// {
// md.Import = "国产料Kingfa";
// }
// else
// {
// md.Import = "";
// }
// }
// if (bll.Add_Info_New(md, "tb_BarCode5") == false)
// {
// return;
// }
// #endregion
// if (IsPrint == "1")
// {
// #region 打印条码
// filename = System.AppDomain.CurrentDomain.BaseDirectory +
// "单个条码1.grf";
// DataTable headTable = new DataTable();
// headTable.Columns.Add("PrintTime");
// headTable.Columns.Add("PartNo");
// headTable.Columns.Add("PartName");
// headTable.Columns.Add("OneBarCode");
// headTable.Columns.Add("BarCode");
// DataRow row = headTable.NewRow();
// row["PrintTime"] = GetDateTime().ToString("yyyy/MM/dd HH:mm:ss");
// row["PartNo"] = partNo;
// row["PartName"] = PartName;
// row["OneBarCode"] = NewOneCode;
// row["BarCode"] = newcode;
// string reportName = ConfigurationManager.AppSettings["Printer1"].ToString();
// headTable.Rows.Add(row);
// ReportHelper rp = new ReportHelper(filename, headTable, null, (int)GRPaperOrientation.grpoDefault, 1, reportName);
// rp.Report.Print(false);
// #endregion
// }
// }
//}
//else
//{
// for (int i = 1; i <= Convert.ToInt32(textBox4.Text.Trim()); i++)
// {
// newcode = partNo + "#" + QLevel + "#" + textBox3.Text.Trim() + "#" +
// i.ToString().PadLeft(3, '0') + "#";
// NewOneCode = "";
// string[] part = newcode.Split('.');
// #region 存入tb_BarCode表
// md.ID = Guid.NewGuid().ToString();
// md.StationID = Program.StationID;
// md.StationID2 = stationID;
// md.StockNo = stockNo;
// md.OneBarCode = NewOneCode;
// md.BarCode = newcode;
// md.PrintType = 1;
// md.PartNo = partNo;
// md.PlanID = planID;
// md.ProductNature = ProductNature;
// DataTable pdt = pbll.SearchIsImportByStockNo(stockNo);
// if (pdt != null && pdt.Rows.Count > 0)
// {
// if (pdt.Rows[0]["isImport"].ToString() == "1")
// {
// md.Import = "国产料Kingfa";
// }
// else
// {
// md.Import = "";
// }
// }
// if (bll.Add_Info_New(md, "tb_BarCode5") == false)
// {
// return;
// }
// #endregion
// if (IsPrint == "1")
// {
// #region 打印条码
// filename = System.AppDomain.CurrentDomain.BaseDirectory +
// "单个条码1.grf";
// DataTable headTable = new DataTable();
// headTable.Columns.Add("PrintTime");
// headTable.Columns.Add("PartNo");
// headTable.Columns.Add("PartName");
// headTable.Columns.Add("OneBarCode");
// headTable.Columns.Add("BarCode");
// DataRow row = headTable.NewRow();
// row["PrintTime"] = GetDateTime().ToString("yyyy/MM/dd HH:mm:ss");
// row["PartNo"] = partNo;
// row["PartName"] = PartName;
// row["OneBarCode"] = NewOneCode;
// row["BarCode"] = newcode;
// string reportName = ConfigurationManager.AppSettings["Printer1"].ToString();
// headTable.Rows.Add(row);
// ReportHelper rp = new ReportHelper(filename, headTable, null, (int)GRPaperOrientation.grpoDefault, 1, reportName);
// rp.Report.Print(false);
// #endregion
// }
// }
//}
#endregion
}
#endregion
@ -1036,6 +628,7 @@ namespace InjectionSearch
boxmd . Mould = "2" ;
boxmd . StandardQty = packageSize . ToString ( ) ;
//生成后先存上
if ( _ injectionBoxBLL . AddInfo ( boxmd ) )
{
this . lbPackageCodeL . Text = packageCode ;
@ -1043,60 +636,178 @@ namespace InjectionSearch
}
return null ;
}
bool SaveBarCode ( BarCodeModel bcm , string tableName , bool printBox )
private BarCodeModel _l astFailedModel = null ;
bool SaveBarCode ( BarCodeModel bcm , string tableName , bool printBox )
{
bool saveRst = false ;
if ( _l astFailedModel ! = null )
{
Save ( _l astFailedModel , tableName , printBox ) ;
_l astFailedModel = null ;
}
if ( cboxHandBox . Checked )
{
saveRst = _ bll . Add_Info_New ( bcm , "tb_BarCode5" ) ;
if ( saveRst = = true )
Save ( bcm , tableName , printBox ) ;
//if (cboxHandBox.Checked)
//{
// bool isSuccess = false;
// DataTable boxTable = null;
// int realCount = 0;
// int sizeCount = 0;
// LocalDBService local = new LocalDBService(SqlHelper.GetConnSting());
// try
// {
// local.BeginTrans();
// saveRst = _bll.Add_Info_New(local, bcm, "tb_BarCode5", "5");
// if (_injectionBoxBLL.UpdateBoxCount(local, bcm.BoxNo, 1))
// {
// boxTable = _injectionBoxBLL.SearchBox(bcm.BoxNo);
// if (boxTable.Rows.Count > 0)
// {
// string realCountStr = boxTable.Rows[0]["BoxCount"].ToString();
// int.TryParse(realCountStr, out realCount);
// int.TryParse(comBoxSizeL.SelectedValue?.ToString(), out sizeCount);
// if ((realCount != 0 && realCount == sizeCount) || printBox == true)
// {
// _wmsBll.SaveInterface(local, bcm, "", comboBox2.Text.Trim());
// isSuccess = true;
// }
// }
// }
// local.Commit();
// }
// catch (Exception ex)
// {
// if (local != null)
// {
// local.Rollback();
// }
// LogErrBLL.AddInfo("手动批量打印条码" + bcm.OneBarCode + "报错", MethodBase.GetCurrentMethod());
// _lastFailedModel = bcm;
// }
// finally
// {
// if (local != null)
// {
// local.EndTrans();
// }
// }
// //保存后打印箱单
// if (isSuccess)
// {
// //打印箱码
// PrintBoxCode(boxTable.Rows[0], realCount, false);
// _lastBoxNo = lbPackageCodeL.Text;
// lbPackageCodeL.Text = "";
// }
//}
}
else
{
try
{
if ( _ injectionBoxBLL . UpdateBoxCount ( bcm . BoxNo , 1 ) )
saveRst = _ bll . Add_Info_New ( bcm , "tb_BarCode5" , "5" ) ;
if ( saveRst = = false )
{
DataTable dt = _ injectionBoxBLL . SearchBox ( bcm . BoxNo ) ;
if ( dt . Rows . Count > 0 )
_l astFailedModel = bcm ;
}
}
catch ( Exception ex )
{
_l astFailedModel = bcm ;
}
}
return saveRst ;
}
void Save ( BarCodeModel bcm , string tableName , bool printBox )
{
bool saveRst = false ;
if ( cboxHandBox . Checked )
{
bool isSuccess = false ;
DataTable boxTable = null ;
int realCount = 0 ;
int sizeCount = 0 ;
LocalDBService local = new LocalDBService ( SqlHelper . GetConnSting ( ) ) ;
try
{
local . BeginTrans ( ) ;
saveRst = _ bll . Add_Info_New ( local , bcm , "tb_BarCode5" , "5" ) ;
if ( _ injectionBoxBLL . UpdateBoxCount ( local , bcm . BoxNo , 1 ) )
{
boxTable = _ injectionBoxBLL . SearchBox ( local , bcm . BoxNo ) ;
if ( boxTable . Rows . Count > 0 )
{
string realCountStr = dt . Rows [ 0 ] [ "BoxCount" ] . ToString ( ) ;
string realCountStr = boxTable . Rows [ 0 ] [ "BoxCount" ] . ToString ( ) ;
int realCount = 0 ;
int sizeCount = 0 ;
int . TryParse ( realCountStr , out realCount ) ;
int . TryParse ( comBoxSizeL . SelectedValue ? . ToString ( ) , out sizeCount ) ;
if ( ( realCount ! = 0 & & realCount = = sizeCount ) | | printBox = = true )
if ( ( realCount ! = 0 & & realCount = = sizeCount ) | | printBox = = true )
{
//检查上一个箱码是否给wms传成功了, 没成功重传一次.
//if (!string.IsNullOrEmpty(_lastBoxNo))
//{
// if(_wmsBll.IsSendPackageCode(_lastBoxNo) == false)
// {
// DataTable dt2 = _injectionBoxBLL.SearchBox(_lastBoxNo);
// if(dt2.Rows.Count >0)
// {
// _wmsBll.SaveInterface(dt2.Rows[0], MESClassLibrary.Enum.WmsInterfaceEnum.塑件箱码报工);
// }
// }
// _lastBoxNo = "";
//}
////wms接口传递
//_wmsBll.SaveInterface(dt.Rows[0], MESClassLibrary.Enum.WmsInterfaceEnum.塑件箱码报工);
_ wmsBll . SaveInterface ( dt . Rows [ 0 ] [ "BoxNo" ] . ToString ( ) , _l astBoxNo , "" , MESClassLibrary . Enum . WmsInterfaceEnum . 塑 件 箱 码 报 工 , comboBox2 . Text . Trim ( ) ) ;
//打印箱码
PrintBoxCode ( dt . Rows [ 0 ] , realCount , false ) ;
_l astBoxNo = lbPackageCodeL . Text ;
lbPackageCodeL . Text = "" ;
_ wmsBll . SaveInterface ( local , bcm , "" , comboBox2 . Text . Trim ( ) ) ;
isSuccess = true ;
}
}
}
local . Commit ( ) ;
}
catch ( Exception ex )
{
if ( local ! = null )
{
local . Rollback ( ) ;
}
LogErrBLL . AddInfo ( "手动批量打印条码" + bcm . OneBarCode + "报错" , MethodBase . GetCurrentMethod ( ) ) ;
_l astFailedModel = bcm ;
}
finally
{
if ( local ! = null )
{
local . EndTrans ( ) ;
}
}
//保存后打印箱单
if ( isSuccess )
{
//打印箱码
PrintBoxCode ( boxTable . Rows [ 0 ] , realCount , false ) ;
_l astBoxNo = lbPackageCodeL . Text ;
lbPackageCodeL . Text = "" ;
}
}
else
{
saveRst = _ bll . Add_Info_New ( bcm , "tb_BarCode5" ) ;
try
{
bool rst = _ bll . Add_Info_New ( bcm , "tb_BarCode5" , "5" ) ;
if ( rst = = false )
{
_l astFailedModel = bcm ;
}
}
catch ( Exception ex )
{
_l astFailedModel = bcm ;
}
}
return saveRst ;
}
private void PrintBoxCode ( DataRow boxRow , int realCount , bool isRePrint )
{
@ -1146,9 +857,9 @@ namespace InjectionSearch
// pnBoxReprint.Visible = true;
//}
}
private void UpdateBoxRecordPrintState ( string UpdatePrinted )
private void UpdateBoxRecordPrintState ( string boxCode )
{
_ injectionBoxBLL . UpdatePrinted ( UpdatePrinted ) ;
_ injectionBoxBLL . UpdatePrinted ( boxCode ) ;
}
private void button1_Click ( object sender , EventArgs e )
@ -1210,7 +921,8 @@ namespace InjectionSearch
string batch = string . Empty ;
if ( autoPrint )
{
batch = Program . ProductDate . Substring ( 2 , 2 ) + Program . ProductDate . Substring ( 5 , 2 ) + Program . ProductDate . Substring ( 8 , 2 ) ;
// batch = Program.ProductDate.Substring(2, 2) + Program.ProductDate.Substring(5, 2) + Program.ProductDate.Substring(8, 2);
batch = GetBatch ( true ) ;
}
else
{
@ -1227,7 +939,8 @@ namespace InjectionSearch
string batch = string . Empty ;
if ( autoPrint )
{
batch = Program . ProductDate . Substring ( 2 , 2 ) + Program . ProductDate . Substring ( 5 , 2 ) + Program . ProductDate . Substring ( 8 , 2 ) ;
// batch = Program.ProductDate.Substring(2, 2) + Program.ProductDate.Substring(5, 2) + Program.ProductDate.Substring(8, 2);
batch = GetBatch ( true ) ;
}
else
{
@ -1384,32 +1097,55 @@ namespace InjectionSearch
comBoxSizeL . Enabled = false ;
}
string PrintMoudleName ( )
string PrintMoudleName ( string isSupply )
{
string stationName = comboBox2 . Text . Trim ( ) ;
return BussinessHelper . PrintMoudleName ( stationName , isSupply ) ;
//if ("IM05,IM08,IM10".Contains(stationName)) //二维小条码
//{
// return "单个条码2.grf";
//}
//else if ("IM06,IM07,IM09,IM11,IM12,".Contains(stationName)) //一维条码
//{
// return "单个条码.grf";
//}
if ( "IM05,IM08,IM10" . Contains ( stationName ) ) //二维小条码
{
return "单个条码2.grf" ;
}
else if ( "IM06,IM07,IM09,IM11,IM12," . Contains ( stationName ) ) //一维条码
{
return "单个条码.grf" ;
}
//else if ("IM01,IM02,IM03,IM04,IM15,IM18,IM20".Contains(stationName)) //小米大条码
//{
// return "Sill.grf";
//}
//else if ("IM13,IM14".Contains(stationName)) //直供条码
//{
// return "单个条码1.grf";
//}
//else
//{
// return "单个条码2.grf";
//}
else if ( "IM01,IM02,IM03,IM04,IM15,IM18,IM20" . Contains ( stationName ) ) //小米大条码
{
return "Sill.grf" ;
}
else if ( "IM13,IM14" . Contains ( stationName ) ) //直供条码
}
string GetBatch ( bool isAutoPrint )
{
string batch = string . Empty ;
if ( isAutoPrint )
{
return "单个条码1.grf" ;
DateTime dt = DateTime . Now ;
if ( DateTime . TryParse ( Program . ProductDate , out dt ) = = false )
{
dt = DateTime . Now ;
}
batch = dt . ToString ( "yyMMdd" ) ;
// batch = Program.ProductDate.Substring(2, 2) + Program.ProductDate.Substring(5, 2) + Program.ProductDate.Substring(8, 2);
}
else
{
return "单个条码2.grf" ;
batch = textBox1 . Text . Trim ( ) ;
}
return batch ;
}
private void timer1_Tick ( object sender , EventArgs e )
{
Program . ProductDate = _ barCodeBLL . GetServiceTime ( ) . ToString ( ) ;
}
}
}