//public static string label001BilletPath = "";//001胚料檔路徑 //public static string labelWBilletPath = "";//W胚料檔路徑 //public static string label900BilletPath = "";//900胚料檔路徑 public MEOpenTaskDlg() { InitializeComponent(); //判斷是否有關閉所有檔案 panel = superGridPanel.PrimaryGrid; //取得METEDownload_Upload.dat資料 sDownUpLoadDat = new CaxDownUpLoad.DownUpLoadDat(); status = CaxDownUpLoad.GetDownUpLoadDat(out sDownUpLoadDat); if (!status) { return; } //status = CaxGetDatData.GetMETEDownload_Upload(out cMETE_Download_Upload_Path); //if (!status) //{ // MessageBox.Show("取得METEDownload_Upload.dat資料失敗"); // return; //} //取得客戶資料夾 Local_CusPathAry = Directory.GetDirectories(CaxEnv.GetLocalTaskDir()); foreach (string item in Local_CusPathAry) { comboBoxCus.Items.Add(Path.GetFileNameWithoutExtension(item)); } //關閉下拉選單-料號&客戶版次&製程版次 comboBoxPartNo.Enabled = false; comboBoxCusVer.Enabled = false; comboBoxOpVer.Enabled = false; }
public TEOpenTaskDlg() { InitializeComponent(); panel = superGridPanel.PrimaryGrid; //取得METEDownload_Upload.dat資料 sDownUpLoadDat = new CaxDownUpLoad.DownUpLoadDat(); status = CaxDownUpLoad.GetDownUpLoadDat(out sDownUpLoadDat); if (!status) { return; } //更新客戶資料 Local_CusPathAry = Directory.GetDirectories(CaxEnv.GetLocalTaskDir()); foreach (string item in Local_CusPathAry) { comboBoxCus.Items.Add(Path.GetFileNameWithoutExtension(item)); } //關閉下拉選單-料號&客戶版次&製程版次 comboBoxPartNo.Enabled = false; comboBoxCusVer.Enabled = false; comboBoxOpVer.Enabled = false; }
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資料 sDownUpLoadDat = new CaxDownUpLoad.DownUpLoadDat(); status = CaxDownUpLoad.GetDownUpLoadDat(out sDownUpLoadDat); if (!status) { return; } //status = CaxGetDatData.GetMETEDownload_Upload(out cMETE_Download_Upload_Path); //if (!status) //{ // MessageBox.Show("取得METEDownload_Upload_New失敗"); // return; //} }
private void TEUploadDlg_Load(object sender, EventArgs e) { //取得METEDownload_Upload.dat sDownUpLoadDat = new CaxDownUpLoad.DownUpLoadDat(); status = CaxDownUpLoad.GetDownUpLoadDat(out sDownUpLoadDat); if (!status) { return; } //拆解出客戶、料號、客戶版次、製程版次、製程序 cCaxTEUpLoad = new CaxTEUpLoad(); status = cCaxTEUpLoad.SplitPartFullPath(displayPart.FullPath); if (!status) { return; } //取得料號 PartNoLabel.Text = cCaxTEUpLoad.PartName; OISLabel.Text = cCaxTEUpLoad.OpNum; //將Local_Folder_CAM先暫存起來,然後改變成Server路徑 //tempLocal_Folder_CAM = cMETE_Download_Upload_Path.Local_Folder_CAM; //取代正確路徑 status = CaxDownUpLoad.ReplaceDatPath(sDownUpLoadDat.Server_IP, sDownUpLoadDat.Local_IP, cCaxTEUpLoad.CusName, cCaxTEUpLoad.PartName, cCaxTEUpLoad.CusRev, cCaxTEUpLoad.OpRev, ref sDownUpLoadDat); if (!status) { return; } sDownUpLoadDat.Server_Folder_CAM = sDownUpLoadDat.Server_Folder_CAM.Replace("[Oper1]", cCaxTEUpLoad.OpNum); sDownUpLoadDat.Server_Folder_OIS = sDownUpLoadDat.Server_Folder_OIS.Replace("[Oper1]", cCaxTEUpLoad.OpNum); sDownUpLoadDat.Local_Folder_CAM = sDownUpLoadDat.Local_Folder_CAM.Replace("[Oper1]", cCaxTEUpLoad.OpNum); sDownUpLoadDat.Local_Folder_OIS = sDownUpLoadDat.Local_Folder_OIS.Replace("[Oper1]", cCaxTEUpLoad.OpNum); //拆零件路徑字串取得客戶名稱、料號、版本 //status = PartExcelNC.GetPartData(displayPart,out sPartInfo); //if (!status) //{ // MessageBox.Show("取得客戶名稱、料號、版本失敗,請聯繫開發工程師"); // this.Close(); //} #region (註解中)取代路徑字串 /* * 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]", sPartInfo.CusName); * cMETE_Download_Upload_Path.Server_ShareStr = cMETE_Download_Upload_Path.Server_ShareStr.Replace("[PartNo]", sPartInfo.PartNo); * cMETE_Download_Upload_Path.Server_ShareStr = cMETE_Download_Upload_Path.Server_ShareStr.Replace("[CusRev]", sPartInfo.CusRev); * Server_OP_Folder = string.Format(@"{0}\{1}", cMETE_Download_Upload_Path.Server_ShareStr, "OP" + sPartInfo.OpNum); * * //將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]", sPartInfo.CusName); * cMETE_Download_Upload_Path.Local_ShareStr = cMETE_Download_Upload_Path.Local_ShareStr.Replace("[PartNo]", sPartInfo.PartNo); * cMETE_Download_Upload_Path.Local_ShareStr = cMETE_Download_Upload_Path.Local_ShareStr.Replace("[CusRev]", sPartInfo.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]", sPartInfo.OpNum); */ #endregion //處理Part的路徑 status = CaxUpLoad.GetComponentPath(displayPart, sDownUpLoadDat, ref DicPartDirData); if (!status) { return; } string[] keys = new string[DicPartDirData.Count]; DicPartDirData.Keys.CopyTo(keys, 0); listBox1.Items.AddRange(keys); //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]", sPartInfo.OpNum); //整個CAM資料夾上傳 listBox1.Items.Add("資料夾:"); listBox1.Items.Add(sDownUpLoadDat.Local_Folder_CAM); #region (註解)處理Excel的路徑 /* * string[] FolderFile = System.IO.Directory.GetFileSystemEntries(cMETE_Download_Upload_Path.Local_Folder_CAM, "*.xls"); * 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 }
private void MEUploadDlg_Load(object sender, EventArgs e) { ExportPFD.Checked = true; //取得DownUpLoadDat資料 sDownUpLoadDat = new CaxDownUpLoad.DownUpLoadDat(); status = CaxDownUpLoad.GetDownUpLoadDat(out sDownUpLoadDat); if (!status) { return; } //CaxGetDatData.GetMETEDownload_Upload(out cMETE_Download_Upload_Path); //拆解出客戶、料號、客戶版次、製程版次、製程序 cCaxMEUpLoad = new CaxMEUpLoad(); status = cCaxMEUpLoad.SplitPartFullPath(displayPart.FullPath); if (!status) { return; } //取得料號 PartNoLabel.Text = cCaxMEUpLoad.PartName; OISLabel.Text = cCaxMEUpLoad.OpNum; //將Local_Folder_OIS先暫存起來,然後改變成Server路徑 //tempLocal_Folder_OIS = cMETE_Download_Upload_Path.Local_Folder_OIS; //取代正確路徑 status = CaxDownUpLoad.ReplaceDatPath(sDownUpLoadDat.Server_IP, sDownUpLoadDat.Local_IP, cCaxMEUpLoad.CusName, cCaxMEUpLoad.PartName, cCaxMEUpLoad.CusRev, cCaxMEUpLoad.OpRev, ref sDownUpLoadDat); if (!status) { return; } sDownUpLoadDat.Server_Folder_CAM = sDownUpLoadDat.Server_Folder_CAM.Replace("[Oper1]", cCaxMEUpLoad.OpNum); sDownUpLoadDat.Server_Folder_OIS = sDownUpLoadDat.Server_Folder_OIS.Replace("[Oper1]", cCaxMEUpLoad.OpNum); sDownUpLoadDat.Local_Folder_CAM = sDownUpLoadDat.Local_Folder_CAM.Replace("[Oper1]", cCaxMEUpLoad.OpNum); sDownUpLoadDat.Local_Folder_OIS = sDownUpLoadDat.Local_Folder_OIS.Replace("[Oper1]", cCaxMEUpLoad.OpNum); //status = CaxPublic.GetAllPath("ME", displayPart.FullPath, out sPartInfo, ref cMETE_Download_Upload_Path); //if (!status) //{ // MessageBox.Show("取得路徑或拆分路徑失敗"); // this.Close(); // return; //} //處理Part的路徑 status = CaxMEUpLoad.GetComponentPath(displayPart, sDownUpLoadDat, ref DicPartDirData); if (!status) { return; } string[] keys = new string[DicPartDirData.Count]; DicPartDirData.Keys.CopyTo(keys, 0); listBox1.Items.AddRange(keys); //status = Function.GetComponentPath(displayPart, cMETE_Download_Upload_Path, listView1, out TEDownloadText, ref DicPartDirData); //if (!status) //{ // MessageBox.Show("零件路徑取得失敗,無法上傳"); // this.Close(); // return; //} #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>(); * List<string> List_ExcelFQC = 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); * } * if (i.Contains("FQC")) * { * List_ExcelFQC.Add(i); * } * } * * long ExcelIPQCFileTime = new long(); * long ExcelSelfCheckFileTime = new long(); * long ExcelIQCFileTime = new long(); * long ExcelFAIFileTime = new long(); * long ExcelFQCFileTime = 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 * #region 處理FQC * foreach (string i in List_ExcelFQC) * { * System.IO.FileInfo ExcelInfo = new System.IO.FileInfo(i); * if (ExcelInfo.LastAccessTime.ToFileTime() > ExcelFQCFileTime) * { * ExcelFQCFileTime = ExcelInfo.LastAccessTime.ToFileTime(); * sExcelDirData.ExcelFQCLocalDir = 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.ExcelFQCServerDir = string.Format(@"{0}\{1}", Server_Folder_OIS, ExcelInfo.Name); * } * } * if (List_ExcelFQC.Count != 0) * { * listView1.Items.Add(Path.GetFileName(sExcelDirData.ExcelFQCLocalDir)); * } #endregion */ #endregion }