Codebasis als Dateien ins Arbeitsrepo statt als Gitlink

QuellCode/CentronERP war nur als Gitlink (Submodul-Referenz auf 79c1142)
getrackt, ohne .gitmodules und ohne erreichbares Remote. Der
Untersuchungsgegenstand der Versuchsreihe war damit nicht reproduzierbar
gesichert: Ein Klon haette ein leeres Verzeichnis erhalten, und die Belege
der 3.287 Anforderungen waeren nicht ueberpruefbar gewesen.

Umstellung:
- Historie nach c:\DEV\CentronERP_git_snapshot_79c1142 ausgelagert
  (vollstaendig lesbar, enthaelt 79c1142 und Vorgaenger 89ccfd6)
- Gitlink aus dem Index entfernt
- Dateiinhalt aufgenommen: 24.557 Dateien, rund 333 MB

Die verschachtelte .gitignore der Codebasis gilt weiter, Build-Artefakte
bleiben ausgeschlossen. Details in Versuche/Versuch_01/_Codebasis-Nachweis.md
This commit is contained in:
Christoph Schwörer
2026-08-26 07:43:51 +02:00
parent 18edae75b6
commit f045b99a25
24664 changed files with 5846716 additions and 1 deletions
@@ -0,0 +1,288 @@
using System.Collections.Generic;
using System.Linq;
using Centron.BusinessLogic;
using Centron.BusinessLogic.Administration.Customization;
using Centron.BusinessLogic.WebServices.Accounts;
using Centron.Data.Entities.Administration.Customization;
using Centron.Interfaces;
using Centron.Interfaces.Accounts;
using Centron.Interfaces.Administration.Customization;
using Centron.Interfaces.BL;
using Centron.Tests.EndToEnd.Infrastructure;
using Xunit;
using Xunit.Abstractions;
namespace Centron.Tests.EndToEnd.Tests.Administration.Customization;
public class AccountSearchCustomPropertiesTests : EndToEndTest
{
public AccountSearchCustomPropertiesTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper)
{
}
public override void Execute()
{
var properties = PrepareAdditionalProperties();
PrepareAccountsWithCustomProperties(properties);
ExecuteAccountSearch("Search term 'Wasserschaden'", new AccountSearchFilter()
{
IsActive = true,
SearchText = "Wasserschaden"
}, new List<int>() { 4, 7 });
ExecuteAccountSearch("Search term 'C#'", new AccountSearchFilter()
{
IsActive = true,
SearchText = "C#"
}, new List<int>() { 16 });
ExecuteAccountSearch("Custom property Text 'Überflutung'", new AccountSearchFilter()
{
IsActive = true,
CustomPropertyFilterItems = new List<ModuleCustomPropertyFilterItem>()
{
new ModuleCustomPropertyFilterItem()
{
ModuleCustomPropertyI3D = properties.First(f => f.Name == "Zusatzfeld Text").I3D,
DataType = CustomizationDataTypes.Text,
Value = "Überflutung"
}
}
}, new List<int>() { 16 });
ExecuteAccountSearch("Custom property Text 'Hochwasser'", new AccountSearchFilter()
{
IsActive = true,
CustomPropertyFilterItems = new List<ModuleCustomPropertyFilterItem>()
{
new ModuleCustomPropertyFilterItem()
{
ModuleCustomPropertyI3D = properties.First(f => f.Name == "Zusatzfeld Text").I3D,
DataType = CustomizationDataTypes.Text,
Value = "Hochwasser"
}
}
}, new List<int>() { });
ExecuteAccountSearch("Custom property Integer '16'", new AccountSearchFilter()
{
IsActive = true,
CustomPropertyFilterItems = new List<ModuleCustomPropertyFilterItem>()
{
new ModuleCustomPropertyFilterItem()
{
ModuleCustomPropertyI3D = properties.First(f => f.Name == "Zusatzfeld Integer").I3D,
DataType = CustomizationDataTypes.Integer,
Value = "16"
}
}
}, new List<int>() { 16 });
ExecuteAccountSearch("Custom property ComboBox 'Web Tools'", new AccountSearchFilter()
{
IsActive = true,
CustomPropertyFilterItems = new List<ModuleCustomPropertyFilterItem>()
{
new ModuleCustomPropertyFilterItem()
{
ModuleCustomPropertyI3D = properties.First(f => f.Name == "Zusatzfeld ComboBox").I3D,
DataType = CustomizationDataTypes.ComboBox,
Value = properties.First(f => f.Name == "Zusatzfeld ComboBox").PossibleValues.First().I3D
}
}
}, new List<int>() { 4, 7 });
ExecuteAccountSearch("Custom property Boolean 'false'", new AccountSearchFilter()
{
IsActive = true,
CustomPropertyFilterItems = new List<ModuleCustomPropertyFilterItem>()
{
new ModuleCustomPropertyFilterItem()
{
ModuleCustomPropertyI3D = properties.First(f => f.Name == "Zusatzfeld Boolean").I3D,
DataType = CustomizationDataTypes.Boolean,
Value = false
}
}
}, new List<int>() { 1036 });
ExecuteAccountSearch("Search without custom properties", new AccountSearchFilter()
{
IsActive = true,
SearchText = "Sparkasse Ulm"
}, new List<int>() { 11 });
}
private void ExecuteAccountSearch(string checkCaption, AccountSearchFilter filter, List<int> shouldHaveAccountI3Ds)
{
using var session = new BLSession();
var searchResult = session.GetBL<AccountSearchWebServiceBL>().SearchAccountsThroughPaging(base.GetLoggedInUser(),filter, 1, int.MaxValue).ThrowIfError();
if (!shouldHaveAccountI3Ds.Any())
{
Assert.True(!searchResult.Result.Any(), checkCaption);
}
else
{
Assert.True(searchResult.Result.All(f => shouldHaveAccountI3Ds.Contains(f.I3D)), checkCaption);
}
}
private List<ModuleCustomProperty> PrepareAdditionalProperties()
{
using var session = new BLSession();
var properties = new List<ModuleCustomProperty>()
{
new ModuleCustomProperty()
{
Name = "Zusatzfeld Text",
Category = "Allgemein",
DataType = CustomizationDataTypes.Text,
ObjectI3D = 0,
ObjectKind = CentronObjectKindNumeric.Account,
IsVisible = true,
SortOrder = 0
},
new ModuleCustomProperty()
{
Name = "Zusatzfeld ComboBox",
Category = "Allgemein",
DataType = CustomizationDataTypes.ComboBox,
ObjectI3D = 0,
ObjectKind = CentronObjectKindNumeric.Account,
IsVisible = true,
SortOrder = 0,
PossibleValues = new List<ModuleCustomPropertyPossibleValue>()
{
new ModuleCustomPropertyPossibleValue()
{
Value = "Web Tools",
IsVisible = true
},
new ModuleCustomPropertyPossibleValue()
{
Value = "C#",
IsVisible = true
}
}
},
new ModuleCustomProperty()
{
Name = "Zusatzfeld Boolean",
Category = "Allgemein",
DataType = CustomizationDataTypes.Boolean,
ObjectI3D = 0,
ObjectKind = CentronObjectKindNumeric.Account,
IsVisible = true,
SortOrder = 0
},
new ModuleCustomProperty()
{
Name = "Zusatzfeld Integer",
Category = "Allgemein",
DataType = CustomizationDataTypes.Integer,
ObjectI3D = 0,
ObjectKind = CentronObjectKindNumeric.Account,
IsVisible = true,
SortOrder = 0
}
};
session.GetBL<ModuleCustomPropertyBL>().SaveCustomPropertyStructure(base.GetLoggedInUser(), properties, CentronObjectKindNumeric.Account).ThrowIfError();
return properties;
}
private void PrepareAccountsWithCustomProperties(List<ModuleCustomProperty> properties)
{
using var session = new BLSession();
session.GetBL<ModuleCustomPropertyValueBL>().SaveCustomPropertyValues(base.GetLoggedInUser(), 4,
CentronObjectKindNumeric.Account,
new List<ModuleCustomPropertyValue>()
{
new ModuleCustomPropertyValue()
{
ModuleCustomPropertyI3D = properties.First(f => f.Name == "Zusatzfeld Text").I3D,
ObjectI3D = 4,
ObjectKind = CentronObjectKindNumeric.Account,
ValueText = "Wasserschaden"
},
new ModuleCustomPropertyValue()
{
ModuleCustomPropertyI3D = properties.First(f => f.Name == "Zusatzfeld ComboBox").I3D,
ObjectI3D = 4,
ObjectKind = CentronObjectKindNumeric.Account,
ValueInteger = properties.First(f => f.Name == "Zusatzfeld ComboBox").PossibleValues.First().I3D
},
});
session.GetBL<ModuleCustomPropertyValueBL>().SaveCustomPropertyValues(base.GetLoggedInUser(), 7,
CentronObjectKindNumeric.Account,
new List<ModuleCustomPropertyValue>()
{
new ModuleCustomPropertyValue()
{
ModuleCustomPropertyI3D = properties.First(f => f.Name == "Zusatzfeld Text").I3D,
ObjectI3D = 7,
ObjectKind = CentronObjectKindNumeric.Account,
ValueText = "Wasserschaden"
},
new ModuleCustomPropertyValue()
{
ModuleCustomPropertyI3D = properties.First(f => f.Name == "Zusatzfeld ComboBox").I3D,
ObjectI3D = 7,
ObjectKind = CentronObjectKindNumeric.Account,
ValueInteger = properties.First(f => f.Name == "Zusatzfeld ComboBox").PossibleValues.First().I3D
},
});
session.GetBL<ModuleCustomPropertyValueBL>().SaveCustomPropertyValues(base.GetLoggedInUser(), 16,
CentronObjectKindNumeric.Account,
new List<ModuleCustomPropertyValue>()
{
new ModuleCustomPropertyValue()
{
ModuleCustomPropertyI3D = properties.First(f => f.Name == "Zusatzfeld Text").I3D,
ObjectI3D = 16,
ObjectKind = CentronObjectKindNumeric.Account,
ValueText = "Überflutung des Kellers"
},
new ModuleCustomPropertyValue()
{
ModuleCustomPropertyI3D = properties.First(f => f.Name == "Zusatzfeld ComboBox").I3D,
ObjectI3D = 16,
ObjectKind = CentronObjectKindNumeric.Account,
ValueInteger = properties.First(f => f.Name == "Zusatzfeld ComboBox").PossibleValues.Last().I3D
},
new ModuleCustomPropertyValue()
{
ModuleCustomPropertyI3D = properties.First(f => f.Name == "Zusatzfeld Integer").I3D,
ObjectI3D = 16,
ObjectKind = CentronObjectKindNumeric.Account,
ValueInteger = 16
},
new ModuleCustomPropertyValue()
{
ModuleCustomPropertyI3D = properties.First(f => f.Name == "Zusatzfeld Boolean").I3D,
ObjectI3D = 16,
ObjectKind = CentronObjectKindNumeric.Account,
ValueBoolean = true
}
});
session.GetBL<ModuleCustomPropertyValueBL>().SaveCustomPropertyValues(base.GetLoggedInUser(), 1036,
CentronObjectKindNumeric.Account,
new List<ModuleCustomPropertyValue>()
{
new ModuleCustomPropertyValue()
{
ModuleCustomPropertyI3D = properties.First(f => f.Name == "Zusatzfeld Boolean").I3D,
ObjectI3D = 1036,
ObjectKind = CentronObjectKindNumeric.Account,
ValueBoolean = false
}
});
}
}
@@ -0,0 +1,14 @@
[
{
ArticleCode: 'SERMFAE15',
IsEndOfLife: 'True'
},
{
ArticleCode: 'SERMFAE30',
IsEndOfLife: 'True'
},
{
ArticleCode: 'SERMFBE',
IsEndOfLife: 'True'
}
]
@@ -0,0 +1,50 @@
using System.Linq;
using Centron.BusinessLogic;
using Centron.BusinessLogic.EmployeeArea;
using Centron.BusinessLogic.Warehousing;
using Centron.BusinessLogic.WebServices.Employee;
using Centron.BusinessLogic.WebServices.Warehousing;
using Centron.Data.Entities.Merchandise.Articles;
using Centron.Interfaces.BL;
using Centron.Tests.EndToEnd.Infrastructure;
using Xunit;
using Xunit.Abstractions;
namespace Centron.Tests.EndToEnd.Tests.Administration.Employees;
public class EmployeeArticleParentTests : EndToEndTest
{
public EmployeeArticleParentTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper)
{
}
public override void Execute()
{
using (var session = new BLSession())
{
// Test case 1: Set article with the I3D 11 to have a parent article with I3D 14
var article = session.GetBL<ArticleWebServiceBL>().GetArticleByArticleI3D(11);
article.ParentArticleI3D = 14;
var saveResult = session.GetBL<ArticleWebServiceBL>().SaveArticle(article, base.GetLoggedInUser());
Assert.True(saveResult.Status == ResultStatus.Success, saveResult.Message);
// Test case 2: Check if we get the article with I3D 11 when searching for articles with parent article I3D 14 from Employee with I3D 14
var bl = session.GetBL<EmployeeArticleWebServiceBL>();
var searchResult = bl.GetEmployeeArticlesAsArticle(new EmployeeArticleFilter()
{
EmployeeI3D = 25,
ParentArticleI3D = 14
}, base.GetLoggedInUser().User);
Assert.True(searchResult.FirstOrDefault()?.I3D == 11, $"Expected article with I3D 11, but found: {searchResult.FirstOrDefault()?.I3D}");
// Test case 3 : Check if we can retrieve the parent article of article with I3D 11
var articleBL = session.GetBL<ArticleWebServiceBL>();
var articleSearchResult = articleBL.GetArticlesThroughPaging(ArticlePreviewSort.ArticleCode, false,
new ArticleCompactFilter()
{
IsParentArticle = true
}, 1, 100);
Assert.True(articleSearchResult.Result.First().I3D == 14, $"Expected parent article with I3D 14, but found: {articleSearchResult.Result.First().I3D}");
}
}
}
@@ -0,0 +1,153 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Centron.BusinessLogic;
using Centron.BusinessLogic.Sales.CustomerAssets.TimerBilling;
using Centron.BusinessLogic.WebServices.Employee;
using Centron.Interfaces.BL;
using Centron.Tests.EndToEnd.Infrastructure;
using CentronSoftware.Centron.WebServices.Entities.Sales.CustomerAssets.TimerBilling;
using Xunit.Abstractions;
namespace Centron.Tests.EndToEnd.Tests.Administration.Employees;
/// <summary>
/// Regression tests for ticket 168634.
/// Deactivating an employee used to delete the employee-article assignment (Mitarbeiterartikel).
/// That assignment is the only link between a recorded time and its employee in the billing modules,
/// so the deactivation silently made all already recorded times of that employee unbillable - and a
/// reactivation could not restore it.
/// These tests cover both halves of the fix: the assignment now survives a deactivation (only the
/// articles are marked as end-of-life), and the billing search falls back to the employee who
/// recorded the time when the assignment is missing.
/// </summary>
public class EmployeeDeactivationBillingTests : EndToEndTest
{
public EmployeeDeactivationBillingTests(ITestOutputHelper testOutputHelper)
: base(testOutputHelper)
{
}
public override void Execute()
{
var appUserI3D = this.GetAppUserWithBillableTimers();
var employeeI3D = this.Sql<int>($"SELECT Personal FROM dbo.Sichbenu WHERE I3D = {appUserI3D}");
this.DeactivationKeepsAssignmentAndMarksArticlesEndOfLife(appUserI3D);
this.ReactivationRevokesEndOfLife(appUserI3D);
this.TimersStayAttributedWhenAssignmentIsMissing(appUserI3D, employeeI3D);
}
/// <summary>
/// Finds an app-user that has employee articles which are used by open (not yet billed) timers
/// recorded by that same employee.
/// </summary>
private int GetAppUserWithBillableTimers()
{
var appUserI3D = this.Sql<int>(@"
SELECT TOP 1 SB.I3D
FROM dbo.hlpdsk_timer HT
INNER JOIN dbo.Mitarbeiterartikel MA ON MA.ArtikelI3D = HT.ArtikelI3D
INNER JOIN dbo.Sichbenu SB ON SB.I3D = MA.MitarbeiterI3D
WHERE ISNULL(HT.RechPosI3D, 0) = 0
AND ISNULL(HT.LiefPosI3D, 0) = 0
AND ISNULL(HT.AufPosI3D, 0) = 0
AND HT.PersonalI3D = SB.Personal
GROUP BY SB.I3D
ORDER BY COUNT(*) DESC, SB.I3D");
if (appUserI3D <= 0)
throw new InvalidOperationException("No app-user with employee articles and open timers found in the test database.");
return appUserI3D;
}
/// <summary>
/// Deactivating an employee must keep the employee-article assignment and only mark the
/// assigned articles as end-of-life, so the articles disappear from new selections while
/// the recorded times stay attributable.
/// </summary>
private void DeactivationKeepsAssignmentAndMarksArticlesEndOfLife(int appUserI3D)
{
// Reset the end-of-life flag first, so the snapshot is independent of the backup's state.
this.Sql($@"
UPDATE A SET A.EOL = 0
FROM dbo.ARTIK A
INNER JOIN dbo.Mitarbeiterartikel MA ON MA.ArtikelI3D = A.I3D
WHERE MA.MitarbeiterI3D = {appUserI3D}");
this.SetEmployeeArticlesEndOfLife(appUserI3D, true);
this.VerifyEmployeeArticles("Deactivation_AssignmentKeptAndArticlesEndOfLife", appUserI3D);
}
/// <summary>
/// Reactivating an employee must revoke the end-of-life mark that the deactivation has set.
/// </summary>
private void ReactivationRevokesEndOfLife(int appUserI3D)
{
this.SetEmployeeArticlesEndOfLife(appUserI3D, false);
this.VerifyEmployeeArticles("Reactivation_ArticlesUsableAgain", appUserI3D);
}
/// <summary>
/// Databases that were damaged by the old deactivation behaviour have no employee-article
/// assignment left. The billing search must still attribute those times to the employee who
/// recorded them, otherwise the times can never be billed again.
/// Times that merely use one of the employee's articles but were recorded by somebody else
/// move to that other employee, which is the correct attribution once the assignment is gone.
/// </summary>
private void TimersStayAttributedWhenAssignmentIsMissing(int appUserI3D, int employeeI3D)
{
var timersBefore = this.SearchTimersForEmployee(employeeI3D);
if (timersBefore.Any() == false)
throw new InvalidOperationException($"No open timers found for employee {employeeI3D} in the test database.");
// Simulate a database that was damaged by the old deactivation behaviour.
this.Sql($"DELETE FROM dbo.Mitarbeiterartikel WHERE MitarbeiterI3D = {appUserI3D}");
var timersAfter = this.SearchTimersForEmployee(employeeI3D);
this.Verifier.Verify("TimerBillingSearch_WithoutEmployeeArticleAssignment", new
{
AssignmentsLeft = this.Sql<int>($"SELECT COUNT(*) FROM dbo.Mitarbeiterartikel WHERE MitarbeiterI3D = {appUserI3D}"),
TimersFoundBefore = timersBefore.Count,
TimersRecordedByEmployeeBefore = timersBefore.Count(timer => timer.CreatorEmployeeI3D == employeeI3D),
TimersFoundAfter = timersAfter.Count,
TimersRecordedByEmployeeAfter = timersAfter.Count(timer => timer.CreatorEmployeeI3D == employeeI3D)
});
}
private void SetEmployeeArticlesEndOfLife(int appUserI3D, bool isEndOfLife)
{
using (var session = new BLSession())
{
session.GetBL<EmployeeArticleWebServiceBL>()
.SetEmployeeArticlesEndOfLife(this.GetLoggedInUser(), appUserI3D, isEndOfLife)
.ThrowIfError();
}
}
private void VerifyEmployeeArticles(string name, int appUserI3D)
{
this.Verifier.VerifySql(name, $@"
SELECT ArticleCode = A.Artikelcode,
IsEndOfLife = CAST(ISNULL(A.EOL, 0) AS bit)
FROM dbo.Mitarbeiterartikel MA
INNER JOIN dbo.ARTIK A ON A.I3D = MA.ArtikelI3D
WHERE MA.MitarbeiterI3D = {appUserI3D}
ORDER BY A.Artikelcode");
}
private List<TimerForTimerBillingDTO> SearchTimersForEmployee(int employeeI3D)
{
using (var session = new BLSession())
{
return session.GetBL<TimerBillingBL>()
.SearchTimers(new TimerBillingFilter { EmployeeI3Ds = new List<int> { employeeI3D } })
.ToList();
}
}
}
@@ -0,0 +1,14 @@
[
{
ArticleCode: 'SERMFAE15',
IsEndOfLife: 'False'
},
{
ArticleCode: 'SERMFAE30',
IsEndOfLife: 'False'
},
{
ArticleCode: 'SERMFBE',
IsEndOfLife: 'False'
}
]
@@ -0,0 +1,7 @@
{
AssignmentsLeft: 0,
TimersFoundAfter: 92,
TimersFoundBefore: 106,
TimersRecordedByEmployeeAfter: 92,
TimersRecordedByEmployeeBefore: 92
}
@@ -0,0 +1,32 @@
using System;
using System.Linq;
using Centron.BusinessLogic.Administration.Company;
using Centron.DAO;
using Centron.Data.Entities.Administration.Company;
using Centron.Tests.EndToEnd.Infrastructure;
using Xunit.Abstractions;
namespace Centron.Tests.EndToEnd.Tests.Administration.NumberGroups;
public class NumberGroupRefreshTest : EndToEndTest
{
public NumberGroupRefreshTest(ITestOutputHelper testOutputHelper) : base(testOutputHelper)
{
}
public override void Execute()
{
using var session = new DAOSession();
var toIgnore = session.GetSession().Query<NumberGroup>().Where(f => f.Description == "[nicht verwendet]").ToList();
new NumberGroupBL(session).RefreshAllNumberGroups();
Verifier.VerifySql("NumberGroupRefreshTest_AfterRefresh", "SELECT * FROM Nummernkreis ORDER BY I3D");
var allNumberGroups = session.GetSession().Query<NumberGroup>().ToList();
if (allNumberGroups.Any(f => f.Description == "[nicht verwendet]" && toIgnore.All(ff => ff.I3D != f.I3D)))
throw new Exception("Method 'RefreshAllNumberGroups' created new [nicht verwenden] entries! Please update the ignore list in the method NumberGroupBL.GetNumberGroupEnumsToCreate().");
}
}
@@ -0,0 +1,746 @@
[
{
I3D: '1',
NummerArt: '1',
MandantI3D: '2',
Beschreibung: 'Angebot',
BereichVon: '1000',
BereichBis: '2000',
Aktuell: '10339',
Intervall: '1',
BranchI3D: null,
FilialI3D: null
},
{
I3D: '2',
NummerArt: '2',
MandantI3D: '2',
Beschreibung: 'Auftrag',
BereichVon: '2000',
BereichBis: '3000',
Aktuell: '20383',
Intervall: '1',
BranchI3D: null,
FilialI3D: null
},
{
I3D: '3',
NummerArt: '3',
MandantI3D: '2',
Beschreibung: 'Lieferschein',
BereichVon: '1000',
BereichBis: '2000',
Aktuell: '30176',
Intervall: '1',
BranchI3D: null,
FilialI3D: null
},
{
I3D: '4',
NummerArt: '4',
MandantI3D: '2',
Beschreibung: 'Rechnung',
BereichVon: '4000',
BereichBis: '5000',
Aktuell: '40286',
Intervall: '1',
BranchI3D: null,
FilialI3D: null
},
{
I3D: '5',
NummerArt: '5',
MandantI3D: '2',
Beschreibung: 'Abholschein',
BereichVon: '5000',
BereichBis: '6000',
Aktuell: '50003',
Intervall: '1',
BranchI3D: null,
FilialI3D: null
},
{
I3D: '6',
NummerArt: '6',
MandantI3D: '2',
Beschreibung: 'Gutschrift',
BereichVon: '6000',
BereichBis: '7000',
Aktuell: '60020',
Intervall: '1',
BranchI3D: null,
FilialI3D: null
},
{
I3D: '7',
NummerArt: '7',
MandantI3D: '2',
Beschreibung: 'Artikelcodes',
BereichVon: '7000',
BereichBis: '8000',
Aktuell: '109',
Intervall: '1',
BranchI3D: null,
FilialI3D: null
},
{
I3D: '8',
NummerArt: '8',
MandantI3D: '2',
Beschreibung: 'Rücksendungen',
BereichVon: '8000',
BereichBis: '9000',
Aktuell: '80065',
Intervall: '1',
BranchI3D: null,
FilialI3D: null
},
{
I3D: '9',
NummerArt: '9',
MandantI3D: '2',
Beschreibung: 'Reparatur',
BereichVon: '9000',
BereichBis: '10000',
Aktuell: '90000',
Intervall: '1',
BranchI3D: null,
FilialI3D: null
},
{
I3D: '10',
NummerArt: '10',
MandantI3D: '2',
Beschreibung: 'Reparatureingang',
BereichVon: '10000',
BereichBis: '11000',
Aktuell: '10000',
Intervall: '1',
BranchI3D: null,
FilialI3D: null
},
{
I3D: '11',
NummerArt: '11',
MandantI3D: '2',
Beschreibung: 'RMA Nummer',
BereichVon: '11000',
BereichBis: '12000',
Aktuell: '11000',
Intervall: '1',
BranchI3D: null,
FilialI3D: null
},
{
I3D: '12',
NummerArt: '12',
MandantI3D: '2',
Beschreibung: 'Helpdesk',
BereichVon: '12000',
BereichBis: '13000',
Aktuell: '12505',
Intervall: '1',
BranchI3D: null,
FilialI3D: null
},
{
I3D: '13',
NummerArt: '13',
MandantI3D: '2',
Beschreibung: 'Loesung',
BereichVon: '13000',
BereichBis: '14000',
Aktuell: '13044',
Intervall: '1',
BranchI3D: null,
FilialI3D: null
},
{
I3D: '14',
NummerArt: '14',
MandantI3D: '2',
Beschreibung: 'Vertrag',
BereichVon: '14000',
BereichBis: '15000',
Aktuell: '14035',
Intervall: '1',
BranchI3D: null,
FilialI3D: null
},
{
I3D: '15',
NummerArt: '15',
MandantI3D: '2',
Beschreibung: '[nicht verwendet]',
BereichVon: '15000',
BereichBis: '16000',
Aktuell: '15000',
Intervall: '1',
BranchI3D: null,
FilialI3D: null
},
{
I3D: '16',
NummerArt: '16',
MandantI3D: '2',
Beschreibung: 'Anfrage',
BereichVon: '16000',
BereichBis: '17000',
Aktuell: '16002',
Intervall: '1',
BranchI3D: null,
FilialI3D: null
},
{
I3D: '17',
NummerArt: '17',
MandantI3D: '2',
Beschreibung: 'Bestellung',
BereichVon: '16000',
BereichBis: '17000',
Aktuell: '16164',
Intervall: '1',
BranchI3D: null,
FilialI3D: null
},
{
I3D: '18',
NummerArt: '18',
MandantI3D: '2',
Beschreibung: 'Wareneingang',
BereichVon: '17000',
BereichBis: '18000',
Aktuell: '17149',
Intervall: '1',
BranchI3D: null,
FilialI3D: null
},
{
I3D: '19',
NummerArt: '19',
MandantI3D: '2',
Beschreibung: 'Kalkulation',
BereichVon: '18000',
BereichBis: '19000',
Aktuell: '18106',
Intervall: '1',
BranchI3D: null,
FilialI3D: null
},
{
I3D: '20',
NummerArt: '20',
MandantI3D: '2',
Beschreibung: 'Barangebot',
BereichVon: '19000',
BereichBis: '20000',
Aktuell: '19005',
Intervall: '1',
BranchI3D: null,
FilialI3D: null
},
{
I3D: '21',
NummerArt: '21',
MandantI3D: '2',
Beschreibung: 'Barrechnung',
BereichVon: '20000',
BereichBis: '21000',
Aktuell: '20046',
Intervall: '1',
BranchI3D: null,
FilialI3D: null
},
{
I3D: '22',
NummerArt: '22',
MandantI3D: '2',
Beschreibung: 'CallTracking',
BereichVon: '50000',
BereichBis: '69999',
Aktuell: '50000',
Intervall: '1',
BranchI3D: null,
FilialI3D: null
},
{
I3D: '24',
NummerArt: '23',
MandantI3D: '2',
Beschreibung: 'Lieferantengutschrift',
BereichVon: '70000',
BereichBis: '89999',
Aktuell: '70003',
Intervall: '1',
BranchI3D: null,
FilialI3D: null
},
{
I3D: '25',
NummerArt: '1',
MandantI3D: '2',
Beschreibung: 'Angebot',
BereichVon: null,
BereichBis: null,
Aktuell: '1000000',
Intervall: null,
BranchI3D: null,
FilialI3D: '1'
},
{
I3D: '26',
NummerArt: '2',
MandantI3D: '2',
Beschreibung: 'Auftrag',
BereichVon: null,
BereichBis: null,
Aktuell: null,
Intervall: null,
BranchI3D: null,
FilialI3D: '1'
},
{
I3D: '27',
NummerArt: '3',
MandantI3D: '2',
Beschreibung: 'Lieferschein',
BereichVon: null,
BereichBis: null,
Aktuell: null,
Intervall: null,
BranchI3D: null,
FilialI3D: '1'
},
{
I3D: '28',
NummerArt: '4',
MandantI3D: '2',
Beschreibung: 'Rechnung',
BereichVon: null,
BereichBis: null,
Aktuell: null,
Intervall: null,
BranchI3D: null,
FilialI3D: '1'
},
{
I3D: '29',
NummerArt: '5',
MandantI3D: '2',
Beschreibung: 'Abholschein',
BereichVon: null,
BereichBis: null,
Aktuell: null,
Intervall: null,
BranchI3D: null,
FilialI3D: '1'
},
{
I3D: '30',
NummerArt: '6',
MandantI3D: '2',
Beschreibung: 'Gutschrift',
BereichVon: null,
BereichBis: null,
Aktuell: null,
Intervall: null,
BranchI3D: null,
FilialI3D: '1'
},
{
I3D: '31',
NummerArt: '7',
MandantI3D: '2',
Beschreibung: 'Artikelcodes',
BereichVon: null,
BereichBis: null,
Aktuell: null,
Intervall: null,
BranchI3D: null,
FilialI3D: '1'
},
{
I3D: '32',
NummerArt: '8',
MandantI3D: '2',
Beschreibung: 'Rücksendungen',
BereichVon: null,
BereichBis: null,
Aktuell: null,
Intervall: null,
BranchI3D: null,
FilialI3D: '1'
},
{
I3D: '33',
NummerArt: '9',
MandantI3D: '2',
Beschreibung: 'Reparatur',
BereichVon: null,
BereichBis: null,
Aktuell: null,
Intervall: null,
BranchI3D: null,
FilialI3D: '1'
},
{
I3D: '34',
NummerArt: '10',
MandantI3D: '2',
Beschreibung: 'Reparatureingang',
BereichVon: null,
BereichBis: null,
Aktuell: null,
Intervall: null,
BranchI3D: null,
FilialI3D: '1'
},
{
I3D: '35',
NummerArt: '11',
MandantI3D: '2',
Beschreibung: 'RMA Nummer',
BereichVon: null,
BereichBis: null,
Aktuell: null,
Intervall: null,
BranchI3D: null,
FilialI3D: '1'
},
{
I3D: '36',
NummerArt: '12',
MandantI3D: '2',
Beschreibung: 'Helpdesk',
BereichVon: null,
BereichBis: null,
Aktuell: null,
Intervall: null,
BranchI3D: null,
FilialI3D: '1'
},
{
I3D: '37',
NummerArt: '13',
MandantI3D: '2',
Beschreibung: 'Helpdesk Loesung',
BereichVon: null,
BereichBis: null,
Aktuell: null,
Intervall: null,
BranchI3D: null,
FilialI3D: '1'
},
{
I3D: '38',
NummerArt: '14',
MandantI3D: '2',
Beschreibung: 'Vertrag',
BereichVon: null,
BereichBis: null,
Aktuell: null,
Intervall: null,
BranchI3D: null,
FilialI3D: '1'
},
{
I3D: '39',
NummerArt: '15',
MandantI3D: '2',
Beschreibung: 'Clickverträge',
BereichVon: null,
BereichBis: null,
Aktuell: null,
Intervall: null,
BranchI3D: null,
FilialI3D: '1'
},
{
I3D: '40',
NummerArt: '16',
MandantI3D: '2',
Beschreibung: 'Anfrage',
BereichVon: null,
BereichBis: null,
Aktuell: null,
Intervall: null,
BranchI3D: null,
FilialI3D: '1'
},
{
I3D: '41',
NummerArt: '17',
MandantI3D: '2',
Beschreibung: 'Bestellung',
BereichVon: null,
BereichBis: null,
Aktuell: null,
Intervall: null,
BranchI3D: null,
FilialI3D: '1'
},
{
I3D: '42',
NummerArt: '18',
MandantI3D: '2',
Beschreibung: 'Wareneingang',
BereichVon: null,
BereichBis: null,
Aktuell: null,
Intervall: null,
BranchI3D: null,
FilialI3D: '1'
},
{
I3D: '43',
NummerArt: '19',
MandantI3D: '2',
Beschreibung: 'Kalkulation',
BereichVon: null,
BereichBis: null,
Aktuell: null,
Intervall: null,
BranchI3D: null,
FilialI3D: '1'
},
{
I3D: '44',
NummerArt: '20',
MandantI3D: '2',
Beschreibung: 'Barangebot',
BereichVon: null,
BereichBis: null,
Aktuell: null,
Intervall: null,
BranchI3D: null,
FilialI3D: '1'
},
{
I3D: '45',
NummerArt: '21',
MandantI3D: '2',
Beschreibung: 'Barrechnung',
BereichVon: null,
BereichBis: null,
Aktuell: null,
Intervall: null,
BranchI3D: null,
FilialI3D: '1'
},
{
I3D: '46',
NummerArt: '22',
MandantI3D: '2',
Beschreibung: 'CallTracking',
BereichVon: null,
BereichBis: null,
Aktuell: null,
Intervall: null,
BranchI3D: null,
FilialI3D: '1'
},
{
I3D: '47',
NummerArt: '23',
MandantI3D: '2',
Beschreibung: 'Lieferantengutschrift',
BereichVon: null,
BereichBis: null,
Aktuell: null,
Intervall: null,
BranchI3D: null,
FilialI3D: '1'
},
{
I3D: '48',
NummerArt: '24',
MandantI3D: '2',
Beschreibung: 'CRM-Projekt',
BereichVon: '80000',
BereichBis: '89999',
Aktuell: '80000',
Intervall: '1',
BranchI3D: null,
FilialI3D: null
},
{
I3D: '49',
NummerArt: '24',
MandantI3D: '2',
Beschreibung: 'CRM-Projekt',
BereichVon: null,
BereichBis: null,
Aktuell: null,
Intervall: '1',
BranchI3D: null,
FilialI3D: '1'
},
{
I3D: '50',
NummerArt: '25',
MandantI3D: '2',
Beschreibung: 'Lagerumbuchung',
BereichVon: '90000',
BereichBis: '99999',
Aktuell: '90003',
Intervall: '1',
BranchI3D: null,
FilialI3D: null
},
{
I3D: '51',
NummerArt: '25',
MandantI3D: '2',
Beschreibung: 'Lagerumbuchung',
BereichVon: null,
BereichBis: null,
Aktuell: null,
Intervall: null,
BranchI3D: null,
FilialI3D: '1'
},
{
I3D: '52',
NummerArt: '26',
MandantI3D: '2',
Beschreibung: 'Konto',
BereichVon: null,
BereichBis: null,
Aktuell: '50',
Intervall: '1',
BranchI3D: null,
FilialI3D: '0'
},
{
I3D: '53',
NummerArt: '27',
MandantI3D: '2',
Beschreibung: 'Kunde',
BereichVon: null,
BereichBis: null,
Aktuell: '10027',
Intervall: '1',
BranchI3D: null,
FilialI3D: '0'
},
{
I3D: '54',
NummerArt: '28',
MandantI3D: '2',
Beschreibung: 'Lieferant',
BereichVon: null,
BereichBis: null,
Aktuell: '70023',
Intervall: '1',
BranchI3D: null,
FilialI3D: '0'
},
{
I3D: '55',
NummerArt: '29',
MandantI3D: '2',
Beschreibung: 'Projekt',
BereichVon: null,
BereichBis: null,
Aktuell: '1',
Intervall: '1',
BranchI3D: null,
FilialI3D: '0'
},
{
I3D: '56',
NummerArt: '30',
MandantI3D: '2',
Beschreibung: '0,00 DL-Rechnung',
BereichVon: null,
BereichBis: null,
Aktuell: null,
Intervall: null,
BranchI3D: null,
FilialI3D: null
},
{
I3D: '57',
NummerArt: '31',
MandantI3D: '2',
Beschreibung: 'EGIS Warenkorb',
BereichVon: null,
BereichBis: null,
Aktuell: null,
Intervall: null,
BranchI3D: null,
FilialI3D: null
},
{
I3D: '58',
NummerArt: '26',
MandantI3D: '2',
Beschreibung: 'Konto',
BereichVon: null,
BereichBis: null,
Aktuell: null,
Intervall: null,
BranchI3D: null,
FilialI3D: '1'
},
{
I3D: '59',
NummerArt: '27',
MandantI3D: '2',
Beschreibung: 'Kunde',
BereichVon: null,
BereichBis: null,
Aktuell: null,
Intervall: null,
BranchI3D: null,
FilialI3D: '1'
},
{
I3D: '60',
NummerArt: '28',
MandantI3D: '2',
Beschreibung: 'Lieferant',
BereichVon: null,
BereichBis: null,
Aktuell: null,
Intervall: null,
BranchI3D: null,
FilialI3D: '1'
},
{
I3D: '61',
NummerArt: '29',
MandantI3D: '2',
Beschreibung: 'Projekt',
BereichVon: null,
BereichBis: null,
Aktuell: null,
Intervall: null,
BranchI3D: null,
FilialI3D: '1'
},
{
I3D: '62',
NummerArt: '30',
MandantI3D: '2',
Beschreibung: '0,00 DL-Rechnung',
BereichVon: null,
BereichBis: null,
Aktuell: null,
Intervall: null,
BranchI3D: null,
FilialI3D: '1'
},
{
I3D: '63',
NummerArt: '31',
MandantI3D: '2',
Beschreibung: 'EGIS Warenkorb',
BereichVon: null,
BereichBis: null,
Aktuell: null,
Intervall: null,
BranchI3D: null,
FilialI3D: '1'
}
]
@@ -0,0 +1,52 @@
using Centron.BusinessLogic;
using Centron.BusinessLogic.Administration.Profiling;
using Centron.BusinessLogic.Administration.Settings;
using Centron.BusinessLogic.WebServices.Sales.Receipts;
using Centron.Data.WebServices.Sales.Receipts;
using Centron.Interfaces;
using Centron.Interfaces.Sales.Receipts;
using Centron.Tests.EndToEnd.Infrastructure;
using CentronSoftware.Centron.WebServices.Entities.Sales.Receipts.Log;
using Xunit.Abstractions;
namespace Centron.Tests.EndToEnd.Tests.Administration.Profiling;
public class CommonProfilerTests : EndToEndTest
{
public CommonProfilerTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper)
{
Verifier.Settings.CleanupDateTimeValues = true;
Verifier.Settings.IgnoreProperty((ReceiptLogDTO c) => c.CentronVersion);
}
public override void Execute()
{
using var session = new BLSession();
SetupProfilingForReceipts(session);
var receiptBL = session.GetBL<ReceiptWebServiceBL>();
receiptBL.GetReceiptByI3D(151, CentronObjectKindNumeric.InvoiceClass, base.GetLoggedInUser());
receiptBL.GetReceiptByI3D(151, CentronObjectKindNumeric.InvoiceClass, base.GetLoggedInUser());
receiptBL.GetReceiptByI3D(152, CentronObjectKindNumeric.InvoiceClass, base.GetLoggedInUser());
// Test unreorganized log entries
var logResult = session.GetBL<ReceiptLogWebServiceBL>().GetLogsByFilter(new ReceiptLogsFilter() { LogKind = ReceiptLogKind.ProfilerAccessTracking });
Verifier.Verify("CommonProfilerTests_ProfilerAccessTracking", logResult);
// Reorganize the profile log entries
session.GetBL<ProfilerBL>().ReorganizeProfilerEntries();
// Test reorganization of the log entries
logResult = session.GetBL<ReceiptLogWebServiceBL>().GetLogsByFilter(new ReceiptLogsFilter() { LogKind = ReceiptLogKind.ProfilerAccessTracking });
Verifier.Verify("CommonProfilerTests_ProfilerAccessTracking_AfterReorg", logResult);
}
internal void SetupProfilingForReceipts(BLSession session)
{
// Settings test on the side of the road :-)
var settings = session.GetBL<AppSettingsGroupBL>().GetProfilerSettings();
settings.IsExtendedReceiptProfilingActive = true;
settings.KeepExtendedProfilingRecordsForXDays = 0; // we want immediate data aggregation for our test
session.GetBL<AppSettingsGroupBL>().UpdateProfilerSettings(settings);
}
}
@@ -0,0 +1,110 @@
[
{
ContactPersonI3D: null,
Date: DateTime,
Description: 'Zugriff auf Datensatz',
Employee: {
Availability: 0,
BranchI3D: 0,
DefaultStorageI3D: null,
Dispatcher: false,
DisplayText: 'Administrator, c-entron (ADMIN)',
Email: 'vertrieb@c-entron.de',
Employeenumber: 0,
FirstName: 'c-entron',
FullName: 'Administrator, c-entron (ADMIN)',
I3D: 22,
IsActive: true,
LastAvailabilityChange: null,
LastName: 'Administrator',
LeavingDate: DateTime,
Phone1: '0731-140399-0',
RemainingDaysOfVacation: 28.0,
ShortSign: 'ADMIN',
State: 1,
SupportLevel: null,
Template1: false,
Template2: false,
Template3: false,
Template4: false,
VacationEntitlement: 30.0
},
I3D: 13961,
Kind: 80,
ReceiptI3D: 151,
ReceiptKind: 4,
ReceiptVersion: 1
},
{
ContactPersonI3D: null,
Date: DateTime,
Description: 'Zugriff auf Datensatz',
Employee: {
Availability: 0,
BranchI3D: 0,
DefaultStorageI3D: null,
Dispatcher: false,
DisplayText: 'Administrator, c-entron (ADMIN)',
Email: 'vertrieb@c-entron.de',
Employeenumber: 0,
FirstName: 'c-entron',
FullName: 'Administrator, c-entron (ADMIN)',
I3D: 22,
IsActive: true,
LastAvailabilityChange: null,
LastName: 'Administrator',
LeavingDate: DateTime,
Phone1: '0731-140399-0',
RemainingDaysOfVacation: 28.0,
ShortSign: 'ADMIN',
State: 1,
SupportLevel: null,
Template1: false,
Template2: false,
Template3: false,
Template4: false,
VacationEntitlement: 30.0
},
I3D: 13962,
Kind: 80,
ReceiptI3D: 151,
ReceiptKind: 4,
ReceiptVersion: 1
},
{
ContactPersonI3D: null,
Date: DateTime,
Description: 'Zugriff auf Datensatz',
Employee: {
Availability: 0,
BranchI3D: 0,
DefaultStorageI3D: null,
Dispatcher: false,
DisplayText: 'Administrator, c-entron (ADMIN)',
Email: 'vertrieb@c-entron.de',
Employeenumber: 0,
FirstName: 'c-entron',
FullName: 'Administrator, c-entron (ADMIN)',
I3D: 22,
IsActive: true,
LastAvailabilityChange: null,
LastName: 'Administrator',
LeavingDate: DateTime,
Phone1: '0731-140399-0',
RemainingDaysOfVacation: 28.0,
ShortSign: 'ADMIN',
State: 1,
SupportLevel: null,
Template1: false,
Template2: false,
Template3: false,
Template4: false,
VacationEntitlement: 30.0
},
I3D: 13963,
Kind: 80,
ReceiptI3D: 152,
ReceiptKind: 4,
ReceiptVersion: 1
}
]
@@ -0,0 +1,74 @@
[
{
ContactPersonI3D: null,
Date: DateTime,
Description: '2 Zugriffe auf Datensatz',
Employee: {
Availability: 0,
BranchI3D: 0,
DefaultStorageI3D: null,
Dispatcher: false,
DisplayText: 'Administrator, c-entron (ADMIN)',
Email: 'vertrieb@c-entron.de',
Employeenumber: 0,
FirstName: 'c-entron',
FullName: 'Administrator, c-entron (ADMIN)',
I3D: 22,
IsActive: true,
LastAvailabilityChange: null,
LastName: 'Administrator',
LeavingDate: DateTime,
Phone1: '0731-140399-0',
RemainingDaysOfVacation: 28.0,
ShortSign: 'ADMIN',
State: 1,
SupportLevel: null,
Template1: false,
Template2: false,
Template3: false,
Template4: false,
VacationEntitlement: 30.0
},
I3D: 13964,
Kind: 80,
ReceiptI3D: 151,
ReceiptKind: 4,
ReceiptVersion: 1
},
{
ContactPersonI3D: null,
Date: DateTime,
Description: 'Zugriff auf Datensatz',
Employee: {
Availability: 0,
BranchI3D: 0,
DefaultStorageI3D: null,
Dispatcher: false,
DisplayText: 'Administrator, c-entron (ADMIN)',
Email: 'vertrieb@c-entron.de',
Employeenumber: 0,
FirstName: 'c-entron',
FullName: 'Administrator, c-entron (ADMIN)',
I3D: 22,
IsActive: true,
LastAvailabilityChange: null,
LastName: 'Administrator',
LeavingDate: DateTime,
Phone1: '0731-140399-0',
RemainingDaysOfVacation: 28.0,
ShortSign: 'ADMIN',
State: 1,
SupportLevel: null,
Template1: false,
Template2: false,
Template3: false,
Template4: false,
VacationEntitlement: 30.0
},
I3D: 13963,
Kind: 80,
ReceiptI3D: 152,
ReceiptKind: 4,
ReceiptVersion: 1
}
]
@@ -0,0 +1,67 @@
[
{
I3D: '45',
Name: 'Alle Benutzer',
cnt: '20'
},
{
I3D: '46',
Name: 'Buchhaltung',
cnt: '152'
},
{
I3D: '47',
Name: 'c-entron DSGVO Löschrecht',
cnt: '9'
},
{
I3D: '48',
Name: 'Einkauf Leitung',
cnt: '129'
},
{
I3D: '49',
Name: 'Einkauf Mitarbeiter',
cnt: '61'
},
{
I3D: '40',
Name: 'Filiale 1',
cnt: '429'
},
{
I3D: '42',
Name: 'Lager',
cnt: '19'
},
{
I3D: '50',
Name: 'Logistik Leitung',
cnt: '105'
},
{
I3D: '51',
Name: 'Logistik Mitarbeiter',
cnt: '44'
},
{
I3D: '52',
Name: 'Service Leitung',
cnt: '176'
},
{
I3D: '53',
Name: 'Service Mitarbeiter',
cnt: '61'
},
{
I3D: '54',
Name: 'Vertrieb Leitung',
cnt: '212'
},
{
I3D: '55',
Name: 'Vertrieb Mitabeiter',
cnt: '84'
}
]
@@ -0,0 +1,67 @@
[
{
I3D: '36',
Name: 'Alle Benutzer',
cnt: '19'
},
{
I3D: '26',
Name: 'Buchhaltung',
cnt: '78'
},
{
I3D: '43',
Name: 'c-entron DSGVO Löschrecht',
cnt: '12'
},
{
I3D: '37',
Name: 'Einkauf Leitung',
cnt: '74'
},
{
I3D: '24',
Name: 'Einkauf Mitarbeiter',
cnt: '41'
},
{
I3D: '40',
Name: 'Filiale 1',
cnt: '429'
},
{
I3D: '42',
Name: 'Lager',
cnt: '19'
},
{
I3D: '39',
Name: 'Logistik Leitung',
cnt: '10'
},
{
I3D: '23',
Name: 'Logistik Mitarbeiter',
cnt: '13'
},
{
I3D: '38',
Name: 'Service Leitung',
cnt: '57'
},
{
I3D: '28',
Name: 'Service Mitarbeiter',
cnt: '28'
},
{
I3D: '18',
Name: 'Vertrieb Leitung',
cnt: '137'
},
{
I3D: '15',
Name: 'Vertrieb Mitabeiter',
cnt: '90'
}
]
@@ -0,0 +1,31 @@
using Centron.BusinessLogic;
using Centron.BusinessLogic.Administration.Rights;
using Centron.Interfaces.BL;
using Centron.Tests.EndToEnd.Infrastructure;
using Xunit.Abstractions;
namespace Centron.Tests.EndToEnd.Tests.Administration.Rights;
public class ResetDefaultRightGroupsTest : EndToEndTest
{
public ResetDefaultRightGroupsTest(ITestOutputHelper testOutputHelper) : base(testOutputHelper)
{
}
public override void Execute()
{
string query = @"SELECT sg.I3D, sg.Name, COUNT(st.Recht) cnt
FROM Sichgrup sg
INNER JOIN Sichtrus st ON st.Gruppe = sg.I3D
WHERE Name NOT IN ('Administratoren', 'RMM Systemuser Group')
GROUP BY sg.I3D, sg.Name
ORDER BY Name";
Verifier.VerifySql("DefaultRightGroupsList_BeforeReset", query);
using var session = new BLSession();
session.GetBL<AppRightsBL>().ResetDefaultRightGroups(base.GetLoggedInUser().User).ThrowIfError();
Verifier.VerifySql("DefaultRightGroupsList_AfterReset", query);
}
}
@@ -0,0 +1,39 @@
using Centron.BusinessLogic.Administration.Scripts.ScriptMethods.RecurringScriptMethods;
using Centron.DAO;
using Centron.Interfaces.BL;
using Centron.Tests.EndToEnd.Infrastructure;
using Xunit;
using Xunit.Abstractions;
namespace Centron.Tests.EndToEnd.Tests.Administration.Scripts.RecurringScripts;
public class FixNullStockQuantitiesTest : EndToEndTest
{
public FixNullStockQuantitiesTest(ITestOutputHelper testOutputHelper) : base(testOutputHelper)
{
}
public override void Execute()
{
Sql("UPDATE TOP (3) ARTIK SET Menge = NULL");
Sql("UPDATE TOP (3) NebenlagerArtikel SET Bestand = NULL");
Assert.True(
Sql<int>("SELECT COUNT(*) FROM ARTIK WHERE Menge IS NULL") >= 1,
"Setup fehlgeschlagen: kein ARTIK-Datensatz mit Menge IS NULL vorhanden");
Assert.True(
Sql<int>("SELECT COUNT(*) FROM NebenlagerArtikel WHERE Bestand IS NULL") >= 1,
"Setup fehlgeschlagen: kein NebenlagerArtikel-Datensatz mit Bestand IS NULL vorhanden");
using (var session = new DAOSession())
{
session.WithTransaction(() => new FixArticleMainStockQuantityNull().ExecuteScript(session))
.ThrowIfError();
session.WithTransaction(() => new FixSecondaryStockArticleStockNull().ExecuteScript(session))
.ThrowIfError();
}
Assert.Equal(0, Sql<int>("SELECT COUNT(*) FROM ARTIK WHERE Menge IS NULL"));
Assert.Equal(0, Sql<int>("SELECT COUNT(*) FROM NebenlagerArtikel WHERE Bestand IS NULL"));
}
}