/// <summary>
        /// Load a list of facts and eventlogs in the fields.
        /// </summary>
        /// <param name="field"></param>
        /// <author>Bernhard Bruns,Thomas Meents, Moritz Eversmann</author>
        public static bool LoadFactsInField(Field field)
        {
            try
            {
                List <List <Case> > listOfFacts = DBWorker.GetFacts(MainWindow.MatrixSelection.SelectedDimensions, EventSelectionModel.GetInstance().SelectedDimensions, field);

                foreach (List <Case> fact in listOfFacts)
                {
                    if (fact != null)
                    {
                        field.EventLog.Cases.AddRange(fact);
                    }
                }

                return(true);
            }
            catch (TimeoutException ex)
            {
                ErrorHandling.ReportErrorToUser("Error: Database Timeout. " + ex.Message);
            }
            catch (Exception ex)
            {
                if (ex is NoParamsGivenException || ex is NotImplementedException || ex is ArgumentException)
                {
                    ErrorHandling.ReportErrorToUser("Error: " + ex.Message);
                }
                else
                {
                    throw;
                }
            }

            return(false);
        }
Esempio n. 2
0
 public void GetFactsException()
 {
     DBWorker.GetFacts(null, null, null);
     Assert.Fail("An Exception was expected");
 }