Exemplo n.º 1
0
        private void DeleteSelectedExecutionResults(object sender, System.Windows.RoutedEventArgs e)
        {
            if ((Reporter.ToUser(eUserMsgKey.ExecutionsResultsToDelete)) == Amdocs.Ginger.Common.eUserMsgSelection.Yes)
            {
                foreach (RunSetReport runSetReport in grdExecutionsHistory.Grid.SelectedItems)
                {
                    if (runSetReport.DataRepMethod == ExecutionLoggerConfiguration.DataRepositoryMethod.LiteDB)
                    {
                        LiteDbManager       dbManager  = new LiteDbManager(WorkSpace.Instance.Solution.LoggerConfigurations.CalculatedLoggerFolder);
                        var                 result     = dbManager.GetRunSetLiteData();
                        List <LiteDbRunSet> filterData = null;
                        filterData = result.IncludeAll().Find(a => a._id.ToString() == runSetReport.GUID).ToList();

                        LiteDbConnector dbConnector = new LiteDbConnector(Path.Combine(mRunSetExecsRootFolder, "GingerExecutionResults.db"));
                        dbConnector.DeleteDocumentByLiteDbRunSet(filterData[0]);
                        break;
                    }
                    string runSetFolder = executionLoggerHelper.GetLoggerDirectory(runSetReport.LogFolder);

                    var fi = new DirectoryInfo(runSetFolder);
                    CleanDirectory(fi.FullName);
                    fi.Delete();
                }

                if (grdExecutionsHistory.Grid.SelectedItems.Count > 0)
                {
                    LoadExecutionsHistoryData();
                }
            }
        }
Exemplo n.º 2
0
        private void DeleteExecutionReports(System.Collections.IList runSetReports)
        {
            foreach (RunSetReport runSetReport in runSetReports)
            {
                if (runSetReport.DataRepMethod == ExecutionLoggerConfiguration.DataRepositoryMethod.LiteDB)
                {
                    LiteDbManager       dbManager  = new LiteDbManager(executionLoggerHelper.GetLoggerDirectory(WorkSpace.Instance.Solution.LoggerConfigurations.CalculatedLoggerFolder));
                    var                 result     = dbManager.GetRunSetLiteData();
                    List <LiteDbRunSet> filterData = null;
                    filterData = result.IncludeAll().Find(a => a._id.ToString() == runSetReport.GUID).ToList();

                    LiteDbConnector dbConnector = new LiteDbConnector(Path.Combine(mRunSetExecsRootFolder, "GingerExecutionResults.db"));
                    dbConnector.DeleteDocumentByLiteDbRunSet(filterData[0]);
                }
                else
                {
                    string runSetFolder = executionLoggerHelper.GetLoggerDirectory(runSetReport.LogFolder);

                    var fi = new DirectoryInfo(runSetFolder);
                    CleanDirectory(fi.FullName);
                    fi.Delete();
                }
            }

            if (grdExecutionsHistory.Grid.SelectedItems.Count > 0)
            {
                LoadExecutionsHistoryData();
            }
        }