예제 #1
0
        public void Initialize(string _ProjectName, string _ProjectType)
        {
            ProjectName = _ProjectName;
            ProjectType = _ProjectType;

            if (ProjectType == "DISPENSER")
            {
                ScreenshotIndex = 4;
            }
            else
            {
                ScreenshotIndex = 4;
            }

            DateTime TimeNow = DateTime.Now;

            SelectDateFrom = String.Format("{0:D4}-{1:D2}-{2:D2}", TimeNow.Year, TimeNow.Month, TimeNow.Day);
            SelectDateTo   = String.Format("{0:D4}-{1:D2}-{2:D2}", TimeNow.Year, TimeNow.Month, TimeNow.Day);

            monthCalendarFrom.SetDate(TimeNow);
            monthCalendarTo.SetDate(TimeNow);

            HistoryToolTip.SetToolTip(btnSelectView, "View selected period");
            HistoryToolTip.SetToolTip(btnAllview, "View all");
            HistoryToolTip.SetToolTip(btnSelectDelete, "Delete selected Period");
            HistoryToolTip.SetToolTip(btnAllDelete, "Delete All");

            SqliteManager.SetHistoryFolderPath(ProjectName);
        }
예제 #2
0
        //LDH, 2019.06.28, DB에서 특정 Column에 있는 데이터 유형 찾기
        private List <string> SearchColumnName(string _ColumnName)
        {
            List <string> _GetDataList = new List <string>();

            SqliteManager.SqlDistinct(ref _GetDataList, _ColumnName);

            return(_GetDataList);
        }
예제 #3
0
 public bool CheckDBFile()
 {
     if (SqliteManager.CheckDirectory() == null)
     {
         MessageBox.Show(new Form {
             TopMost = true
         }, "DB File not found."); return(false);
     }
     else
     {
         return(true);
     }
 }
예제 #4
0
        private void SetSearchCondition()
        {
            if (ckbRecipe.Checked == true)
            {
                List <string> RecipeList = new List <string>();

                for (int iLoopCount = 0; iLoopCount < Recipecount; iLoopCount++)
                {
                    if (ckListBoxRecipe.GetItemChecked(iLoopCount))
                    {
                        RecipeList.Add(ckListBoxRecipe.Items[iLoopCount].ToString());
                    }
                }
                SqliteManager.SqlSetSearchCondition(ckbRecipe.Text, ckbRecipe.Checked, RecipeList);
            }
            else
            {
                SqliteManager.SqlSetSearchConditionClear(ckbRecipe.Text, false);
            }

            if (ckbResult.Checked == true)
            {
                List <string> NGResultList = new List <string>();
                NGResultList.Add(comboBoxResult.Text);
                SqliteManager.SqlSetSearchCondition(ckbResult.Text, ckbResult.Checked, NGResultList);
            }
            else
            {
                SqliteManager.SqlSetSearchConditionClear(ckbResult.Text, false);
            }

            if (ckbNGType.Checked == true)
            {
                List <string> NGTypeList = new List <string>();

                for (int iLoopCount = 0; iLoopCount < ckListBoxNGType.Items.Count; iLoopCount++)
                {
                    if (ckListBoxNGType.GetItemChecked(iLoopCount))
                    {
                        NGTypeList.Add(ckListBoxNGType.Items[iLoopCount].ToString());
                    }
                }
                SqliteManager.SqlSetSearchCondition("NGType", ckbNGType.Checked, NGTypeList);
            }
            else
            {
                SqliteManager.SqlSetSearchConditionClear("NGType", false);
            }

            GC.Collect();
        }
예제 #5
0
        public void SetDataGridViewHistory(bool SelectDate, string SelectSQL, string SelectedDateFrom = null, string SelectedDateTo = null)
        {
            ClearDataGridViewHistory();

            SetSearchCondition();

            switch (SelectSQL)
            {
            case "Open": dataGridViewHistory.DataSource = SqliteManager.SqlOpen(SelectDate, SelectedDateFrom, SelectedDateTo).Tables[0]; break;

            case "Delete": dataGridViewHistory.DataSource = SqliteManager.SqlDelete(SelectDate, SelectedDateFrom, SelectedDateTo).Tables[0]; break;
            }

            dataGridViewHistory.Refresh();
            //GridViewInitialize();
        }
예제 #6
0
        //LDH, 2016.12.13 Inspection ScreenShot 삭제
        private void DeleteScreenShot(bool _DeleteAll)
        {
            string ScreenShotpath;

            ScreenShotpath = SqliteManager.SqlGetScreenshotPath();

            if (ScreenShotpath == null)
            {
                MessageBox.Show(new Form {
                    TopMost = true
                }, "History File is not found."); return;
            }

            char Character = '\\';

            string[] SplitFolderName = ScreenShotpath.Split(Character);
            int      FolderLength    = SplitFolderName.Length;

            string RemoveFolderPath = "";
            string DeleteFolder;

            int YearIndex = 0;

            for (int iLoopCount = 0; iLoopCount < 5; iLoopCount++)
            {
                //폴더 경로내에 최근 5년 까지의 폴더이름이 있는지 체크
                YearIndex = Array.IndexOf(SplitFolderName, (DateTime.Now.Year - iLoopCount).ToString());
                if (YearIndex != -1)
                {
                    break;
                }
            }

            //TrimForm 부터 아래 코드로 변경
            //RemoveFolderPath = String.Format(@"\{0}\{1}\{2}\{3}", SplitFolderName[FolderLength - 4], SplitFolderName[FolderLength - 3], SplitFolderName[FolderLength - 2], SplitFolderName[FolderLength - 1]);
            for (int jLoopCount = YearIndex; jLoopCount < SplitFolderName.Length; jLoopCount++)
            {
                RemoveFolderPath = RemoveFolderPath + "\\" + SplitFolderName[jLoopCount];
            }
            ScreenShotpath = ScreenShotpath.Replace(RemoveFolderPath, "");

            //Year 폴더 삭제
            DirectoryInfo DeleteYearFolderInfo = new DirectoryInfo(ScreenShotpath);

            if (DeleteYearFolderInfo.Exists)
            {
                DirectoryInfo[] YearFolderInfo = DeleteYearFolderInfo.GetDirectories();
                foreach (DirectoryInfo YearFolder in YearFolderInfo)
                {
                    if (_DeleteAll)
                    {
                        if (Convert.ToInt32(YearFolder.Name) <= Convert.ToInt32(DateTime.Now.Year))
                        {
                            DeleteFolder = String.Format("{0}\\{1}", ScreenShotpath, YearFolder.Name);
                            Directory.Delete(DeleteFolder, true);
                        }
                    }
                    else
                    {
                        if (Convert.ToInt32(YearFolder.Name) < Convert.ToInt32(SplitFolderName[YearIndex]))
                        {
                            DeleteFolder = String.Format("{0}\\{1}", ScreenShotpath, YearFolder.Name);
                            Directory.Delete(DeleteFolder, true);
                        }
                    }
                }
                DeleteYearFolderInfo.Refresh();
            }

            //Month 폴더 삭제
            ScreenShotpath = String.Format("{0}\\{1}", ScreenShotpath, SplitFolderName[YearIndex]);
            DirectoryInfo DeleteMonthFolderInfo = new DirectoryInfo(ScreenShotpath);

            if (DeleteMonthFolderInfo.Exists)
            {
                DirectoryInfo[] MonthFolderInfo = DeleteMonthFolderInfo.GetDirectories();
                foreach (DirectoryInfo MonthFolder in MonthFolderInfo)
                {
                    if (Convert.ToInt32(MonthFolder.Name) < Convert.ToInt32(SplitFolderName[YearIndex + 1]))
                    {
                        DeleteFolder = String.Format("{0}\\{1}", ScreenShotpath, MonthFolder.Name);
                        Directory.Delete(DeleteFolder, true);
                    }
                }
                DeleteMonthFolderInfo.Refresh();
            }

            //Day 폴더 삭제
            ScreenShotpath = String.Format("{0}\\{1}", ScreenShotpath, SplitFolderName[YearIndex + 1]);
            DirectoryInfo DeleteDayFolderInfo = new DirectoryInfo(ScreenShotpath);

            if (DeleteDayFolderInfo.Exists)
            {
                DirectoryInfo[] DayFolderInfo = DeleteDayFolderInfo.GetDirectories();
                foreach (DirectoryInfo DayFolder in DayFolderInfo)
                {
                    if (Convert.ToInt32(DayFolder.Name) < Convert.ToInt32(SplitFolderName[YearIndex + 2]))
                    {
                        DeleteFolder = String.Format("{0}\\{1}", ScreenShotpath, DayFolder.Name);
                        Directory.Delete(DeleteFolder, true);
                    }
                }
                DeleteDayFolderInfo.Refresh();
            }
        }
예제 #7
0
        //LDH, 2016.12.13 Inspection ScreenShot 삭제
        private void DeleteScreenShot()
        {
            string ScreenShotpath;

            ScreenShotpath = SqliteManager.SqlGetScreenshotPath();

            if (ScreenShotpath == null)
            {
                MessageBox.Show(new Form {
                    TopMost = true
                }, "History File is not found."); return;
            }

            char Character = '\\';

            string[] SplitFolderName = ScreenShotpath.Split(Character);
            int      FolderLength    = SplitFolderName.Length;

            string RemoveFolderPath;
            string DeleteFolder;

            RemoveFolderPath = String.Format(@"\{0}\{1}\{2}\{3}", SplitFolderName[FolderLength - 4], SplitFolderName[FolderLength - 3], SplitFolderName[FolderLength - 2], SplitFolderName[FolderLength - 1]);
            ScreenShotpath   = ScreenShotpath.Replace(RemoveFolderPath, "");

            //Year 폴더 삭제
            DirectoryInfo DeleteYearFolderInfo = new DirectoryInfo(ScreenShotpath);

            if (DeleteYearFolderInfo.Exists)
            {
                DirectoryInfo[] YearFolderInfo = DeleteYearFolderInfo.GetDirectories();
                foreach (DirectoryInfo YearFolder in YearFolderInfo)
                {
                    if (Convert.ToInt32(YearFolder.Name) < Convert.ToInt32(SplitFolderName[FolderLength - 4]))
                    {
                        DeleteFolder = String.Format("{0}\\{1}", ScreenShotpath, YearFolder.Name);
                        Directory.Delete(DeleteFolder, true);
                    }
                }
            }

            //Month 폴더 삭제
            ScreenShotpath = String.Format("{0}\\{1}", ScreenShotpath, SplitFolderName[FolderLength - 4]);
            DirectoryInfo DeleteMonthFolderInfo = new DirectoryInfo(ScreenShotpath);

            if (DeleteMonthFolderInfo.Exists)
            {
                DirectoryInfo[] MonthFolderInfo = DeleteMonthFolderInfo.GetDirectories();
                foreach (DirectoryInfo MonthFolder in MonthFolderInfo)
                {
                    if (Convert.ToInt32(MonthFolder.Name) < Convert.ToInt32(SplitFolderName[FolderLength - 3]))
                    {
                        DeleteFolder = String.Format("{0}\\{1}", ScreenShotpath, MonthFolder.Name);
                        Directory.Delete(DeleteFolder, true);
                    }
                }
            }

            //Day 폴더 삭제
            ScreenShotpath = String.Format("{0}\\{1}", ScreenShotpath, SplitFolderName[FolderLength - 2]);
            DirectoryInfo DeleteDayFolderInfo = new DirectoryInfo(ScreenShotpath);

            if (DeleteDayFolderInfo.Exists)
            {
                DirectoryInfo[] DayFolderInfo = DeleteDayFolderInfo.GetDirectories();
                foreach (DirectoryInfo DayFolder in DayFolderInfo)
                {
                    if (Convert.ToInt32(DayFolder.Name) < Convert.ToInt32(SplitFolderName[FolderLength - 1]))
                    {
                        DeleteFolder = String.Format("{0}\\{1}", ScreenShotpath, DayFolder.Name);
                        Directory.Delete(DeleteFolder, true);
                    }
                }
            }
        }
예제 #8
0
        /// <summary>
        /// Error 코드를 저장
        /// </summary>
        /// <param name="strKey"></param>
        /// <param name="strErrLevel"></param>
        /// <param name="strErrMsg"></param>
        /// <returns></returns>

        public static int HistoryInsertQuery(string HistoryItem, bool _CreateTable, string _CreateComm = "")
        {
            return(SqliteManager.SqlExecute(HistoryItem, _CreateTable, _CreateComm));
        }