//数据查看 private void FindData(DataDelivery e) { Maticsoft.BLL.SerialNumber sn = new Maticsoft.BLL.SerialNumber(); //条码操作类 Type BarcodeState = typeof(Maticsoft.Model.E_Barcode_State); //条码状态 string s = BarcodeState.GetEnumName(e.Option); //根据 索引获取 字符串 结果为 red Maticsoft.BLL.Pack_3D _M_Pack3D = new Pack_3D(); SerialNumber _M_SerialNumber = new SerialNumber(); switch (e.Option) { case 0: //未包装 ds_Record = sn.GetList("(State = '" + s + "') AND (OrderID = '" + txb_Find_OrderID.Text + "')"); break; case 1: //已包装 ds_Record = sn.GetList("(State = '" + s + "') AND (OrderID = '" + txb_Find_OrderID.Text + "')"); break; case 2: //未装箱 ds_Record = sn.GetList("(State = '" + s + "') AND (OrderID = '" + txb_Find_OrderID.Text + "')"); break; case 3: //已装箱 ds_Record = sn.GetList("(State = '" + s + "') AND (OrderID = '" + txb_Find_OrderID.Text + "')"); break; case 4: //未打印 break; case 5: //已打印 Maticsoft.BLL.tb_PrintRecord print_Record = new tb_PrintRecord(); ds_Record = print_Record.GetList("(OrderID = '" + txb_Find_OrderID.Text + "')"); break; case 6: //客户编码 ds_Record = _M_Pack3D.GetList("ClientSN ='" + txb_Find_OrderID.Text.Trim() + "'"); // ds_Record = _M_Pack3D.Get_PackData(txb_Find_OrderID.Text.Trim(), Maticsoft.Model.E_InspectMethod.配组_四十八芯); break; case 7: //客户编码 ds_Record = _M_Pack3D.GetList("SN ='" + txb_Find_OrderID.Text.Trim() + "'"); break; case 8: //SN查询 ds_Record = _M_SerialNumber.GetList("SN ='" + txb_Find_OrderID.Text.Trim() + "'"); break; case 9: //原始数据3D查询 根据SN ds_Record = MCP_CS._M_User_3D_Test_Good.GetList("SN LIKE '" + txb_Find_OrderID.Text.Trim() + "%'"); break; case 10: //原始数据JDS查询 根据SN ds_Record = MCP_CS._M_User_JDS_Test_Good.GetList("SN LIKE '" + txb_Find_OrderID.Text.Trim() + "%'"); break; case 11: //删除记录查询 ds_Record = MCP_CS.Operation_Log.GetList("Remarks LIKE '%" + txb_Find_OrderID.Text.Trim() + "%'"); break; } dgv_Info.ItemsSource = ds_Record.Tables[0].DefaultView; //显示控件中显示 lab_Record.Text = ds_Record.Tables[0].Rows.Count.ToString() + "条"; //记录数量 }
/// <summary> /// 导出3D数据报告 /// </summary> private void btn_Report_3D_Click(object sender, RoutedEventArgs e) { try { btn_Report_3D.IsEnabled = false; temBatchNo = cmb_Report_BatchNo_3D.Text; _TemPlate = cmb_TemplateList.Text; temSavePatch = txb_SavePatch.Text; // Pack_3D _M_Pack3D = new Pack_3D(); Pack_Exfo _M_PackExfo = new Pack_Exfo(); // Report _Report_3D = new Report(); Report _Report_Exfo = new Report(); // Report_3D _report_3d = new Report_3D(); Report_Exfo _report_exfo = new Report_Exfo(); Maticsoft.BLL.WorkOrder _M_WorkOrder = new WorkOrder(); Maticsoft.Model.WorkOrder _WorkOrder = new Maticsoft.Model.WorkOrder(); _WorkOrder = _M_WorkOrder.GetModel(txb_Report_OrderID_3D.Text.Trim()); //十二芯X2 导出 if (_WorkOrder.InspectMethod == Maticsoft.Model.E_InspectMethod.TFK十二芯检测x2) { //导出3D数据 _Report_3D.Export_TextReport += _report_3d.TFK十二芯检测x2; Report.ImportEventArgs p = new Report.ImportEventArgs(_M_Pack3D.Get_PackData(cmb_Report_BatchNo_3D.Text.Trim(), _WorkOrder.InspectMethod), _TemPlate, temSavePatch + "\\" + temBatchNo); p.OrderInfo = _WorkOrder; OrderLabSet _M_OrderLabSet = new OrderLabSet(); p.LabInfo = _M_OrderLabSet.GetLabInfo("OrderID='" + txb_Report_OrderID_3D.Text + "'"); p.UpProgressBar += UpProgressBar; _Report_3D.StatExport(p); //导出Exfo数据 } else if (_WorkOrder.InspectMethod == Maticsoft.Model.E_InspectMethod.配组_二十四芯 || _WorkOrder.InspectMethod == Maticsoft.Model.E_InspectMethod.配组_四十八芯 || _WorkOrder.InspectMethod == Maticsoft.Model.E_InspectMethod.配组_九十六芯 || _WorkOrder.InspectMethod == Maticsoft.Model.E_InspectMethod.四十八芯检测 || _WorkOrder.InspectMethod == Maticsoft.Model.E_InspectMethod.二十四芯检测 ) { //导出3D数据 Maticsoft.BLL.SerialNumber _M_SerialNumber = new SerialNumber(); _Report_3D.Export_TextReport += _report_3d.Multicore; DataSet temds = new DataSet(); Report.ImportEventArgs p = new Report.ImportEventArgs(temds, _TemPlate, temSavePatch + "\\"); p.OrderInfo = _WorkOrder; OrderLabSet _M_OrderLabSet = new OrderLabSet(); p.LabInfo = _M_OrderLabSet.GetLabInfo("OrderID='" + txb_Report_OrderID_3D.Text + "'"); p.UpProgressBar += UpProgressBar; ArrayList _SN_List = _M_SerialNumber.Get_SN_List(_WorkOrder.OrderID, Maticsoft.Model.E_SerialNumber_Type.ClientSN, Maticsoft.Model.E_Barcode_State.Yet_Pack); _Report_3D.StatExport(p, _SN_List); } //配组8芯 else { //导出3D数据 _Report_3D.Export_TextReport += _report_3d.peizu; Report.ImportEventArgs p = new Report.ImportEventArgs(_M_Pack3D.Get_PackData(cmb_Report_BatchNo_3D.Text.Trim(), _WorkOrder.InspectMethod), _TemPlate, temSavePatch + "\\" + temBatchNo); p.OrderInfo = _WorkOrder; p.UpProgressBar += UpProgressBar; _Report_3D.StatExport(p); } btn_Report_3D.IsEnabled = true; } catch { } }
/// <summary> /// 条码更改为 未包装 /// </summary> private static void Update_SN_TO_Not_Pack(ref DataDelivery e, SerialNumber sn, ref int temRecordCount) { //原始数据删除数量 计数 int temCount = 0; int fillDelete_snCount = 0; string fillDelete_snList = ""; Pack_3D pk_3d = new Pack_3D(); Pack_Exfo pk_Exfo = new Pack_Exfo(); Maticsoft.BLL.User_3D_Test_Good user3D = new User_3D_Test_Good(); string temSN = ""; foreach (object _sn in e.SNlist) { //如果长度大于13 temSN = 前13位条码 if (_sn.ToString().Length > 13) { temSN = _sn.ToString().Substring(0, 10); } else { temSN = _sn.ToString(); } temSN = _sn.ToString(); //删除原始数据 if (e.IsDeleteSourceData == true) { //删除3D数据 if (_sn.ToString().Length > 13) { if (user3D.Delete(_sn.ToString(), 1)) { temCount++; } } else { Maticsoft.BLL.MultiFiber _MPO_3D = new MultiFiber(); if (user3D.Delete(_sn.ToString(), 2) || _MPO_3D.Delete(_sn.ToString())) { temCount++; } } //删除Exfo数据 } //删除Pack中的数据 pk_Exfo.Delete("SN Like '" + temSN + "%'"); pk_3d.Delete("SN Like '" + temSN + "%'"); //将已包装改写为未包装 Maticsoft.Model.SerialNumber _serialNumber = sn.GetModel(temSN); if (_serialNumber != null) { _serialNumber.State = Maticsoft.Model.E_Barcode_State.Not_Pack.ToString(); //如果更新成功 if (sn.Update(_serialNumber)) { temRecordCount++; } else { fillDelete_snCount++; } } else { fillDelete_snCount++; } MCP_CS._Operation_log.Remarks += "," + _sn; } MCP_CS._Operation_log.DateTime = DateTime.Now; MCP_CS.Operation_Log.Add(MCP_CS._Operation_log); //添加删除记录 My_MessageBox.My_MessageBox_Message("成功删除已包装:" + temRecordCount + "条 原始数据:" + temCount + "条;\r\n失败" + fillDelete_snCount + "条 \r\n" + fillDelete_snList); }