Example #1
0
        /// <summary>
        /// 配组-8芯
        /// </summary>
        /// <param name="e"></param>
        public void peizu(Maticsoft.BLL.Report.ImportEventArgs e)
        {
            try
            {
                //从模板拷贝数据
                string _OrignFile, _NewFile;
                _OrignFile = "D:\\模板\\ReportTemplates\\" + e.Template;
                _NewFile   = e.SavePath + "_3D.xls";
                File.Delete(_NewFile);
                File.Copy(_OrignFile, _NewFile);

                //将数据填充到模板
                Excel.Application xlApp = new Excel.Application();
                if (xlApp == null)
                {
                    MessageBox.Show("Can’t open Excel!"); return;
                }
                xlApp.Workbooks._Open(_NewFile);
                Excel._Worksheet oSheet = (Excel._Worksheet)xlApp.Sheets.get_Item(1);

                padding_putu(e, xlApp);

                //填充完成后的操作
                xlApp.DisplayAlerts          = false; //设置禁止弹出保存和覆盖的询问提示框
                xlApp.AlertBeforeOverwriting = false;
                xlApp.SaveWorkspace();                //保存工作簿
                xlApp.Quit();                         //确保Excel进程关闭
                xlApp = null;
                GC.Collect();                         //如果不使用这条语句会导致excel进程无法正常退出,使用后正常退出

                My_MessageBox.My_MessageBox_Message("导出完成!");
            }
            catch (System.Exception ex) { MessageBox.Show(ex.Message); }
        }
Example #2
0
        /// <summary>
        ///  名称:检测方法三
        ///  功能:特殊-8芯配组检测
        /// </summary>
        /// <param name="e"></param>
        private void InspectMethod_Three(InspectEventArgs e)
        {
            try
            {
                ResultEventArgs _Result = new ResultEventArgs();                                                                                                                            //定义结果返回类
                _Result.ErrorList = "";                                                                                                                                                     //异常列表 归零
                _GLL_SerialNumber = _M_SerialNumber.GetModel(e.SN);                                                                                                                         //获取条码 实体

                if (_GLL_SerialNumber == null || _GLL_SerialNumber.OrderID != _GLL_WorkOrder.OrderID || _GLL_SerialNumber.Type != Maticsoft.Model.E_SerialNumber_Type.PigtailSN.ToString()) //判断是否属于此工单
                {
                    _Result.ErrorList += "此条码:" + e.SN + "  不属于此工单:" + _GLL_WorkOrder.OrderID + "";
                }
                else if (_GLL_SerialNumber.State != Maticsoft.Model.E_Barcode_State.Not_Pack.ToString()) //判断是否已经包装
                {
                    _Result.ErrorList += "此条码:" + _GLL_SerialNumber.SN + "  已包装或已打印!包装批号:" + _GLL_SerialNumber.BatchNO + "";
                }
                else
                {
                    if (_GLL_WorkOrder.InspectType == Maticsoft.Model.E_InspectType.检测3D与Exfo)
                    {
                        Inspect_Three_Inspect_3D(e, _Result); Inspect_Three_Inspect_Exfo(e, _Result);
                    }
                    else if (_GLL_WorkOrder.InspectType == Maticsoft.Model.E_InspectType.检测Exfo)
                    {
                        _Result.Result_3D = true; Inspect_Three_Inspect_Exfo(e, _Result);
                    }
                    else if (_GLL_WorkOrder.InspectType == Maticsoft.Model.E_InspectType.检测3D)
                    {
                        _Result.Result_Exfo = true; Inspect_Three_Inspect_3D(e, _Result);
                    }


                    //--------------------------------------------------检测配组是否完成
                    ArrayList YetPack_PigtailNum_List = _M_Pack_3D.Get_ClientSN_PigtailNum(e.ClientSN, "8芯配组");   //获取已包装线号
                    ArrayList Inspect_ClientNum       = isEqual(_GLL_Standard_ClientList, YetPack_PigtailNum_List);
                    if (Inspect_ClientNum.Count > 0)
                    {
                        //设置配组 为未完成
                        _Result.Combination = false;
                        string temClientNum = ArrayListToString(Inspect_ClientNum);
                        _Result.Not_ClientSN_Name = temClientNum;
                    }
                    else
                    {
                        //设置配组 为已完成
                        _Result.Combination = true;
                        Maticsoft.Model.SerialNumber _TemClient = new Model.SerialNumber();
                        _TemClient         = _M_SerialNumber.GetModel(e.ClientSN);
                        _TemClient.State   = Maticsoft.Model.E_Barcode_State.Yet_Pack.ToString();
                        _TemClient.BatchNO = _GLL_PackBatch.BatchNo;
                        _M_SerialNumber.Update(_TemClient);

                        _Result.Not_ClientSN_Name = ArrayListToString(_GLL_Standard_ClientList);
                    }
                }
                e.InspectResult = _Result;
            }
            catch (Exception ex) { My_MessageBox.My_MessageBox_Message(ex.Message); }
        }
Example #3
0
 /// <summary>
 /// 标签打印
 /// </summary>
 public void LabPrint()
 {
     if (My_Print.IsPrint)
     {
         My_Print.Print();
     }
     else
     {
         My_MessageBox.My_MessageBox_Message("此工单未设置标签!");
     }
 }
Example #4
0
        /// <summary>
        /// 装箱报告导出
        /// </summary>
        /// <param name="e"></param>
        public void Encasement(Maticsoft.BLL.Report.ImportEventArgs e)
        {
            try
            {
                //从模板拷贝数据
                string _OrignFile, _NewFile;
                _OrignFile = "D:\\模板\\ReportTemplates\\" + e.Template;
                _NewFile   = e.SavePath + e.Template;
                File.Delete(_NewFile);
                File.Copy(_OrignFile, _NewFile);

                //将数据填充到模板
                Excel.Application xlApp = new Excel.Application();
                if (xlApp == null)
                {
                    MessageBox.Show("Can’t open Excel!"); return;
                }
                xlApp.Workbooks._Open(_NewFile);
                Excel._Worksheet oSheet = (Excel._Worksheet)xlApp.Sheets.get_Item(1);

                //开始填充数据
                DataSet temdata  = e.ImportData;
                int     rowIndex = 1;
                int     colIndex = 0;

                //填充数据
                foreach (DataRow row in temdata.Tables[0].Rows)
                {
                    rowIndex++;
                    colIndex = 0;
                    foreach (DataColumn col in temdata.Tables[0].Columns)
                    {
                        colIndex++;
                        xlApp.Cells[rowIndex, colIndex] = row[col.ColumnName];
                    }
                    e.StatUpProgressBar(0, temdata.Tables[0].Rows.Count, rowIndex - 1);
                }

                //填充完成后的操作
                xlApp.DisplayAlerts          = false; //设置禁止弹出保存和覆盖的询问提示框
                xlApp.AlertBeforeOverwriting = false;
                xlApp.SaveWorkspace();                //保存工作簿
                xlApp.Quit();                         //确保Excel进程关闭
                xlApp = null;
                GC.Collect();                         //如果不使用这条语句会导致excel进程无法正常退出,使用后正常退出

                My_MessageBox.My_MessageBox_Message("导出完成!");
            }
            catch (System.Exception ex) { MessageBox.Show(ex.Message); }
        }
Example #5
0
        //------------------------------------------------------------------------------------------------------------------
        //  名称:检测方法四
        //  功能:跳线检测
        //
        //------------------------------------------------------------------------------------------------------------------



        /// <summary>
        ///  名称:检测方法四
        ///  功能:跳线检测
        /// </summary>
        /// <param name="e"></param>
        private void InspectMethod_TwoSnTwoLab(InspectEventArgs e)
        {
            try
            {
                Get_SN_List(e);

                ResultEventArgs _Result = new ResultEventArgs();                                                                                                                           //定义结果返回类
                _Result.ErrorList = "";                                                                                                                                                    //异常列表 归零
                _GLL_SerialNumber = _M_SerialNumber.GetModel(e.SN);                                                                                                                        //获取条码 实体

                if (_GLL_SerialNumber == null || _GLL_SerialNumber.OrderID != _GLL_WorkOrder.OrderID || _GLL_SerialNumber.Type != Maticsoft.Model.E_SerialNumber_Type.ClientSN.ToString()) //判断是否属于此工单
                {
                    _Result.ErrorList += "此条码:" + e.SN + "  不属于此工单:" + _GLL_WorkOrder.OrderID + "";
                }
                else if (_GLL_SerialNumber.State != Maticsoft.Model.E_Barcode_State.Not_Pack.ToString()) //判断是否已经包装
                {
                    _Result.ErrorList += "此条码:" + _GLL_SerialNumber.SN + "  已包装或已打印!包装批号:" + _GLL_SerialNumber.BatchNO + "";
                }
                else
                {
                    if (_GLL_WorkOrder.InspectType == Maticsoft.Model.E_InspectType.检测3D与Exfo)
                    {
                        Inspect_TwoSnToLab_Inspect_3D(e, _Result); Inspect_TwoSnToLab_Inspect_Exfo(e, _Result);
                    }
                    else if (_GLL_WorkOrder.InspectType == Maticsoft.Model.E_InspectType.检测Exfo)
                    {
                        _Result.Result_3D = true; Inspect_TwoSnToLab_Inspect_Exfo(e, _Result);
                    }
                    else if (_GLL_WorkOrder.InspectType == Maticsoft.Model.E_InspectType.检测3D)
                    {
                        _Result.Result_Exfo = true; Inspect_TwoSnToLab_Inspect_3D(e, _Result);
                    }
                }
                e.InspectResult = _Result;
                if (IsUpdate)  //检测是否启用更新
                {
                    Up_SerialNumber(e);
                }
            }
            catch (Exception ex) { My_MessageBox.My_MessageBox_Message(ex.Message); }
        }
Example #6
0
        /// <summary>
        /// 导出多芯
        /// </summary>
        private void Export_MultiCode()
        {
            string          tem      = _WTT_E.SavePath;
            int             temCount = 0;
            ImportEventArgs e        = _WTT_E;

            foreach (string _sn in _WTT_List)
            {
                temCount++;
                Maticsoft.BLL.Pack_3D _M_Pack3d = new Pack_3D();
                e.SavePath   = tem + _sn;
                e.ImportData = _M_Pack3d.Get_PackData(_sn, Model.E_InspectMethod.配组_四十八芯);
                _WTT_E       = e;
                Thread Mythread_ExReport = new Thread(new ThreadStart(ExReport));
                Mythread_ExReport.IsBackground = true;
                Mythread_ExReport.Start();
                Mythread_ExReport.Join();
                _WTT_E.StatUpProgressBar(0, temCount, _WTT_List.Count);
            }
            My_MessageBox.My_MessageBox_Message("导出完成!");
        }
Example #7
0
 /// <summary>
 /// 开始导出
 /// </summary>
 public void StatExport(ImportEventArgs e)
 {
     if (e.Template != "")
     {
         if (e.SavePath != "")
         {
             _WTT_E = e;
             Thread Mythread_ExReport = new Thread(new ThreadStart(ExReport));
             Mythread_ExReport.IsBackground = true;
             Mythread_ExReport.Start();
         }
         else
         {
             My_MessageBox.My_MessageBox_Message("保存路径不能为空!\r\n请选择保存路径后重试!");
         }
     }
     else
     {
         My_MessageBox.My_MessageBox_Message("报告模板不能为空!\r\n前选择报告模板后重试!");
     }
 }
Example #8
0
        /// <summary>
        /// 保存领料记录 并更改库存
        /// </summary>
        private int Add_Receive(DataGrid _Grid)
        {
            ConsumableReceive _M_ConsumableReceive = new ConsumableReceive();
            ConsumableInfo    _M_ConsumableInfo    = new ConsumableInfo();
            int    _recode  = 0;
            string _Message = "";

            foreach (object tem in _Grid.ItemsSource)
            {
                Maticsoft.Model.ConsumableReceive _tem            = (Maticsoft.Model.ConsumableReceive)tem;
                Maticsoft.Model.ConsumableInfo    _ConsumableInfo = _M_ConsumableInfo.GetModel(_tem.C_Barcode);

                int _Count = 0, _SaftCount = 0, Stock = 0;
                int.TryParse(_tem.Count.ToString(), out _Count);           //领取数量
                int.TryParse(_ConsumableInfo.C_SafeStock, out _SaftCount); //安全库存
                int.TryParse(_ConsumableInfo.Stock, out Stock);            //当前剩余数量

                if (_Count < Stock)                                        //如果领取数量小于库存数量
                {
                    if ((Stock - _Count) <= _SaftCount)
                    {
                        _Message += "编号:" + _ConsumableInfo.C_Barcode + "名称:" + _ConsumableInfo.C_Name + "库存不足,请立即请购!";
                    }
                    _tem.Datetime = DateTime.Now.ToString();
                    if (_M_ConsumableReceive.Add(_tem) > 0)
                    {
                        _recode++;
                    }
                }
                else
                {
                    _Message += "\r\n保存失败警告:编号:" + _ConsumableInfo.C_Barcode + "名称:" + _ConsumableInfo.C_Name + "库存不足,未进行保存";
                }
            }
            if (_Message.Length > 2)
            {
                My_MessageBox.My_MessageBox_Message(_Message);
            }
            return(_recode);
        }
Example #9
0
        /// <summary>
        /// 名称: 检测方法四
        /// 功能: 检测TFK12芯X2 线材
        /// </summary>
        /// <param name="e"></param>
        private void InspectMothod_four(InspectEventArgs e)
        {
            try
            {
                ResultEventArgs _Result = new ResultEventArgs();                                                                                                                           //定义结果返回类
                _Result.ErrorList = "";                                                                                                                                                    //异常列表 归零
                _GLL_SerialNumber = _M_SerialNumber.GetModel(e.SN);                                                                                                                        //获取条码 实体

                if (_GLL_SerialNumber == null || _GLL_SerialNumber.OrderID != _GLL_WorkOrder.OrderID || _GLL_SerialNumber.Type != Maticsoft.Model.E_SerialNumber_Type.ClientSN.ToString()) //判断是否属于此工单
                {
                    _Result.ErrorList += "此条码:" + e.SN + "  不属于此工单:" + _GLL_WorkOrder.OrderID + "";
                }
                else if (_GLL_SerialNumber.State != Maticsoft.Model.E_Barcode_State.Not_Pack.ToString()) //判断是否已经包装
                {
                    _Result.ErrorList += "此条码:" + _GLL_SerialNumber.SN + "  已包装或已打印!包装批号:" + _GLL_SerialNumber.BatchNO + "";
                }
                else
                {
                    if (_GLL_WorkOrder.InspectType == Maticsoft.Model.E_InspectType.检测3D与Exfo)
                    {
                        Inspect_four_Inspect_3D(e, _Result); Inspect_four_Inspect_Exfo(e, _Result);
                    }
                    else if (_GLL_WorkOrder.InspectType == Maticsoft.Model.E_InspectType.检测Exfo)
                    {
                        _Result.Result_3D = true; Inspect_four_Inspect_Exfo(e, _Result);
                    }
                    else if (_GLL_WorkOrder.InspectType == Maticsoft.Model.E_InspectType.检测3D)
                    {
                        _Result.Result_Exfo = true; Inspect_four_Inspect_3D(e, _Result);
                    }

                    //设置配组 为未完成 因为不需要进行配组
                    _Result.Combination = false;
                }
                e.InspectResult = _Result;
            }
            catch (Exception ex) { My_MessageBox.My_MessageBox_Message(ex.Message); }
        }
Example #10
0
        /// <summary>
        ///  名称:检测方法二
        ///  功能:检测配组线材
        /// </summary>
        /// <param name="e"></param>
        private void InspectMethod_Two(InspectEventArgs e)
        {
            try
            {
                ResultEventArgs _Result = new ResultEventArgs();                                                                                                                            //定义结果返回类
                _Result.ErrorList = "";                                                                                                                                                     //异常列表 归零
                _GLL_SerialNumber = _M_SerialNumber.GetModel(e.SN);                                                                                                                         //获取条码 实体

                if (_GLL_SerialNumber == null || _GLL_SerialNumber.OrderID != _GLL_WorkOrder.OrderID || _GLL_SerialNumber.Type != Maticsoft.Model.E_SerialNumber_Type.PigtailSN.ToString()) //判断是否属于此工单
                {
                    _Result.ErrorList += "此条码:" + e.SN + "  不属于此工单:" + _GLL_WorkOrder.OrderID + "";
                }
                else if (_GLL_SerialNumber.State != Maticsoft.Model.E_Barcode_State.Not_Pack.ToString()) //判断是否已经包装
                {
                    _Result.ErrorList += "此条码:" + _GLL_SerialNumber.SN + "  已包装或已打印!包装批号:" + _GLL_SerialNumber.BatchNO + "";
                }
                else
                {
                    //验证线号是否已经存在
                    string PigtailNum = "";
                    if (e.SN.Length >= 13)
                    {
                        PigtailNum = e.SN.Substring(11, 2);
                    }                                                                                    //获取线号
                    ArrayList YetPack_PigtailNum_List = _M_Pack_3D.Get_ClientSN_PigtailNum(e.ClientSN);  //获取已包装线号

                    //判断此线号是否已经包装
                    bool Cli_IN_Name = false;
                    if (IsUpdate)
                    {
                        Cli_IN_Name = YetPack_PigtailNum_List.Contains(PigtailNum);
                    }
                    if (Cli_IN_Name)
                    {
                        _Result.ErrorList += "客户编码:" + e.ClientSN + "  已存在此线号:" + PigtailNum + " ";
                    }
                    else
                    {
                        if (_GLL_WorkOrder.InspectType == Maticsoft.Model.E_InspectType.检测3D与Exfo)
                        {
                            Inspect_Two_Inspect_3D(e, _Result); Inspect_Two_Inspect_Exfo(e, _Result);
                        }
                        else if (_GLL_WorkOrder.InspectType == Maticsoft.Model.E_InspectType.检测Exfo)
                        {
                            _Result.Result_3D = true; Inspect_Two_Inspect_Exfo(e, _Result);
                        }
                        else if (_GLL_WorkOrder.InspectType == Maticsoft.Model.E_InspectType.检测3D)
                        {
                            _Result.Result_Exfo = true; Inspect_Two_Inspect_3D(e, _Result);
                        }
                    }
                    //再次获取已包装线号 并与标准 客户编码数组进行比较
                    YetPack_PigtailNum_List = _M_Pack_3D.Get_ClientSN_PigtailNum(e.ClientSN);   //获取已包装线号
                    ArrayList Inspect_ClientNum = isEqual(_GLL_Standard_ClientList, YetPack_PigtailNum_List);
                    if (Inspect_ClientNum.Count > 0)
                    {
                        //设置配组 为未完成 因为不需要进行配组
                        _Result.Combination = false;
                        string temClientNum = ArrayListToString(Inspect_ClientNum);
                        _Result.Not_ClientSN_Name = temClientNum;
                    }
                    else
                    {
                        //设置配组 为已完成 因为不需要进行配组
                        _Result.Combination = true;
                        Maticsoft.Model.SerialNumber _TemClient = new Model.SerialNumber();
                        _TemClient         = _M_SerialNumber.GetModel(e.ClientSN);
                        _TemClient.State   = Maticsoft.Model.E_Barcode_State.Yet_Pack.ToString();
                        _TemClient.BatchNO = _GLL_PackBatch.BatchNo;
                        _M_SerialNumber.Update(_TemClient);

                        _Result.Not_ClientSN_Name = ArrayListToString(_GLL_Standard_ClientList);
                    }
                }
                e.InspectResult = _Result;
            }
            catch (Exception ex) { My_MessageBox.My_MessageBox_Message(ex.Message); }
        }