Beispiel #1
0
        private static bool GetToolListPath(out string ToolListPath)
        {
            ToolListPath = "";
            try
            {
                cMETE_Download_Upload_Path = new METE_Download_Upload_Path();
                Is_Local = Environment.GetEnvironmentVariable("UGII_ENV_FILE");
                if (Is_Local != null)
                {
                    //取得Server的ToolListPath.xls路徑
                    ToolListPath = string.Format(@"{0}\{1}\{2}\{3}", CaxEnv.GetGlobaltekEnvDir(), "TE_Config", "Config", "ToolList.xls");

                    //取得METEDownload_Upload.dat
                    status = CaxGetDatData.GetMETEDownload_Upload(out cMETE_Download_Upload_Path);
                    if (!status)
                    {
                        MessageBox.Show("取得METEDownload_Upload.dat失敗");
                        return(false);
                    }
                }
                else
                {
                    ToolListPath = string.Format(@"{0}\{1}", "D:", "ToolList.xls");
                }
            }
            catch (System.Exception ex)
            {
                return(false);
            }
            return(true);
        }
Beispiel #2
0
        public static string label900BilletPath = ""; //900胚料檔路徑

        public TEOpenTaskDlg()
        {
            InitializeComponent();

            panel = superGridPanel.PrimaryGrid;

            //取得METEDownload_Upload.dat資料
            status = CaxGetDatData.GetMETEDownload_Upload(out cMETE_Download_Upload_Path);
            if (!status)
            {
                MessageBox.Show("取得METEDownload_Upload.dat資料失敗");
                return;
            }

            //更新客戶資料
            IniSearchCus();

            //關閉下拉選單-料號&版次
            comboBoxPartNo.Enabled = false;
            comboBoxCusVer.Enabled = false;
            //關閉groupBox
            groupBox001.Enabled      = false;
            groupBoxW.Enabled        = false;
            groupBox900.Enabled      = false;
            button001SelPart.Enabled = false;
            buttonWSelPart.Enabled   = false;

            //初始化labelBox
            label001.Text = "";
            labelW.Text   = "";
        }
Beispiel #3
0
        private void MainProgramDlg_Load(object sender, EventArgs e)
        {
            AddButton.BackgroundImage = MainProgram.Properties.Resources.圖片1;
            //取得所有GroupAry,用來判斷Group的Type決定是NC、Tool、Geometry
            NCGroupAry = displayPart.CAMSetup.CAMGroupCollection.ToArray();
            //取得所有operationAry
            OperationAry = displayPart.CAMSetup.CAMOperationCollection.ToArray();

            #region 取得相關資訊,填入Dic
            DicNCData = new Dictionary <string, string>();
            foreach (NXOpen.CAM.NCGroup ncGroup in NCGroupAry)
            {
                int type;
                int subtype;
                theUfSession.Obj.AskTypeAndSubtype(ncGroup.Tag, out type, out subtype);
                //判斷是否為Program群組
                if (type != UFConstants.UF_machining_task_type)
                {
                    continue;
                }

                foreach (NXOpen.CAM.Operation item in OperationAry)
                {
                    //取得父層的群組(回傳:NCGroup XXXX)
                    string NCProgramTag = item.GetParent(CAMSetup.View.ProgramOrder).ToString();
                    NCProgramTag = Regex.Replace(NCProgramTag, "[^0-9]", "");
                    if (NCProgramTag == ncGroup.Tag.ToString())
                    {
                        bool   cheValue;
                        string OperName = "";
                        cheValue = DicNCData.TryGetValue(ncGroup.Name, out OperName);
                        if (!cheValue)
                        {
                            OperName = item.Name;
                            DicNCData.Add(ncGroup.Name, OperName);
                        }
                        else
                        {
                            OperName = OperName + "," + item.Name;
                            DicNCData[ncGroup.Name] = OperName;
                        }
                    }
                }
            }
            #endregion

            //將DicProgName的key存入程式群組下拉選單中
            comboBoxNCgroup.Items.AddRange(DicNCData.Keys.ToArray());

            //取得METEDownload_Upload資料
            status = CaxGetDatData.GetMETEDownload_Upload(out cMETE_Download_Upload_Path);
            if (!status)
            {
                MessageBox.Show("取得METEDownload_Upload失敗");
                return;
            }
        }
Beispiel #4
0
        public MEDownloadDlg()
        {
            InitializeComponent();

            #region 客戶資料填入
            string[] S_Task_CusName = Directory.GetDirectories(CaxEnv.GetGlobaltekTaskDir());
            foreach (string item in S_Task_CusName)
            {
                comboBoxCusName.Items.Add(Path.GetFileNameWithoutExtension(item));//走訪每個元素只取得目錄名稱(不含路徑)並加入dirlist集合中
            }
            PartNocomboBox.Enabled = false;
            CusRevcomboBox.Enabled = false;
            OpRevcomboBox.Enabled  = false;
            Oper1comboBox.Enabled  = false;
            #endregion

            /*
             * //取得METEDownloadData資料
             * status = CaxGetDatData.GetMETEDownloadData(out cMETEDownloadData);
             * if (!status)
             * {
             *  MessageBox.Show("取得METEDownloadData失敗");
             *  return;
             * }
             *
             * //存入下拉選單-客戶
             * for (int i = 0; i < cMETEDownloadData.EntirePartAry.Count; i++)
             * {
             *  comboBoxCusName.Items.Add(cMETEDownloadData.EntirePartAry[i].CusName);
             * }
             * PartNocomboBox.Enabled = false;
             * CusRevcomboBox.Enabled = false;
             * Oper1comboBox.Enabled = false;
             */


            //取得METEDownload_Upload資料
            status = CaxGetDatData.GetMETEDownload_Upload(out cMETE_Download_Upload_Path);
            if (!status)
            {
                MessageBox.Show("取得METEDownload_Upload_New失敗");
                return;
            }
        }
Beispiel #5
0
        public MEDownloadDlg()
        {
            InitializeComponent();

            //取得METEDownloadData資料
            status = CaxGetDatData.GetMETEDownloadData(out cMETEDownloadData);
            if (!status)
            {
                MessageBox.Show("取得METEDownloadData失敗");
                return;
            }

            //存入下拉選單-客戶
            for (int i = 0; i < cMETEDownloadData.EntirePartAry.Count; i++)
            {
                comboBoxCusName.Items.Add(cMETEDownloadData.EntirePartAry[i].CusName);
            }

            //存入下拉選單-料號
            //for (int i = 0; i < cME_TE_Download.EntirePartAry.Count;i++ )
            //{
            //    PartNocomboBox.Items.Add(cME_TE_Download.EntirePartAry[i].PartNo);
            //}

            PartNocomboBox.Enabled = false;
            CusRevcomboBox.Enabled = false;
            Oper1comboBox.Enabled  = false;

            //取得METEDownload_Upload資料
            status = CaxGetDatData.GetMETEDownload_Upload(out cMETE_Download_Upload_Path);
            if (!status)
            {
                MessageBox.Show("取得METEDownload_Upload失敗");
                return;
            }
        }
        private void PostProcessorDlg_Load(object sender, EventArgs e)
        {
            int module_id;

            theUfSession.UF.AskApplicationModule(out module_id);
            if (module_id != UFConstants.UF_APP_CAM)
            {
                MessageBox.Show("請先轉換為加工模組後再執行!");
                this.Close();
            }

            //取得METEDownload_Upload資料
            status = CaxGetDatData.GetMETEDownload_Upload(out cMETE_Download_Upload_Path);
            if (!status)
            {
                MessageBox.Show("取得METEDownload_Upload失敗");
                return;
            }

            //取得所有GroupAry,用來判斷Group的Type決定是NC、Tool、Geometry
            NCGroupAry = displayPart.CAMSetup.CAMGroupCollection.ToArray();
            //取得所有operationAry
            OperationAry = displayPart.CAMSetup.CAMOperationCollection.ToArray();

            #region 取得相關資訊,填入Dic
            DicNCData = new Dictionary <string, string>();
            foreach (NXOpen.CAM.NCGroup ncGroup in NCGroupAry)
            {
                int type;
                int subtype;
                theUfSession.Obj.AskTypeAndSubtype(ncGroup.Tag, out type, out subtype);
                //判斷是否為Program群組
                if (type != UFConstants.UF_machining_task_type)
                {
                    continue;
                }

                foreach (NXOpen.CAM.Operation item in OperationAry)
                {
                    //取得父層的群組(回傳:NCGroup XXXX)
                    string NCProgramTag = item.GetParent(CAMSetup.View.ProgramOrder).ToString();
                    NCProgramTag = Regex.Replace(NCProgramTag, "[^0-9]", "");
                    if (NCProgramTag == ncGroup.Tag.ToString())
                    {
                        bool   cheValue;
                        string OperName = "";
                        cheValue = DicNCData.TryGetValue(ncGroup.Name, out OperName);
                        if (!cheValue)
                        {
                            OperName = item.Name;
                            DicNCData.Add(ncGroup.Name, OperName);
                        }
                        else
                        {
                            OperName = OperName + "," + item.Name;
                            DicNCData[ncGroup.Name] = OperName;
                        }
                    }
                }
            }
            #endregion

            //將DicProgName的key存入程式群組下拉選單中
            comboBoxNCgroup.Items.AddRange(DicNCData.Keys.ToArray());

            #region 將控制器名稱填入SuperGridPostPanel

            GridRow row = new GridRow();
            //-----暫時使用版本(路徑指向UG)
            //string TemplateRoot = string.Format(@"{0}\{1}\{2}\{3}", Environment.GetEnvironmentVariable("UGII_BASE_DIR"), "MACH", "resource", "postprocessor");
            //string TemplatePostPath = string.Format(@"{0}\{1}", TemplateRoot, "template_post.dat");
            //TemplatePostData = System.IO.File.ReadAllLines(TemplatePostPath);
            //-----發佈使用版本(Server需有MACH檔案)
            TemplatePostData = CaxGetDatData.GetTemplatePostData();
            if (TemplatePostData.Length == 0)
            {
                CaxLog.ShowListingWindow("template_post.dat為空,請檢查!");
            }
            //string empty = "";
            //row = new GridRow(empty);
            //PostPanel.Rows.Add(row);
            //for (int i = 0; i < TemplatePostData.Length;i++ )
            //{
            //    if (i>6)
            //    {
            //        string PostName = TemplatePostData[i].Split(',')[0];
            //        row = new GridRow(PostName);
            //        PostPanel.Rows.Add(row);
            //    }
            //}

            #endregion
        }
Beispiel #7
0
        private void MEUploadDlg_Load(object sender, EventArgs e)
        {
            //取得METEDownload_Upload.dat
            CaxGetDatData.GetMETEDownload_Upload(out cMETE_Download_Upload_Path);

            //取得料號
            PartNoLabel.Text = Path.GetFileNameWithoutExtension(displayPart.FullPath).Split('_')[0];
            OISLabel.Text    = Path.GetFileNameWithoutExtension(displayPart.FullPath).Split('_')[1];

            //將Local_Folder_OIS先暫存起來,然後改變成Server路徑
            tempLocal_Folder_OIS = cMETE_Download_Upload_Path.Local_Folder_OIS;

            CaxPublic.GetAllPath("ME", displayPart.FullPath, ref cMETE_Download_Upload_Path);

            /*
             * //拆零件路徑字串取得客戶名稱、料號、版本
             * string PartFullPath = displayPart.FullPath;
             * string[] SplitPath = PartFullPath.Split('\\');
             * PartInfo.CusName = SplitPath[3];
             * PartInfo.PartNo = SplitPath[4];
             * PartInfo.CusRev = SplitPath[5];
             * PartInfo.OpNum = Path.GetFileNameWithoutExtension(displayPart.FullPath).Split(new string[] { "OIS" }, StringSplitOptions.RemoveEmptyEntries)[1];
             *
             #region 取代Server路徑字串
             * cMETE_Download_Upload_Path.Server_ShareStr = cMETE_Download_Upload_Path.Server_ShareStr.Replace("[Server_IP]", cMETE_Download_Upload_Path.Server_IP);
             * cMETE_Download_Upload_Path.Server_ShareStr = cMETE_Download_Upload_Path.Server_ShareStr.Replace("[CusName]", PartInfo.CusName);
             * cMETE_Download_Upload_Path.Server_ShareStr = cMETE_Download_Upload_Path.Server_ShareStr.Replace("[PartNo]", PartInfo.PartNo);
             * cMETE_Download_Upload_Path.Server_ShareStr = cMETE_Download_Upload_Path.Server_ShareStr.Replace("[CusRev]", PartInfo.CusRev);
             * Server_OP_Folder = string.Format(@"{0}\{1}", cMETE_Download_Upload_Path.Server_ShareStr, "OP" + PartInfo.OpNum);
             #endregion
             *
             #region 取代Local路徑字串
             * //將Local_Folder_OIS先暫存起來,然後改變成Server路徑
             * tempLocal_Folder_OIS = cMETE_Download_Upload_Path.Local_Folder_OIS;
             * cMETE_Download_Upload_Path.Local_ShareStr = cMETE_Download_Upload_Path.Local_ShareStr.Replace("[Local_IP]", cMETE_Download_Upload_Path.Local_IP);
             * cMETE_Download_Upload_Path.Local_ShareStr = cMETE_Download_Upload_Path.Local_ShareStr.Replace("[CusName]", PartInfo.CusName);
             * cMETE_Download_Upload_Path.Local_ShareStr = cMETE_Download_Upload_Path.Local_ShareStr.Replace("[PartNo]", PartInfo.PartNo);
             * cMETE_Download_Upload_Path.Local_ShareStr = cMETE_Download_Upload_Path.Local_ShareStr.Replace("[CusRev]", PartInfo.CusRev);
             * cMETE_Download_Upload_Path.Local_Folder_OIS = cMETE_Download_Upload_Path.Local_Folder_OIS.Replace("[Local_ShareStr]", cMETE_Download_Upload_Path.Local_ShareStr);
             * cMETE_Download_Upload_Path.Local_Folder_OIS = cMETE_Download_Upload_Path.Local_Folder_OIS.Replace("[Oper1]", PartInfo.OpNum);
             #endregion
             */

            DicPartDirData = new Dictionary <string, PartDirData>();
            #region 處理Part的路徑
            //預先加入總組立檔
            PartDirData sPartDirData = new PartDirData();
            sPartDirData.PartLocalDir   = displayPart.FullPath;
            sPartDirData.PartServer1Dir = string.Format(@"{0}\{1}", cMETE_Download_Upload_Path.Server_ShareStr, Path.GetFileName(displayPart.FullPath));
            //sPartDirData.PartServer2Dir = string.Format(@"{0}\{1}", cMETE_Download_Upload_Path.Server_ShareStr, "OP" + PartInfo.OIS);
            DicPartDirData.Add(Path.GetFileNameWithoutExtension(displayPart.FullPath), sPartDirData);
            listView1.Items.Add(Path.GetFileName(displayPart.FullPath));

            //加入Comp資訊
            NXOpen.Assemblies.ComponentAssembly casm = displayPart.ComponentAssembly;
            //NXOpen.Assemblies.Component[] compary = casm.RootComponent.GetChildren();
            List <NXOpen.Assemblies.Component> ListChildrenComp = new List <NXOpen.Assemblies.Component>();
            CaxAsm.GetCompChildren(casm.RootComponent, ref ListChildrenComp);
            foreach (NXOpen.Assemblies.Component i in ListChildrenComp)
            {
                sPartDirData = new PartDirData();

                //判斷Server是否已存在此檔案,如果有就不上傳
                string ServerPartPath = string.Format(@"{0}\{1}", cMETE_Download_Upload_Path.Server_ShareStr, Path.GetFileName(((Part)i.Prototype).FullPath));
                if (File.Exists(ServerPartPath))
                {
                    if (!((Part)i.Prototype).FullPath.Contains(PartInfo.OpNum))
                    {
                        continue;
                    }
                }
                sPartDirData.PartLocalDir   = ((Part)i.Prototype).FullPath;
                sPartDirData.PartServer1Dir = ServerPartPath;
                DicPartDirData.Add(i.Name, sPartDirData);
                listView1.Items.Add(Path.GetFileName(((Part)i.Prototype).FullPath));
                //sPartDirData.PartServer2Dir = string.Format(@"{0}\{1}", cMETE_Download_Upload_Path.Server_ShareStr, "OP" + PartInfo.OIS);
            }
            #endregion

            #region 處理Excel的路徑
            string[] FolderFile = System.IO.Directory.GetFileSystemEntries(cMETE_Download_Upload_Path.Local_Folder_OIS, "*.xls");
            //篩選出IPQC、SelfCheck
            List <string> List_ExcelIPQC      = new List <string>();
            List <string> List_ExcelSelfCheck = new List <string>();
            List <string> List_ExcelIQC       = new List <string>();
            List <string> List_ExcelFAI       = new List <string>();
            foreach (string i in FolderFile)
            {
                if (i.Contains("IPQC"))
                {
                    List_ExcelIPQC.Add(i);
                }
                if (i.Contains("SelfCheck"))
                {
                    List_ExcelSelfCheck.Add(i);
                }
                if (i.Contains("IQC"))
                {
                    List_ExcelIQC.Add(i);
                }
                if (i.Contains("FAI"))
                {
                    List_ExcelFAI.Add(i);
                }
            }

            long ExcelIPQCFileTime      = new long();
            long ExcelSelfCheckFileTime = new long();
            long ExcelIQCFileTime       = new long();
            long ExcelFAIFileTime       = new long();

            #region 處理IPQC
            foreach (string i in List_ExcelIPQC)
            {
                System.IO.FileInfo ExcelInfo = new System.IO.FileInfo(i);
                if (ExcelInfo.LastAccessTime.ToFileTime() > ExcelIPQCFileTime)
                {
                    ExcelIPQCFileTime = ExcelInfo.LastAccessTime.ToFileTime();
                    sExcelDirData.ExcelIPQCLocalDir = i;
                    string Server_Folder_OIS = "";
                    Server_Folder_OIS = tempLocal_Folder_OIS.Replace("[Local_ShareStr]", cMETE_Download_Upload_Path.Server_ShareStr);
                    Server_Folder_OIS = Server_Folder_OIS.Replace("[Oper1]", PartInfo.OpNum);
                    sExcelDirData.ExcelIPQCServerDir = string.Format(@"{0}\{1}", Server_Folder_OIS, ExcelInfo.Name);
                }
            }
            if (List_ExcelIPQC.Count != 0)
            {
                listView1.Items.Add(Path.GetFileName(sExcelDirData.ExcelIPQCLocalDir));
            }
            #endregion

            #region 處理SelfCheck
            foreach (string i in List_ExcelSelfCheck)
            {
                System.IO.FileInfo ExcelInfo = new System.IO.FileInfo(i);
                if (ExcelInfo.LastAccessTime.ToFileTime() > ExcelSelfCheckFileTime)
                {
                    ExcelSelfCheckFileTime = ExcelInfo.LastAccessTime.ToFileTime();
                    sExcelDirData.ExcelSelfCheckLocalDir = i;
                    string Server_Folder_OIS = "";
                    Server_Folder_OIS = tempLocal_Folder_OIS.Replace("[Local_ShareStr]", cMETE_Download_Upload_Path.Server_ShareStr);
                    Server_Folder_OIS = Server_Folder_OIS.Replace("[Oper1]", PartInfo.OpNum);
                    sExcelDirData.ExcelSelfCheckServerDir = string.Format(@"{0}\{1}", Server_Folder_OIS, ExcelInfo.Name);
                }
            }
            if (List_ExcelSelfCheck.Count != 0)
            {
                listView1.Items.Add(Path.GetFileName(sExcelDirData.ExcelSelfCheckLocalDir));
            }
            #endregion

            #region 處理IQC
            foreach (string i in List_ExcelIQC)
            {
                System.IO.FileInfo ExcelInfo = new System.IO.FileInfo(i);
                if (ExcelInfo.LastAccessTime.ToFileTime() > ExcelIQCFileTime)
                {
                    ExcelIQCFileTime = ExcelInfo.LastAccessTime.ToFileTime();
                    sExcelDirData.ExcelIQCLocalDir = i;
                    string Server_Folder_OIS = "";
                    Server_Folder_OIS = tempLocal_Folder_OIS.Replace("[Local_ShareStr]", cMETE_Download_Upload_Path.Server_ShareStr);
                    Server_Folder_OIS = Server_Folder_OIS.Replace("[Oper1]", PartInfo.OpNum);
                    sExcelDirData.ExcelIQCServerDir = string.Format(@"{0}\{1}", Server_Folder_OIS, ExcelInfo.Name);
                }
            }
            if (List_ExcelIQC.Count != 0)
            {
                listView1.Items.Add(Path.GetFileName(sExcelDirData.ExcelIQCLocalDir));
            }
            #endregion

            #region 處理FAI
            foreach (string i in List_ExcelFAI)
            {
                System.IO.FileInfo ExcelInfo = new System.IO.FileInfo(i);
                if (ExcelInfo.LastAccessTime.ToFileTime() > ExcelFAIFileTime)
                {
                    ExcelFAIFileTime = ExcelInfo.LastAccessTime.ToFileTime();
                    sExcelDirData.ExcelFAILocalDir = i;
                    string Server_Folder_OIS = "";
                    Server_Folder_OIS = tempLocal_Folder_OIS.Replace("[Local_ShareStr]", cMETE_Download_Upload_Path.Server_ShareStr);
                    Server_Folder_OIS = Server_Folder_OIS.Replace("[Oper1]", PartInfo.OpNum);
                    sExcelDirData.ExcelFAIServerDir = string.Format(@"{0}\{1}", Server_Folder_OIS, ExcelInfo.Name);
                }
            }
            if (List_ExcelFAI.Count != 0)
            {
                listView1.Items.Add(Path.GetFileName(sExcelDirData.ExcelFAILocalDir));
            }
            #endregion
            #endregion
        }
Beispiel #8
0
        private void TEUploadDlg_Load(object sender, EventArgs e)
        {
            //取得METEDownload_Upload.dat
            CaxGetDatData.GetMETEDownload_Upload(out cMETE_Download_Upload_Path);

            //取得料號
            PartNoLabel.Text = Path.GetFileNameWithoutExtension(displayPart.FullPath).Split('_')[0];
            OISLabel.Text    = Path.GetFileNameWithoutExtension(displayPart.FullPath).Split('_')[1];

            //將Local_Folder_OIS先暫存起來,然後改變成Server路徑
            tempLocal_Folder_CAM = cMETE_Download_Upload_Path.Local_Folder_CAM;

            CaxPublic.GetAllPath("TE", displayPart.FullPath, ref cMETE_Download_Upload_Path);


            /*
             * //拆零件路徑字串取得客戶名稱、料號、版本
             * string PartFullPath = displayPart.FullPath;
             * string[] SplitPath = PartFullPath.Split('\\');
             * PartInfo.CusName = SplitPath[3];
             * PartInfo.PartNo = SplitPath[4];
             * PartInfo.CusRev = SplitPath[5];
             * PartInfo.OpNum = Regex.Replace(Path.GetFileNameWithoutExtension(displayPart.FullPath).Split('_')[1], "[^0-9]", "");
             *
             #region 取代Server路徑字串
             * cMETE_Download_Upload_Path.Server_ShareStr = cMETE_Download_Upload_Path.Server_ShareStr.Replace("[Server_IP]", cMETE_Download_Upload_Path.Server_IP);
             * cMETE_Download_Upload_Path.Server_ShareStr = cMETE_Download_Upload_Path.Server_ShareStr.Replace("[CusName]", PartInfo.CusName);
             * cMETE_Download_Upload_Path.Server_ShareStr = cMETE_Download_Upload_Path.Server_ShareStr.Replace("[PartNo]", PartInfo.PartNo);
             * cMETE_Download_Upload_Path.Server_ShareStr = cMETE_Download_Upload_Path.Server_ShareStr.Replace("[CusRev]", PartInfo.CusRev);
             * Server_OP_Folder = string.Format(@"{0}\{1}", cMETE_Download_Upload_Path.Server_ShareStr, "OP" + PartInfo.OpNum);
             #endregion
             *
             #region 取代Local路徑字串
             * //將Local_Folder_OIS先暫存起來,然後改變成Server路徑
             * tempLocal_Folder_CAM = cMETE_Download_Upload_Path.Local_Folder_CAM;
             * cMETE_Download_Upload_Path.Local_ShareStr = cMETE_Download_Upload_Path.Local_ShareStr.Replace("[Local_IP]", cMETE_Download_Upload_Path.Local_IP);
             * cMETE_Download_Upload_Path.Local_ShareStr = cMETE_Download_Upload_Path.Local_ShareStr.Replace("[CusName]", PartInfo.CusName);
             * cMETE_Download_Upload_Path.Local_ShareStr = cMETE_Download_Upload_Path.Local_ShareStr.Replace("[PartNo]", PartInfo.PartNo);
             * cMETE_Download_Upload_Path.Local_ShareStr = cMETE_Download_Upload_Path.Local_ShareStr.Replace("[CusRev]", PartInfo.CusRev);
             * cMETE_Download_Upload_Path.Local_Folder_CAM = cMETE_Download_Upload_Path.Local_Folder_CAM.Replace("[Local_ShareStr]", cMETE_Download_Upload_Path.Local_ShareStr);
             * cMETE_Download_Upload_Path.Local_Folder_CAM = cMETE_Download_Upload_Path.Local_Folder_CAM.Replace("[Oper1]", PartInfo.OpNum);
             #endregion
             */

            DicPartDirData = new Dictionary <string, PartDirData>();
            #region 處理Part的路徑
            //預先加入總組立檔
            PartDirData sPartDirData = new PartDirData();
            sPartDirData.PartLocalDir   = displayPart.FullPath;
            sPartDirData.PartServer1Dir = string.Format(@"{0}\{1}", cMETE_Download_Upload_Path.Server_ShareStr, Path.GetFileName(displayPart.FullPath));
            //sPartDirData.PartServer2Dir = string.Format(@"{0}\{1}", cMETE_Download_Upload_Path.Server_ShareStr, "OP" + PartInfo.OIS);
            DicPartDirData.Add(Path.GetFileNameWithoutExtension(displayPart.FullPath), sPartDirData);
            listView1.Items.Add(Path.GetFileName(displayPart.FullPath));

            //加入Comp資訊
            NXOpen.Assemblies.ComponentAssembly casm             = displayPart.ComponentAssembly;
            List <NXOpen.Assemblies.Component>  ListChildrenComp = new List <NXOpen.Assemblies.Component>();
            CaxAsm.GetCompChildren(casm.RootComponent, ref ListChildrenComp);
            foreach (NXOpen.Assemblies.Component i in ListChildrenComp)
            {
                sPartDirData = new PartDirData();

                //判斷Server是否已存在此檔案,如果有就不上傳
                string ServerPartPath = string.Format(@"{0}\{1}", cMETE_Download_Upload_Path.Server_ShareStr, Path.GetFileName(((Part)i.Prototype).FullPath));
                if (File.Exists(ServerPartPath))
                {
                    if (!((Part)i.Prototype).FullPath.Contains(PartInfo.OpNum))
                    {
                        continue;
                    }
                }
                sPartDirData.PartLocalDir   = ((Part)i.Prototype).FullPath;
                sPartDirData.PartServer1Dir = ServerPartPath;
                DicPartDirData.Add(i.Name, sPartDirData);
                listView1.Items.Add(Path.GetFileName(((Part)i.Prototype).FullPath));
                //sPartDirData.PartServer2Dir = string.Format(@"{0}\{1}", cMETE_Download_Upload_Path.Server_ShareStr, "OP" + PartInfo.OIS);
            }
            //foreach (NXOpen.Assemblies.Component i in ListChildrenComp)
            //{
            //    sPartDirData = new PartDirData();
            //    sPartDirData.PartLocalDir = ((Part)i.Prototype).FullPath;
            //    sPartDirData.PartServer1Dir = string.Format(@"{0}\{1}", cMETE_Download_Upload_Path.Server_ShareStr, Path.GetFileName(((Part)i.Prototype).FullPath));
            //    //sPartDirData.PartServer2Dir = string.Format(@"{0}\{1}", cMETE_Download_Upload_Path.Server_ShareStr, "OP" + PartInfo.OIS);
            //    DicPartDirData.Add(i.Name, sPartDirData);
            //    listView1.Items.Add(Path.GetFileName(((Part)i.Prototype).FullPath));
            //}
            #endregion

            #region 處理Excel的路徑
            string[] FolderFile        = System.IO.Directory.GetFileSystemEntries(cMETE_Download_Upload_Path.Local_Folder_CAM, "*.xls");
            string   Server_Folder_CAM = "";
            Server_Folder_CAM = tempLocal_Folder_CAM.Replace("[Local_ShareStr]", cMETE_Download_Upload_Path.Server_ShareStr);
            Server_Folder_CAM = Server_Folder_CAM.Replace("[Oper1]", PartInfo.OpNum);
            long FileTime = new long();
            for (int i = 0; i < FolderFile.Length; i++)
            {
                System.IO.FileInfo ExcelInfo = new System.IO.FileInfo(FolderFile[i]);
                if (ExcelInfo.LastAccessTime.ToFileTime() > FileTime)
                {
                    FileTime = ExcelInfo.LastAccessTime.ToFileTime();
                    sExcelDirData.ExcelShopDocLocalDir  = FolderFile[i];
                    sExcelDirData.ExcelShopDocServerDir = string.Format(@"{0}\{1}", Server_Folder_CAM, ExcelInfo.Name);
                }
            }
            if (File.Exists(sExcelDirData.ExcelShopDocLocalDir))
            {
                listView1.Items.Add(Path.GetFileName(sExcelDirData.ExcelShopDocLocalDir));
            }
            #endregion

            #region 處理NC程式的路徑
            string Local_NC_Folder = string.Format(@"{0}\{1}", cMETE_Download_Upload_Path.Local_Folder_CAM, "NC");
            if (Directory.Exists(Local_NC_Folder))
            {
                sNCProgramDirData.NCProgramLocalDir  = Local_NC_Folder;
                sNCProgramDirData.NCProgramServerDir = string.Format(@"{0}\{1}", Server_Folder_CAM, "NC");
                listView1.Items.Add("NC資料夾");
            }
            #endregion
        }