Skip to content

Commit

Permalink
ParseTableDefinition refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
b4tman committed Feb 19, 2022
1 parent c5a7d34 commit 8947224
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions PasswordChanger1C/CommonModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,19 +171,21 @@ public static void ParseTableDefinition(ref AccessFunctions.PageParams PageHeade
int RowSize = 1;
string TableName = ParsedString[0][0].ToString().Replace("\"", "").ToUpper();
PageHeader.TableName = TableName;
foreach (var a in ParsedString[0][2])
foreach (var FieldDescriptor in ParsedString[0][2])
{
if (!a.IsList)
if (!FieldDescriptor.IsList)
{
continue;
}

var Field = new AccessFunctions.TableFields();
Field.Name = a[0].ToString().Replace("\"", "");
Field.Type = a[1].ToString().Replace("\"", "");
Field.CouldBeNull = Convert.ToInt32(a[2].ToString());
Field.Length = Convert.ToInt32(a[3].ToString());
Field.Precision = Convert.ToInt32(a[4].ToString());
var Field = new AccessFunctions.TableFields
{
Name = FieldDescriptor[0].ToString().Replace("\"", ""),
Type = FieldDescriptor[1].ToString().Replace("\"", ""),
CouldBeNull = Convert.ToInt32(FieldDescriptor[2].ToString()),
Length = Convert.ToInt32(FieldDescriptor[3].ToString()),
Precision = Convert.ToInt32(FieldDescriptor[4].ToString())
};
int FieldSize = GetFieldSize(Field);

Field.Size = FieldSize;
Expand Down

0 comments on commit 8947224

Please sign in to comment.