Esempio n. 1
0
        private void checkTestStartButton_Click(object sender, RoutedEventArgs e)
        {
            if (checkFileTextBox.Text == "")
            {
                MessageBox.Show("경로를 입력해주세요.");
            }
            else if (!(IsServerName(checkFileTextBox.Text)))
            {
                MessageBox.Show("서버 파일 경로가 올바르지 않습니다.");
            }
            else
            {
                myFileRep = new MediaFileRepository(checkFileTextBox.Text, serverName);
                if (myFileRep.FindFlag) // txt또는 csv파일이 있을 경우에만 실행
                {
                    myFileRep.SortDataTable("systemResult");
                    App.DataMediaWin = DataMediaWindow.DataMediaWinObj;

                    App.DataMediaWin.ResultFilePath = JobEventHandler.MakeServerDir(checkFileTextBox.Text, serverName); // 파일 생성 및 저장 좌표 재정의
                    if (App.DataMediaWin.ResultFilePath != "0")                                                         //오류가 아닐시에
                    {
                        JobEventHandler.InputDataSave(myFileRep.MyDataTable, App.DataMediaWin.ResultFilePath);          // 파일 저장

                        App.DataMediaWin.MediaFilePath = App.DataMediaWin.ResultFilePath.Replace("\\" + serverName + ".csv", "");
                        Console.WriteLine("미디어 경로 : " + App.DataMediaWin.MediaFilePath);
                        App.DataMediaWin.ServerName = this.serverName;
                        App.DataMediaWin.MyFileRep  = this.myFileRep;

                        App.DataMediaWin.Show();
                        App.DataMediaWin.WindowStart();
                        this.Hide();
                    }
                }
            }
        }
 private void SubmitAct()
 {
     if (HumanJobCheck())
     {
         return;
     }
     // 제출하기
     showWin.HumanResultAdjust(currentIndex, humanResultTxt.Text);
     MyFileRep.MyDataTable.Rows[currentIndex][1] = humanResultTxt.Text;
     CurrentIndexPlus();
     currentJobRowPlus();
     WindowStatusUpdate(currentIndex);
     JobEventHandler.InputDataSave(myFileRep.MyDataTable, resultFilePath);
 }
        private void saveAndCheckBtn_Click(object sender, RoutedEventArgs e)
        {
            myMediaPlayer.Pause();
            // 검증 시 데이터 값이 초기화 되지 않는 현상
            currentIndex  = 0;
            fullJobCount  = 0;
            currentJobRow = 0;
            // END

            JobEventHandler.EndingJob(myFileRep.MyDataTable, mediaFilePath);
            MyFileRep.SortDataTable("fileName");
            JobEventHandler.InputDataSave(myFileRep.MyDataTable, resultFilePath);
            MessageBox.Show("작업 완료");
            this.Hide();
            showWin.Hide();
            App.FileSelectWin.Show();
            App.FileSelectWin.checkFileTextBox.Text = "";
        }
        private void endZipBtn_Click(object sender, RoutedEventArgs e)
        {
            myMediaPlayer.Pause();
            if (jobRateTxt.Text != "100.0")
            {
                if ((MessageBox.Show("진행률이 100% 미만입니다. 그래도 압축하시겠습니까?", "압축", MessageBoxButton.YesNo)) == MessageBoxResult.No)
                {
                    myMediaPlayer.Play();
                    return;
                }
            }
            string savePath = FileDialogManager.ReturnFolderOpenDialog();

            if (savePath != "" && savePath != mediaFilePath)
            {
                JobEventHandler.EndingJob(myFileRep.MyDataTable, mediaFilePath);
                MyFileRep.SortDataTable("fileName");
                JobEventHandler.InputDataSave(myFileRep.MyDataTable, resultFilePath);
                JobEventHandler.CompressZipByIonic(mediaFilePath, savePath + "\\" + serverName + ".zip");
                MessageBox.Show("압축 완료");

                this.Hide();
                showWin.Hide();
                App.FileSelectWin.Show();
                App.FileSelectWin.checkFileTextBox.Text = "";

                // 검증 시 데이터 값이 초기화 되지 않는 현상
                currentIndex  = 0;
                fullJobCount  = 0;
                currentJobRow = 0;
                // END
            }
            else if (savePath == mediaFilePath)
            {
                MessageBox.Show("미디어 파일 경로와 저장 경로를 다르게 해주세요.");
            }
            else if (savePath == "")
            {
            }
            else
            {
                MessageBox.Show("경로 오류");
            }
        }
        private void DelRowAct()
        {
            //행 및 파일 삭제하기

            /*
             * FileInfo fileDel = new FileInfo(mediaFilePath + "\\" + MyFileRep.MyDataTable.Rows[currentIndex][0]);
             * fileDel.Delete();
             * DataRow dr = MyFileRep.MyDataTable.Rows[currentIndex];
             * dr.Delete();
             * currentJobRow++;
             * WindowStatusUpdate(currentIndex);
             * JobEventHandler.InputDataSave(myFileRep.MyDataTable, resultFilePath);
             */
            // 퍼포먼스 문제로 닫아둠
            showWin.HumanResultAdjust(currentIndex, "0");
            MyFileRep.MyDataTable.Rows[currentIndex][1] = "0";
            realFileCount--;
            CurrentIndexPlus();
            currentJobRowPlus();
            WindowStatusUpdate(currentIndex);
            JobEventHandler.InputDataSave(myFileRep.MyDataTable, resultFilePath);
        }