Skip to content

Commit f661729

Browse files
Fix bug for ids where the id was not +1
1 parent 91ecb01 commit f661729

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

MidasCivil_Adapter/Type/NextFreeId.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,21 +131,18 @@ protected override object NextFreeId(Type type, bool refresh = false)
131131
string section = "SECTION";
132132
string pscSection = "SECT-PSCVALUE";
133133

134-
int sectionIndex = 0;
135-
int pscSectionIndex = 0;
136-
137134
if (ExistsSection(section) && ExistsSection(pscSection))
138135
{
139-
sectionIndex = Math.Max(GetMaxId(section), GetMaxId(pscSection));
136+
index = Math.Max(GetMaxId(section), GetMaxId(pscSection)) + 1;
140137
}
141138
else if (ExistsSection(section))
142139
{
143-
pscSectionIndex = GetMaxId(section);
140+
index = GetMaxId(section) + 1;
144141

145142
}
146143
else if (ExistsSection(pscSection))
147144
{
148-
pscSectionIndex = GetMaxId(pscSection);
145+
index = GetMaxId(pscSection) + 1;
149146

150147
}
151148
else

0 commit comments

Comments
 (0)