Exemple #1
0
        private void OpRevcomboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            //清空ListView資訊
            listBox1.Items.Clear();
            //取得當前選取的製程版次
            //CurrentOpRev = OpRevcomboBox.Text;
            //打開&清空下拉選單-製程序
            Oper1comboBox.Enabled = true;
            Oper1comboBox.Items.Clear();
            Oper1comboBox.Text = "";

            //取得PECreateData.dat
            string PECreateData_Path = string.Format(@"{0}\{1}\{2}\{3}\{4}\{5}\{6}", CaxEnv.GetGlobaltekTaskDir(), comboBoxCusName.Text, PartNocomboBox.Text, CusRevcomboBox.Text, OpRevcomboBox.Text, "MODEL", "PECreateData.dat");

            if (!File.Exists(PECreateData_Path))
            {
                CaxLog.ShowListingWindow("此料號沒有舊資料檔案,請檢查PECreateData.dat");
                return;
            }
            CaxPE.ReadPECreateData(PECreateData_Path, out cPECreateData);

            Oper1comboBox.Items.AddRange(cPECreateData.oper1Ary.ToArray());

            Oper1comboBox.Items.Add("全部下載");
        }
Exemple #2
0
        private void comboBoxOldCusRev_SelectedIndexChanged(object sender, EventArgs e)
        {
            //清空superGrid資料
            panel.Rows.Clear();
            //取得當前選取的客戶版次
            CurrentOldCusRev = comboBoxOldCusRev.Text;

            //取得PECreateData.dat
            string PECreateData_Path = string.Format(@"{0}\{1}\{2}\{3}\{4}\{5}", CaxEnv.GetGlobaltekTaskDir(), CurrentOldCusName, CurrentOldPartNo, CurrentOldCusRev, "MODEL", "PECreateData.dat");

            if (!File.Exists(PECreateData_Path))
            {
                CaxLog.ShowListingWindow("此料號沒有舊資料檔案,請檢查PECreateData.dat");
                return;
            }
            CaxPE.ReadPECreateData(PECreateData_Path, out cPECreateData);

            //將舊資料填入SuperGridControl
            GridRow row = new GridRow();

            for (int i = 0; i < cPECreateData.Oper1Ary.Count; i++)
            {
                row = new GridRow(cPECreateData.Oper1Ary[i], cPECreateData.Oper2Ary[i], "刪除");
                panel.Rows.Add(row);
            }

            /*
             * //比對選擇的客戶版次取得對應的Oper並塞入SuperGridControl
             * List<string> ListOper1 = new List<string>();
             * List<string> ListOper2 = new List<string>();
             * for (int i = 0; i < cMETEDownloadData.EntirePartAry[IndexofCusName].CusPart[IndexofPartNo].CusRev.Count; i++)
             * {
             *  if (CurrentOldCusRev == cMETEDownloadData.EntirePartAry[IndexofCusName].CusPart[IndexofPartNo].CusRev[i].RevNo)
             *  {
             *      ListOper1 = cMETEDownloadData.EntirePartAry[IndexofCusName].CusPart[IndexofPartNo].CusRev[i].OperAry1;
             *      ListOper2 = cMETEDownloadData.EntirePartAry[IndexofCusName].CusPart[IndexofPartNo].CusRev[i].OperAry2;
             *  }
             * }
             *
             * GridRow row = new GridRow();
             * for (int i = 0; i < ListOper1.Count;i++ )
             * {
             *  row = new GridRow(ListOper1[i], ListOper2[i], "刪除");
             *  panel.Rows.Add(row);
             * }
             */
            Is_OldPart = true;
        }
Exemple #3
0
        private void CusRevcomboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            //清空ListView資訊
            listView.Items.Clear();
            //取得當前選取的客戶版次
            CurrentCusRev = CusRevcomboBox.Text;
            //打開&清空下拉選單-製程序
            Oper1comboBox.Enabled = true;
            Oper1comboBox.Items.Clear();
            Oper1comboBox.Text = "";

            //取得PECreateData.dat
            string PECreateData_Path = string.Format(@"{0}\{1}\{2}\{3}\{4}\{5}", CaxEnv.GetGlobaltekTaskDir(), CurrentCusName, CurrentPartNo, CurrentCusRev, "MODEL", "PECreateData.dat");

            if (!File.Exists(PECreateData_Path))
            {
                CaxLog.ShowListingWindow("此料號沒有舊資料檔案,請檢查PECreateData.dat");
                return;
            }
            CaxPE.ReadPECreateData(PECreateData_Path, out cPECreateData);

            Oper1comboBox.Items.AddRange(cPECreateData.Oper1Ary.ToArray());
            Oper1comboBox.Items.Add("全部下載");

            /*
             * //比對選擇的客戶、料號、版次取得對應的製程序並塞入下拉選單中
             * for (int i = 0; i < cMETEDownloadData.EntirePartAry[IndexofCusName].CusPart[IndexofPartNo].CusRev.Count; i++ )
             * {
             *  if (CurrentCusRev == cMETEDownloadData.EntirePartAry[IndexofCusName].CusPart[IndexofPartNo].CusRev[i].RevNo)
             *  {
             *      Oper1comboBox.Items.AddRange(cMETEDownloadData.EntirePartAry[IndexofCusName].CusPart[IndexofPartNo].CusRev[i].OperAry1.ToArray());
             *  }
             * }
             * Oper1comboBox.Items.Add("全部下載");
             */
        }
Exemple #4
0
        public PEGenerateDlg()
        {
            InitializeComponent();

            #region  客戶資料填入
            string[] S_Task_CusName = Directory.GetDirectories(CaxEnv.GetGlobaltekTaskDir());
            if (S_Task_CusName.Length == 0)
            {
                comboBoxOldCusName.Items.Add("沒有舊資料");
            }
            else
            {
                foreach (string item in S_Task_CusName)
                {
                    comboBoxOldCusName.Items.Add(Path.GetFileNameWithoutExtension(item));//走訪每個元素只取得目錄名稱(不含路徑)並加入dirlist集合中
                }
            }
            comboBoxOldPartNo.Enabled = false;
            comboBoxOldCusRev.Enabled = false;
            #endregion


            /*
             #region 舊客戶資料填入
             * //取得METEDownloadData資料
             * CaxGetDatData.GetMETEDownloadData(out cMETEDownloadData);
             * //存入下拉選單-客戶
             * for (int i = 0; i < cMETEDownloadData.EntirePartAry.Count; i++)
             * {
             *  comboBoxOldCusName.Items.Add(cMETEDownloadData.EntirePartAry[i].CusName);
             * }
             * comboBoxOldPartNo.Enabled = false;
             * comboBoxOldCusRev.Enabled = false;
             *
             #endregion
             */

            //取得CustomerName配置檔
            string CustomerName_dat    = "CustomerName.dat";
            string CustomerNameDatPath = string.Format(@"{0}\{1}", CaxPE.GetPEConfigDir(), CustomerName_dat);

            //讀取OperationArray配置檔內容,並存入結構中
            CusName cCusName = new CusName();
            CaxPE.ReadCustomerNameData(CustomerNameDatPath, out cCusName);

            //將客戶名稱填入下拉選單-客戶
            comboBoxCusName.Items.AddRange(cCusName.CustomerName.ToArray());

            //取得OperationArray配置檔
            string OperationArray_dat    = "OperationArray.dat";
            string OperationArrayDatPath = string.Format(@"{0}\{1}", CaxPE.GetPEConfigDir(), OperationArray_dat);

            //讀取OperationArray配置檔內容,並存入結構中
            CaxPE.ReadOperationArrayData(OperationArrayDatPath, out cOperationArray);

            //將Operation2Array塞入陣列Oper2StringAry中
            Oper2StringAry = cOperationArray.Operation2Array.ToArray();

            //建立GridPanel
            panel = OperSuperGridControl.PrimaryGrid;

            //設定製程別的基礎型態與數據
            panel.Columns["Oper2Ary"].EditorType   = typeof(PEComboBox);
            panel.Columns["Oper2Ary"].EditorParams = new object[] { Oper2StringAry };

            //設定刪除的基礎型態
            panel.Columns["Delete"].EditorType = typeof(OperDeleteBtn);
        }