public bool AnalizeCruise() { var srcFile = GetTempFilePath(".crz3", "HasDesignKeyChanges_srcFile"); var destFile = GetTempFilePath(".crz3", "HasDesignKeyChanges_destFile"); var cruiseID = CruiseID; using (var srcDb = CreateDatabaseFile(srcFile)) using (var destDb = CreateDatabaseFile(destFile)) { var cruiseChecker = new CruiseChecker(); var cruiseConflicts = cruiseChecker.GetCruiseConflicts(srcDb, destDb, cruiseID); var isCruiseInConflict = cruiseConflicts.Any(); var saleConflicts = cruiseChecker.GetSaleConflicts(srcDb, destDb, cruiseID); var isSaleInConflict = saleConflicts.Any(); var plotConflicts = cruiseChecker.GetPlotConflicts(srcDb, destDb, cruiseID); var treeConflicts = cruiseChecker.GetTreeConflicts(srcDb, destDb, cruiseID); var logConflicts = cruiseChecker.GetLogConflicts(srcDb, destDb, cruiseID); var hasDesignKeyChanges = cruiseChecker.HasDesignKeyChanges(srcDb, destDb, cruiseID); return(plotConflicts.Count() == 0 && treeConflicts.Count() == 0 && logConflicts.Count() == 0 && !hasDesignKeyChanges && !isCruiseInConflict && !isSaleInConflict); } }
public void HasDesignKeyChanges() { var srcFile = GetTempFilePath(".crz3", "HasDesignKeyChanges_srcFile"); var destFile = GetTempFilePath(".crz3", "HasDesignKeyChanges_destFile"); using (var srcDb = CreateDatabaseFile(srcFile)) using (var desDb = CreateDatabaseFile(destFile)) { var cc = new CruiseChecker(); var result = cc.HasDesignKeyChanges(srcDb, desDb, CruiseID); } }