/// <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); }
//获取指定日期的数据 private DataSet GetData_SPC(string _Parameter, string _date) { Maticsoft.DAL.User_3D_Test_Good _M_GetTestData = new User_3D_Test_Good(); Maticsoft.DAL.User_JDS_Test_Good _M_ExfoData = new User_JDS_Test_Good(); //APC 3D数据 if (_Parameter == Maticsoft.Model.E_Generate.APC_Angle.ToString() || _Parameter == Maticsoft.Model.E_Generate.APC_Curvature.ToString() || _Parameter == Maticsoft.Model.E_Generate.APC_Spherucak.ToString() || _Parameter == Maticsoft.Model.E_Generate.APC_Offset.ToString() ) { return(_M_GetTestData.Get_SPC(_date, "APC")); } //PC 3D数据 else if (_Parameter == Maticsoft.Model.E_Generate.PC_Curvature.ToString() || _Parameter == Maticsoft.Model.E_Generate.PC_Spherucak.ToString() || _Parameter == Maticsoft.Model.E_Generate.PC_Offset.ToString() ) { return(_M_GetTestData.Get_SPC(_date, "PC")); } //Exfo测试数据 1300 else if (_Parameter == Maticsoft.Model.E_Generate.IL_1300nm.ToString() || _Parameter == Maticsoft.Model.E_Generate.RL_1300nm.ToString()) { return(_M_ExfoData.Get_SPC("1300nm", _date)); } //Exfo测试数据 1300 else if (_Parameter == Maticsoft.Model.E_Generate.IL_1310nm.ToString() || _Parameter == Maticsoft.Model.E_Generate.RL_1310nm.ToString()) { return(_M_ExfoData.Get_SPC("1310nm", _date)); } //Exfo测试数据 1300 else if (_Parameter == Maticsoft.Model.E_Generate.IL_1550nm.ToString() || _Parameter == Maticsoft.Model.E_Generate.RL_1550nm.ToString()) { return(_M_ExfoData.Get_SPC("1550nm", _date)); } //Exfo测试数据 1300 else if (_Parameter == Maticsoft.Model.E_Generate.IL_850nm.ToString() || _Parameter == Maticsoft.Model.E_Generate.RL_850nm.ToString()) { return(_M_ExfoData.Get_SPC("850nm", _date)); } //Adapter 测试 SPC else if (_Parameter == Maticsoft.Model.E_Generate.Adapter_Test.ToString() || _Parameter == Maticsoft.Model.E_Generate.Adapter_Testfour0.ToString() || _Parameter == Maticsoft.Model.E_Generate.Adapter_Testfour90.ToString() || _Parameter == Maticsoft.Model.E_Generate.Adapter_Testfour180.ToString() || _Parameter == Maticsoft.Model.E_Generate.Adapter_Testfour270.ToString() ) { Maticsoft.DAL.AdapterTestData _M_adaTestdata = new AdapterTestData(); return(_M_adaTestdata.Get_SPC(_date)); } //MPO_EXFO数据 else if (_Parameter == "MPO_Il_850nm" || _Parameter == "MPO_Il_1310nm" || _Parameter == "MPO_Refl_850nm" || _Parameter == "MPO_Refl_1310nm") //JDS数据 { if (_Parameter == "MPO_Il_850nm" || _Parameter == "MPO_Refl_850nm") { Maticsoft.DAL.User_JDS_Test_Good ujs = new User_JDS_Test_Good(); return(ujs.Get_MPO_SPC("850nm", _date)); } else { Maticsoft.DAL.User_JDS_Test_Good ujs = new User_JDS_Test_Good(); return(ujs.Get_MPO_SPC("1310nm", _date)); } } //MPO_3D数据 APC else if (_Parameter == "MPO_YEndFaceAngle_APC") { _Parameter = "YEndFaceAngle"; Maticsoft.DAL.MultiFiber _MultiFiber = new MultiFiber(); return(_MultiFiber.GetList(_Parameter, _date, "8")); //APC } // MPO_3D 数据 else { _Parameter = Get_Parameter(_Parameter); Maticsoft.DAL.MultiFiber _MultiFiber = new MultiFiber(); return(_MultiFiber.GetList(_Parameter, _date, "0")); //PC } }