Fix bug where it is not possible to create new members
This commit is contained in:
@ -65,5 +65,11 @@ namespace WGneu.Helpers {
|
||||
public static bool MgNrExists(AppDbContext ctx, int mgnr) {
|
||||
return ctx.Members.Find(mgnr) != null;
|
||||
}
|
||||
|
||||
public static int NextMgNr(AppDbContext ctx) {
|
||||
int c = ctx.Members.Select(m => m.MgNr).Min();
|
||||
ctx.Members.OrderBy(m => m.MgNr).Select(m => m.MgNr).ToList().ForEach(a => { if (a <= c + 100) c = a; });
|
||||
return c + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user