added some small improvements
This commit is contained in:
parent
8d01c15396
commit
81fbd7482f
@ -28,7 +28,7 @@
|
|||||||
</AccessText>
|
</AccessText>
|
||||||
</Label>
|
</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"/>
|
<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">
|
<Label VerticalAlignment="Center" Grid.Row="2" Grid.Column="0">
|
||||||
<AccessText TextWrapping="Wrap">
|
<AccessText TextWrapping="Wrap">
|
||||||
@ -36,7 +36,7 @@
|
|||||||
</AccessText>
|
</AccessText>
|
||||||
</Label>
|
</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"/>
|
<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"/>
|
<Button x:Name="buttonCompare" Margin="2" Grid.Row="3" Grid.Column="1" Content="Compare" IsEnabled="False" Click="buttonCompare_Click"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@ -210,5 +210,35 @@ namespace ENI2.EditControls
|
|||||||
|
|
||||||
#endregion
|
#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
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -205,7 +205,7 @@ namespace bsmd.database
|
|||||||
{
|
{
|
||||||
MaxLengthAttribute mla = Attribute.GetCustomAttribute(property, typeof(MaxLengthAttribute)) as MaxLengthAttribute;
|
MaxLengthAttribute mla = Attribute.GetCustomAttribute(property, typeof(MaxLengthAttribute)) as MaxLengthAttribute;
|
||||||
bool isStandardML = (mla.MaxLength == 99) || (mla.MaxLength == 100);
|
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
|
// put out a warning this might be truncated
|
||||||
violations.Add(RuleEngine.CreateViolation(ValidationCode.TRUNCATE, property.Name, value, entity.Title, identifier, entity.Tablename));
|
violations.Add(RuleEngine.CreateViolation(ValidationCode.TRUNCATE, property.Name, value, entity.Title, identifier, entity.Tablename));
|
||||||
|
|||||||
@ -37,7 +37,7 @@ namespace bsmd.database
|
|||||||
DOT_NO_COMMA,
|
DOT_NO_COMMA,
|
||||||
VESSEL_TYPE,
|
VESSEL_TYPE,
|
||||||
NOT_NULL_MAX_LEN,
|
NOT_NULL_MAX_LEN,
|
||||||
FRZ,
|
FRZ,
|
||||||
POSITION_COUNT = 22,
|
POSITION_COUNT = 22,
|
||||||
STRING_UNNUMBER = 23,
|
STRING_UNNUMBER = 23,
|
||||||
STRING_IMOCLASS = 24,
|
STRING_IMOCLASS = 24,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user