added some small improvements

This commit is contained in:
Daniel Schick 2023-03-09 08:21:31 +01:00
parent 8d01c15396
commit 81fbd7482f
4 changed files with 34 additions and 4 deletions

View File

@ -28,7 +28,7 @@
</AccessText>
</Label>
<Image x:Name="imageSource" Grid.Row="1" Grid.Column="1" Margin="4" Source="../Resources/import2.png" AllowDrop="True" Drop="imageSource_Drop" DragEnter="imageSource_DragEnter"/>
<TextBox TextWrapping="Wrap" x:Name="textBoxSource" Grid.Row="1" Grid.Column="2" IsReadOnly="True" Margin="2" Drop="imageSource_Drop" AllowDrop="True" DragEnter="imageSource_DragEnter" PreviewDragOver="textBoxSource_PreviewDragOver"/>
<TextBox TextWrapping="Wrap" x:Name="textBoxSource" Grid.Row="1" Grid.Column="2" IsReadOnly="True" Margin="2" Drop="imageSource_Drop" AllowDrop="True" DragEnter="imageSource_DragEnter" PreviewDragOver="textBoxSource_PreviewDragOver" PreviewMouseDown="textBoxSource_PreviewMouseDown"/>
<Label VerticalAlignment="Center" Grid.Row="2" Grid.Column="0">
<AccessText TextWrapping="Wrap">
@ -36,7 +36,7 @@
</AccessText>
</Label>
<Image x:Name="imageTarget" Grid.Row="2" Grid.Column="1" Margin="4" Source="../Resources/import1.png" AllowDrop="True" Drop="imageTarget_Drop" DragEnter="imageSource_DragEnter"/>
<TextBox TextWrapping="Wrap" x:Name="textBoxTarget" Grid.Row="2" Grid.Column="2" IsReadOnly="True" Margin="2" AllowDrop="True" Drop="imageTarget_Drop" DragEnter="imageSource_DragEnter" PreviewDragOver="textBoxSource_PreviewDragOver"/>
<TextBox TextWrapping="Wrap" x:Name="textBoxTarget" Grid.Row="2" Grid.Column="2" IsReadOnly="True" Margin="2" AllowDrop="True" Drop="imageTarget_Drop" DragEnter="imageSource_DragEnter" PreviewDragOver="textBoxSource_PreviewDragOver" PreviewMouseDown="textBoxTarget_PreviewMouseDown"/>
<Button x:Name="buttonCompare" Margin="2" Grid.Row="3" Grid.Column="1" Content="Compare" IsEnabled="False" Click="buttonCompare_Click"/>
</Grid>

View File

@ -210,5 +210,35 @@ namespace ENI2.EditControls
#endregion
#region click on textboxes opens file selection
private void textBoxSource_PreviewMouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog
{
Filter = "Excel Files|*.xls;*.xlsx"
};
if (ofd.ShowDialog() ?? false)
{
textBoxSource.Text = ofd.FileName;
}
EnableCompareButton();
}
private void textBoxTarget_PreviewMouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog
{
Filter = "Excel Files|*.xls;*.xlsx"
};
if (ofd.ShowDialog() ?? false)
{
textBoxTarget.Text = ofd.FileName;
}
EnableCompareButton();
}
#endregion
}
}

View File

@ -205,7 +205,7 @@ namespace bsmd.database
{
MaxLengthAttribute mla = Attribute.GetCustomAttribute(property, typeof(MaxLengthAttribute)) as MaxLengthAttribute;
bool isStandardML = (mla.MaxLength == 99) || (mla.MaxLength == 100);
if((value.Length >= 90) && ((mla.MaxLength == value.Length) || isStandardML))
if(((value.Length >= 90) && isStandardML) || ((mla.MaxLength == value.Length) && (value.Length > 20) && !isStandardML))
{
// put out a warning this might be truncated
violations.Add(RuleEngine.CreateViolation(ValidationCode.TRUNCATE, property.Name, value, entity.Title, identifier, entity.Tablename));

View File

@ -37,7 +37,7 @@ namespace bsmd.database
DOT_NO_COMMA,
VESSEL_TYPE,
NOT_NULL_MAX_LEN,
FRZ,
FRZ,
POSITION_COUNT = 22,
STRING_UNNUMBER = 23,
STRING_IMOCLASS = 24,