edit
This commit is contained in:
@@ -4,6 +4,7 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Markup;
|
||||
using System.Windows.Threading;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using XLAB2.Infrastructure;
|
||||
@@ -17,6 +18,7 @@ namespace XLAB2
|
||||
public App()
|
||||
{
|
||||
ApplyRussianCulture();
|
||||
RegisterGlobalExceptionHandlers();
|
||||
}
|
||||
|
||||
protected override async void OnStartup(StartupEventArgs e)
|
||||
@@ -40,19 +42,29 @@ namespace XLAB2
|
||||
|
||||
protected override async void OnExit(ExitEventArgs e)
|
||||
{
|
||||
if (_host != null)
|
||||
try
|
||||
{
|
||||
try
|
||||
if (_host != null)
|
||||
{
|
||||
await _host.StopAsync(TimeSpan.FromSeconds(5)).ConfigureAwait(true);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_host.Dispose();
|
||||
try
|
||||
{
|
||||
await _host.StopAsync(TimeSpan.FromSeconds(5)).ConfigureAwait(true);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_host.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
base.OnExit(e);
|
||||
catch (Exception ex)
|
||||
{
|
||||
ShowUnhandledException(ex, true);
|
||||
}
|
||||
finally
|
||||
{
|
||||
UnregisterGlobalExceptionHandlers();
|
||||
base.OnExit(e);
|
||||
}
|
||||
}
|
||||
|
||||
private static void ApplyRussianCulture()
|
||||
@@ -68,5 +80,77 @@ namespace XLAB2
|
||||
typeof(FrameworkElement),
|
||||
new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(culture.IetfLanguageTag)));
|
||||
}
|
||||
|
||||
private void RegisterGlobalExceptionHandlers()
|
||||
{
|
||||
DispatcherUnhandledException += OnDispatcherUnhandledException;
|
||||
AppDomain.CurrentDomain.UnhandledException += OnCurrentDomainUnhandledException;
|
||||
TaskScheduler.UnobservedTaskException += OnUnobservedTaskException;
|
||||
}
|
||||
|
||||
private void UnregisterGlobalExceptionHandlers()
|
||||
{
|
||||
DispatcherUnhandledException -= OnDispatcherUnhandledException;
|
||||
AppDomain.CurrentDomain.UnhandledException -= OnCurrentDomainUnhandledException;
|
||||
TaskScheduler.UnobservedTaskException -= OnUnobservedTaskException;
|
||||
}
|
||||
|
||||
private void OnDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
|
||||
{
|
||||
ShowUnhandledException(e.Exception, false);
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void OnCurrentDomainUnhandledException(object sender, UnhandledExceptionEventArgs e)
|
||||
{
|
||||
var exception = e.ExceptionObject as Exception;
|
||||
if (exception != null)
|
||||
{
|
||||
ShowUnhandledException(exception, e.IsTerminating);
|
||||
return;
|
||||
}
|
||||
|
||||
MessageBox.Show(
|
||||
e.ExceptionObject == null ? "Произошла необработанная ошибка." : e.ExceptionObject.ToString(),
|
||||
e.IsTerminating ? "XLAB2 - критическая ошибка" : "XLAB2",
|
||||
MessageBoxButton.OK,
|
||||
MessageBoxImage.Error);
|
||||
}
|
||||
|
||||
private void OnUnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e)
|
||||
{
|
||||
ShowUnhandledException(e.Exception, false);
|
||||
e.SetObserved();
|
||||
}
|
||||
|
||||
private static void ShowUnhandledException(Exception exception, bool isCritical)
|
||||
{
|
||||
var actualException = UnwrapException(exception);
|
||||
var message = string.IsNullOrWhiteSpace(actualException.Message)
|
||||
? actualException.ToString()
|
||||
: actualException.Message;
|
||||
|
||||
MessageBox.Show(
|
||||
message,
|
||||
isCritical ? "XLAB2 - критическая ошибка" : "XLAB2",
|
||||
MessageBoxButton.OK,
|
||||
MessageBoxImage.Error);
|
||||
}
|
||||
|
||||
private static Exception UnwrapException(Exception exception)
|
||||
{
|
||||
if (exception is AggregateException aggregateException)
|
||||
{
|
||||
var flattened = aggregateException.Flatten();
|
||||
if (flattened.InnerExceptions.Count == 1)
|
||||
{
|
||||
return UnwrapException(flattened.InnerExceptions[0]);
|
||||
}
|
||||
|
||||
return flattened;
|
||||
}
|
||||
|
||||
return exception;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,11 +65,42 @@
|
||||
<DataGrid.ContextMenu>
|
||||
<ContextMenu DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}">
|
||||
<MenuItem Header="Добавить"
|
||||
Command="{Binding AddEkzCommand}" />
|
||||
Command="{Binding AddEkzCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Grid Width="16" Height="16">
|
||||
<Ellipse Width="14" Height="14" Fill="{StaticResource AppMenuIconAccentBrush}" />
|
||||
<Rectangle Width="2" Height="8" Fill="White" RadiusX="1" RadiusY="1" />
|
||||
<Rectangle Width="8" Height="2" Fill="White" RadiusX="1" RadiusY="1" />
|
||||
</Grid>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Изменить"
|
||||
Command="{Binding EditEkzCommand}" />
|
||||
Command="{Binding EditEkzCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Path Fill="{StaticResource AppMenuIconAccentBrush}" Data="M11.7,1.4 L14.6,4.3 L5.5,13.4 L2.5,13.9 L3,10.9 Z" />
|
||||
<Path Fill="#FFEAF3FB" Data="M10.7,2.4 L13.6,5.3 L12.8,6.1 L9.9,3.2 Z" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Удалить"
|
||||
Command="{Binding DeleteEkzCommand}" />
|
||||
Command="{Binding DeleteEkzCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Rectangle Canvas.Left="4" Canvas.Top="5" Width="8" Height="8" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="3" Canvas.Top="3" Width="10" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="6" Canvas.Top="1.5" Width="4" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="6" Canvas.Top="6.5" Width="1" Height="5" Fill="White" />
|
||||
<Rectangle Canvas.Left="9" Canvas.Top="6.5" Width="1" Height="5" Fill="White" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
</DataGrid.ContextMenu>
|
||||
<DataGrid.RowStyle>
|
||||
|
||||
@@ -44,11 +44,42 @@
|
||||
<DataGrid.ContextMenu>
|
||||
<ContextMenu DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}">
|
||||
<MenuItem Header="Добавить"
|
||||
Command="{Binding AddFrpdCommand}" />
|
||||
Command="{Binding AddFrpdCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Grid Width="16" Height="16">
|
||||
<Ellipse Width="14" Height="14" Fill="{StaticResource AppMenuIconAccentBrush}" />
|
||||
<Rectangle Width="2" Height="8" Fill="White" RadiusX="1" RadiusY="1" />
|
||||
<Rectangle Width="8" Height="2" Fill="White" RadiusX="1" RadiusY="1" />
|
||||
</Grid>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Изменить"
|
||||
Command="{Binding EditFrpdCommand}" />
|
||||
Command="{Binding EditFrpdCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Path Fill="{StaticResource AppMenuIconAccentBrush}" Data="M11.7,1.4 L14.6,4.3 L5.5,13.4 L2.5,13.9 L3,10.9 Z" />
|
||||
<Path Fill="#FFEAF3FB" Data="M10.7,2.4 L13.6,5.3 L12.8,6.1 L9.9,3.2 Z" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Удалить"
|
||||
Command="{Binding DeleteFrpdCommand}" />
|
||||
Command="{Binding DeleteFrpdCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Rectangle Canvas.Left="4" Canvas.Top="5" Width="8" Height="8" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="3" Canvas.Top="3" Width="10" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="6" Canvas.Top="1.5" Width="4" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="6" Canvas.Top="6.5" Width="1" Height="5" Fill="White" />
|
||||
<Rectangle Canvas.Left="9" Canvas.Top="6.5" Width="1" Height="5" Fill="White" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
</DataGrid.ContextMenu>
|
||||
<DataGrid.RowStyle>
|
||||
@@ -76,11 +107,42 @@
|
||||
<DataGrid.ContextMenu>
|
||||
<ContextMenu DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}">
|
||||
<MenuItem Header="Добавить"
|
||||
Command="{Binding AddFrpdvdCommand}" />
|
||||
Command="{Binding AddFrpdvdCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Grid Width="16" Height="16">
|
||||
<Ellipse Width="14" Height="14" Fill="{StaticResource AppMenuIconAccentBrush}" />
|
||||
<Rectangle Width="2" Height="8" Fill="White" RadiusX="1" RadiusY="1" />
|
||||
<Rectangle Width="8" Height="2" Fill="White" RadiusX="1" RadiusY="1" />
|
||||
</Grid>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Изменить"
|
||||
Command="{Binding EditFrpdvdCommand}" />
|
||||
Command="{Binding EditFrpdvdCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Path Fill="{StaticResource AppMenuIconAccentBrush}" Data="M11.7,1.4 L14.6,4.3 L5.5,13.4 L2.5,13.9 L3,10.9 Z" />
|
||||
<Path Fill="#FFEAF3FB" Data="M10.7,2.4 L13.6,5.3 L12.8,6.1 L9.9,3.2 Z" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Удалить"
|
||||
Command="{Binding DeleteFrpdvdCommand}" />
|
||||
Command="{Binding DeleteFrpdvdCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Rectangle Canvas.Left="4" Canvas.Top="5" Width="8" Height="8" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="3" Canvas.Top="3" Width="10" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="6" Canvas.Top="1.5" Width="4" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="6" Canvas.Top="6.5" Width="1" Height="5" Fill="White" />
|
||||
<Rectangle Canvas.Left="9" Canvas.Top="6.5" Width="1" Height="5" Fill="White" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
</DataGrid.ContextMenu>
|
||||
<DataGrid.RowStyle>
|
||||
|
||||
@@ -97,12 +97,44 @@
|
||||
<ListBox.ContextMenu>
|
||||
<ContextMenu DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}">
|
||||
<MenuItem Header="Добавить"
|
||||
Command="{Binding AddDocumentCommand}" />
|
||||
Command="{Binding AddDocumentCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Grid Width="16" Height="16">
|
||||
<Ellipse Width="14" Height="14" Fill="{StaticResource AppMenuIconAccentBrush}" />
|
||||
<Rectangle Width="2" Height="8" Fill="White" RadiusX="1" RadiusY="1" />
|
||||
<Rectangle Width="8" Height="2" Fill="White" RadiusX="1" RadiusY="1" />
|
||||
</Grid>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Распечатать"
|
||||
Command="{Binding PrintDocumentCommand}" />
|
||||
Command="{Binding PrintDocumentCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Rectangle Canvas.Left="4" Canvas.Top="1.5" Width="8" Height="4" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconAccentBrush}" />
|
||||
<Rectangle Canvas.Left="2" Canvas.Top="5" Width="12" Height="5" RadiusX="1.5" RadiusY="1.5" Fill="{StaticResource AppMenuIconAccentBrush}" />
|
||||
<Rectangle Canvas.Left="4" Canvas.Top="8.5" Width="8" Height="5" Fill="#FFF9FCFE" Stroke="{StaticResource AppMenuIconAccentBrush}" StrokeThickness="1" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<Separator/>
|
||||
<MenuItem Header="Удалить"
|
||||
Command="{Binding DeleteDocumentCommand}" />
|
||||
Command="{Binding DeleteDocumentCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Rectangle Canvas.Left="4" Canvas.Top="5" Width="8" Height="8" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="3" Canvas.Top="3" Width="10" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="6" Canvas.Top="1.5" Width="4" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="6" Canvas.Top="6.5" Width="1" Height="5" Fill="White" />
|
||||
<Rectangle Canvas.Left="9" Canvas.Top="6.5" Width="1" Height="5" Fill="White" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
</ListBox.ContextMenu>
|
||||
<ListBox.ItemContainerStyle>
|
||||
@@ -339,12 +371,49 @@
|
||||
<DataGrid.ContextMenu>
|
||||
<ContextMenu DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}">
|
||||
<MenuItem Header="Добавить по заводским номерам"
|
||||
Command="{Binding OpenInstrumentPickerCommand}" />
|
||||
Command="{Binding OpenInstrumentPickerCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Rectangle Canvas.Left="2" Canvas.Top="3" Width="8" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconAccentBrush}" />
|
||||
<Rectangle Canvas.Left="2" Canvas.Top="7" Width="8" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconAccentBrush}" />
|
||||
<Rectangle Canvas.Left="2" Canvas.Top="11" Width="6" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconAccentBrush}" />
|
||||
<Ellipse Canvas.Left="10.5" Canvas.Top="6" Width="4" Height="4" Fill="{StaticResource AppMenuIconSuccessBrush}" />
|
||||
<Rectangle Canvas.Left="12" Canvas.Top="4.5" Width="1" Height="7" Fill="{StaticResource AppMenuIconSuccessBrush}" />
|
||||
<Rectangle Canvas.Left="9.5" Canvas.Top="7" Width="6" Height="1" Fill="{StaticResource AppMenuIconSuccessBrush}" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Добавить по типу"
|
||||
Command="{Binding OpenInstrumentTypePickerCommand}" />
|
||||
Command="{Binding OpenInstrumentTypePickerCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Rectangle Canvas.Left="2" Canvas.Top="3" Width="5" Height="5" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconAccentBrush}" />
|
||||
<Rectangle Canvas.Left="2" Canvas.Top="9" Width="5" Height="5" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconAccentBrush}" />
|
||||
<Rectangle Canvas.Left="8" Canvas.Top="6" Width="5" Height="5" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconAccentBrush}" />
|
||||
<Rectangle Canvas.Left="12" Canvas.Top="1.5" Width="1.5" Height="5" Fill="{StaticResource AppMenuIconSuccessBrush}" />
|
||||
<Rectangle Canvas.Left="10.25" Canvas.Top="3.25" Width="5" Height="1.5" Fill="{StaticResource AppMenuIconSuccessBrush}" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<Separator/>
|
||||
<MenuItem Header="Удалить"
|
||||
Command="{Binding DeleteSelectedGroupsCommand}" />
|
||||
Command="{Binding DeleteSelectedGroupsCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Rectangle Canvas.Left="4" Canvas.Top="5" Width="8" Height="8" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="3" Canvas.Top="3" Width="10" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="6" Canvas.Top="1.5" Width="4" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="6" Canvas.Top="6.5" Width="1" Height="5" Fill="White" />
|
||||
<Rectangle Canvas.Left="9" Canvas.Top="6.5" Width="1" Height="5" Fill="White" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
</DataGrid.ContextMenu>
|
||||
<DataGrid.RowStyle>
|
||||
@@ -440,17 +509,64 @@
|
||||
<DataGrid.ContextMenu>
|
||||
<ContextMenu DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}">
|
||||
<MenuItem Header="Клонировать поверку в выбранные строки"
|
||||
Command="{Binding CloneLineVerificationCommand}" />
|
||||
Command="{Binding CloneLineVerificationCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Rectangle Canvas.Left="3" Canvas.Top="4" Width="7" Height="8" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconAccentBrush}" />
|
||||
<Rectangle Canvas.Left="6" Canvas.Top="2" Width="7" Height="8" RadiusX="1" RadiusY="1" Fill="#FFEAF3FB" Stroke="{StaticResource AppMenuIconAccentBrush}" StrokeThickness="1" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Распечатать документ о поверке"
|
||||
Command="{Binding PrintVerificationDocumentCommand}" />
|
||||
Command="{Binding PrintVerificationDocumentCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Rectangle Canvas.Left="4" Canvas.Top="1.5" Width="8" Height="4" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconAccentBrush}" />
|
||||
<Rectangle Canvas.Left="2" Canvas.Top="5" Width="12" Height="5" RadiusX="1.5" RadiusY="1.5" Fill="{StaticResource AppMenuIconAccentBrush}" />
|
||||
<Rectangle Canvas.Left="4" Canvas.Top="8.5" Width="8" Height="5" Fill="#FFF9FCFE" Stroke="{StaticResource AppMenuIconAccentBrush}" StrokeThickness="1" />
|
||||
<Ellipse Canvas.Left="10.5" Canvas.Top="9.5" Width="4" Height="4" Fill="{StaticResource AppMenuIconSuccessBrush}" />
|
||||
<Path Fill="White" Data="M12.1,10.4 L12.9,11.2 L14.2,9.6 L14.8,10.1 L12.9,12.4 L11.5,11 Z" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<Separator/>
|
||||
<MenuItem Header="Годен"
|
||||
Command="{Binding MarkLinePassedCommand}" />
|
||||
Command="{Binding MarkLinePassedCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Grid Width="16" Height="16">
|
||||
<Ellipse Width="14" Height="14" Fill="{StaticResource AppMenuIconSuccessBrush}" />
|
||||
<Path Fill="White" Data="M5.1,8.2 L7.2,10.3 L11.6,5.6 L12.8,6.6 L7.3,12.3 L3.9,8.9 Z" />
|
||||
</Grid>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Забракован"
|
||||
Command="{Binding MarkLineRejectedCommand}" />
|
||||
Command="{Binding MarkLineRejectedCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Grid Width="16" Height="16">
|
||||
<Ellipse Width="14" Height="14" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Path Stroke="White" StrokeThickness="1.8" StrokeStartLineCap="Round" StrokeEndLineCap="Round" Data="M5.1,5.1 L10.9,10.9 M10.9,5.1 L5.1,10.9" />
|
||||
</Grid>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<Separator/>
|
||||
<MenuItem Header="Отменить проверку"
|
||||
Command="{Binding ResetLineVerificationCommand}" />
|
||||
Command="{Binding ResetLineVerificationCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Path Fill="{StaticResource AppMenuIconWarningBrush}" Data="M7.8,2.2 C10.8,2.2 13.2,4.6 13.2,7.6 C13.2,10.6 10.8,13 7.8,13 C5.5,13 3.6,11.6 2.8,9.5 L4.5,9.5 C5.2,10.8 6.4,11.5 7.8,11.5 C10,11.5 11.7,9.8 11.7,7.6 C11.7,5.4 10,3.7 7.8,3.7 C6.5,3.7 5.3,4.3 4.6,5.4 L6.7,5.4 L3.8,8.2 L1.1,5.4 L3.1,5.4 C4,3.4 5.8,2.2 7.8,2.2 Z" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Удалить"
|
||||
Command="{Binding DeleteSelectedLinesCommand}">
|
||||
<MenuItem.Icon>
|
||||
|
||||
@@ -45,11 +45,42 @@
|
||||
<DataGrid.ContextMenu>
|
||||
<ContextMenu DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}">
|
||||
<MenuItem Header="Добавить"
|
||||
Command="{Binding AddPrsnCommand}" />
|
||||
Command="{Binding AddPrsnCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Grid Width="16" Height="16">
|
||||
<Ellipse Width="14" Height="14" Fill="{StaticResource AppMenuIconAccentBrush}" />
|
||||
<Rectangle Width="2" Height="8" Fill="White" RadiusX="1" RadiusY="1" />
|
||||
<Rectangle Width="8" Height="2" Fill="White" RadiusX="1" RadiusY="1" />
|
||||
</Grid>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Изменить"
|
||||
Command="{Binding EditPrsnCommand}" />
|
||||
Command="{Binding EditPrsnCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Path Fill="{StaticResource AppMenuIconAccentBrush}" Data="M11.7,1.4 L14.6,4.3 L5.5,13.4 L2.5,13.9 L3,10.9 Z" />
|
||||
<Path Fill="#FFEAF3FB" Data="M10.7,2.4 L13.6,5.3 L12.8,6.1 L9.9,3.2 Z" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Удалить"
|
||||
Command="{Binding DeletePrsnCommand}" />
|
||||
Command="{Binding DeletePrsnCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Rectangle Canvas.Left="4" Canvas.Top="5" Width="8" Height="8" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="3" Canvas.Top="3" Width="10" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="6" Canvas.Top="1.5" Width="4" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="6" Canvas.Top="6.5" Width="1" Height="5" Fill="White" />
|
||||
<Rectangle Canvas.Left="9" Canvas.Top="6.5" Width="1" Height="5" Fill="White" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
</DataGrid.ContextMenu>
|
||||
<DataGrid.RowStyle>
|
||||
@@ -82,11 +113,42 @@
|
||||
<DataGrid.ContextMenu>
|
||||
<ContextMenu DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}">
|
||||
<MenuItem Header="Добавить"
|
||||
Command="{Binding AddPrfrCommand}" />
|
||||
Command="{Binding AddPrfrCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Grid Width="16" Height="16">
|
||||
<Ellipse Width="14" Height="14" Fill="{StaticResource AppMenuIconAccentBrush}" />
|
||||
<Rectangle Width="2" Height="8" Fill="White" RadiusX="1" RadiusY="1" />
|
||||
<Rectangle Width="8" Height="2" Fill="White" RadiusX="1" RadiusY="1" />
|
||||
</Grid>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Изменить"
|
||||
Command="{Binding EditPrfrCommand}" />
|
||||
Command="{Binding EditPrfrCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Path Fill="{StaticResource AppMenuIconAccentBrush}" Data="M11.7,1.4 L14.6,4.3 L5.5,13.4 L2.5,13.9 L3,10.9 Z" />
|
||||
<Path Fill="#FFEAF3FB" Data="M10.7,2.4 L13.6,5.3 L12.8,6.1 L9.9,3.2 Z" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Удалить"
|
||||
Command="{Binding DeletePrfrCommand}" />
|
||||
Command="{Binding DeletePrfrCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Rectangle Canvas.Left="4" Canvas.Top="5" Width="8" Height="8" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="3" Canvas.Top="3" Width="10" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="6" Canvas.Top="1.5" Width="4" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="6" Canvas.Top="6.5" Width="1" Height="5" Fill="White" />
|
||||
<Rectangle Canvas.Left="9" Canvas.Top="6.5" Width="1" Height="5" Fill="White" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
</DataGrid.ContextMenu>
|
||||
<DataGrid.RowStyle>
|
||||
@@ -127,11 +189,42 @@
|
||||
<DataGrid.ContextMenu>
|
||||
<ContextMenu DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}">
|
||||
<MenuItem Header="Добавить"
|
||||
Command="{Binding AddPrfrvdCommand}" />
|
||||
Command="{Binding AddPrfrvdCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Grid Width="16" Height="16">
|
||||
<Ellipse Width="14" Height="14" Fill="{StaticResource AppMenuIconAccentBrush}" />
|
||||
<Rectangle Width="2" Height="8" Fill="White" RadiusX="1" RadiusY="1" />
|
||||
<Rectangle Width="8" Height="2" Fill="White" RadiusX="1" RadiusY="1" />
|
||||
</Grid>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Изменить"
|
||||
Command="{Binding EditPrfrvdCommand}" />
|
||||
Command="{Binding EditPrfrvdCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Path Fill="{StaticResource AppMenuIconAccentBrush}" Data="M11.7,1.4 L14.6,4.3 L5.5,13.4 L2.5,13.9 L3,10.9 Z" />
|
||||
<Path Fill="#FFEAF3FB" Data="M10.7,2.4 L13.6,5.3 L12.8,6.1 L9.9,3.2 Z" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Удалить"
|
||||
Command="{Binding DeletePrfrvdCommand}" />
|
||||
Command="{Binding DeletePrfrvdCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Rectangle Canvas.Left="4" Canvas.Top="5" Width="8" Height="8" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="3" Canvas.Top="3" Width="10" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="6" Canvas.Top="1.5" Width="4" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="6" Canvas.Top="6.5" Width="1" Height="5" Fill="White" />
|
||||
<Rectangle Canvas.Left="9" Canvas.Top="6.5" Width="1" Height="5" Fill="White" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
</DataGrid.ContextMenu>
|
||||
<DataGrid.RowStyle>
|
||||
@@ -158,11 +251,42 @@
|
||||
<DataGrid.ContextMenu>
|
||||
<ContextMenu DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}">
|
||||
<MenuItem Header="Добавить"
|
||||
Command="{Binding AddPrdspvCommand}" />
|
||||
Command="{Binding AddPrdspvCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Grid Width="16" Height="16">
|
||||
<Ellipse Width="14" Height="14" Fill="{StaticResource AppMenuIconAccentBrush}" />
|
||||
<Rectangle Width="2" Height="8" Fill="White" RadiusX="1" RadiusY="1" />
|
||||
<Rectangle Width="8" Height="2" Fill="White" RadiusX="1" RadiusY="1" />
|
||||
</Grid>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Изменить"
|
||||
Command="{Binding EditPrdspvCommand}" />
|
||||
Command="{Binding EditPrdspvCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Path Fill="{StaticResource AppMenuIconAccentBrush}" Data="M11.7,1.4 L14.6,4.3 L5.5,13.4 L2.5,13.9 L3,10.9 Z" />
|
||||
<Path Fill="#FFEAF3FB" Data="M10.7,2.4 L13.6,5.3 L12.8,6.1 L9.9,3.2 Z" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Удалить"
|
||||
Command="{Binding DeletePrdspvCommand}" />
|
||||
Command="{Binding DeletePrdspvCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Rectangle Canvas.Left="4" Canvas.Top="5" Width="8" Height="8" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="3" Canvas.Top="3" Width="10" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="6" Canvas.Top="1.5" Width="4" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="6" Canvas.Top="6.5" Width="1" Height="5" Fill="White" />
|
||||
<Rectangle Canvas.Left="9" Canvas.Top="6.5" Width="1" Height="5" Fill="White" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
</DataGrid.ContextMenu>
|
||||
<DataGrid.RowStyle>
|
||||
|
||||
@@ -88,7 +88,7 @@ ORDER BY fr.NMFRPD;";
|
||||
return customers;
|
||||
}
|
||||
|
||||
public Task<IReadOnlyList<CustomerReference>> LoadCustomersAsync(CancellationToken cancellationToken = default)
|
||||
public async Task<IReadOnlyList<CustomerReference>> LoadCustomersAsync(CancellationToken cancellationToken = default)
|
||||
{
|
||||
const string sql = @"
|
||||
SELECT
|
||||
@@ -100,7 +100,7 @@ WHERE z.IDFRPDV IS NOT NULL
|
||||
GROUP BY z.IDFRPDV, fr.NMFRPD
|
||||
ORDER BY fr.NMFRPD;";
|
||||
|
||||
return SqlServerConnectionFactory.Current.QueryOpenConnectionAsync(
|
||||
return await SqlServerConnectionFactory.Current.QueryOpenConnectionAsync(
|
||||
sql,
|
||||
delegate(SqlDataReader reader)
|
||||
{
|
||||
@@ -111,10 +111,7 @@ ORDER BY fr.NMFRPD;";
|
||||
};
|
||||
},
|
||||
ConfigureCommandTimeout,
|
||||
cancellationToken).ContinueWith<IReadOnlyList<CustomerReference>>(delegate(Task<List<CustomerReference>> task)
|
||||
{
|
||||
return task.Result;
|
||||
}, cancellationToken, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
|
||||
cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public IReadOnlyList<PersonReference> LoadVerifiers()
|
||||
@@ -151,7 +148,7 @@ ORDER BY p.PRFIO;";
|
||||
return verifiers;
|
||||
}
|
||||
|
||||
public Task<IReadOnlyList<PersonReference>> LoadVerifiersAsync(CancellationToken cancellationToken = default)
|
||||
public async Task<IReadOnlyList<PersonReference>> LoadVerifiersAsync(CancellationToken cancellationToken = default)
|
||||
{
|
||||
const string sql = @"
|
||||
SELECT
|
||||
@@ -161,7 +158,7 @@ FROM dbo.PRSN p
|
||||
WHERE NULLIF(LTRIM(RTRIM(p.PRFIO)), N'') IS NOT NULL
|
||||
ORDER BY p.PRFIO;";
|
||||
|
||||
return SqlServerConnectionFactory.Current.QueryOpenConnectionAsync(
|
||||
return await SqlServerConnectionFactory.Current.QueryOpenConnectionAsync(
|
||||
sql,
|
||||
delegate(SqlDataReader reader)
|
||||
{
|
||||
@@ -172,10 +169,7 @@ ORDER BY p.PRFIO;";
|
||||
};
|
||||
},
|
||||
ConfigureCommandTimeout,
|
||||
cancellationToken).ContinueWith<IReadOnlyList<PersonReference>>(delegate(Task<List<PersonReference>> task)
|
||||
{
|
||||
return task.Result;
|
||||
}, cancellationToken, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
|
||||
cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public IReadOnlyList<DocumentFormReference> LoadVerificationDocumentForms(bool isPassed)
|
||||
@@ -220,7 +214,7 @@ ORDER BY fr.NMFRD, v.IDVDODVDD;";
|
||||
return forms;
|
||||
}
|
||||
|
||||
public Task<IReadOnlyList<DocumentFormReference>> LoadVerificationDocumentFormsAsync(bool isPassed, CancellationToken cancellationToken = default)
|
||||
public async Task<IReadOnlyList<DocumentFormReference>> LoadVerificationDocumentFormsAsync(bool isPassed, CancellationToken cancellationToken = default)
|
||||
{
|
||||
const string sql = @"
|
||||
SELECT DISTINCT
|
||||
@@ -235,7 +229,7 @@ WHERE v.IDSPVDOD = 2
|
||||
AND fr.IDSPVDD = @DocumentTypeId
|
||||
ORDER BY fr.NMFRD, v.IDVDODVDD;";
|
||||
|
||||
return SqlServerConnectionFactory.Current.QueryOpenConnectionAsync(
|
||||
return await SqlServerConnectionFactory.Current.QueryOpenConnectionAsync(
|
||||
sql,
|
||||
delegate(SqlDataReader reader)
|
||||
{
|
||||
@@ -252,10 +246,7 @@ ORDER BY fr.NMFRD, v.IDVDODVDD;";
|
||||
ConfigureCommandTimeout(command);
|
||||
command.Parameters.Add("@DocumentTypeId", SqlDbType.Int).Value = isPassed ? 6 : 2;
|
||||
},
|
||||
cancellationToken).ContinueWith<IReadOnlyList<DocumentFormReference>>(delegate(Task<List<DocumentFormReference>> task)
|
||||
{
|
||||
return task.Result;
|
||||
}, cancellationToken, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
|
||||
cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public IReadOnlyList<SpoiDirectoryItem> LoadSpoiItems()
|
||||
@@ -293,7 +284,7 @@ ORDER BY s.NMOI, s.KDOI, s.IDSPOI;";
|
||||
return items;
|
||||
}
|
||||
|
||||
public Task<IReadOnlyList<SpoiDirectoryItem>> LoadSpoiItemsAsync(CancellationToken cancellationToken = default)
|
||||
public async Task<IReadOnlyList<SpoiDirectoryItem>> LoadSpoiItemsAsync(CancellationToken cancellationToken = default)
|
||||
{
|
||||
const string sql = @"
|
||||
SELECT
|
||||
@@ -303,7 +294,7 @@ SELECT
|
||||
FROM dbo.SPOI s
|
||||
ORDER BY s.NMOI, s.KDOI, s.IDSPOI;";
|
||||
|
||||
return SqlServerConnectionFactory.Current.QueryOpenConnectionAsync(
|
||||
return await SqlServerConnectionFactory.Current.QueryOpenConnectionAsync(
|
||||
sql,
|
||||
delegate(SqlDataReader reader)
|
||||
{
|
||||
@@ -315,10 +306,7 @@ ORDER BY s.NMOI, s.KDOI, s.IDSPOI;";
|
||||
};
|
||||
},
|
||||
ConfigureCommandTimeout,
|
||||
cancellationToken).ContinueWith<IReadOnlyList<SpoiDirectoryItem>>(delegate(Task<List<SpoiDirectoryItem>> task)
|
||||
{
|
||||
return task.Result;
|
||||
}, cancellationToken, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
|
||||
cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public int AddSpoiItem(SpoiDirectoryItem item)
|
||||
@@ -499,7 +487,7 @@ ORDER BY s.NMTP, s.IDSPNMTP;";
|
||||
return items;
|
||||
}
|
||||
|
||||
public Task<IReadOnlyList<SpnmtpDirectoryItem>> LoadSpnmtpItemsAsync(CancellationToken cancellationToken = default)
|
||||
public async Task<IReadOnlyList<SpnmtpDirectoryItem>> LoadSpnmtpItemsAsync(CancellationToken cancellationToken = default)
|
||||
{
|
||||
const string sql = @"
|
||||
SELECT
|
||||
@@ -509,7 +497,7 @@ SELECT
|
||||
FROM dbo.SPNMTP s
|
||||
ORDER BY s.NMTP, s.IDSPNMTP;";
|
||||
|
||||
return SqlServerConnectionFactory.Current.QueryOpenConnectionAsync(
|
||||
return await SqlServerConnectionFactory.Current.QueryOpenConnectionAsync(
|
||||
sql,
|
||||
delegate(SqlDataReader reader)
|
||||
{
|
||||
@@ -521,10 +509,7 @@ ORDER BY s.NMTP, s.IDSPNMTP;";
|
||||
};
|
||||
},
|
||||
ConfigureCommandTimeout,
|
||||
cancellationToken).ContinueWith<IReadOnlyList<SpnmtpDirectoryItem>>(delegate(Task<List<SpnmtpDirectoryItem>> task)
|
||||
{
|
||||
return task.Result;
|
||||
}, cancellationToken, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
|
||||
cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public int AddSpnmtpItem(SpnmtpDirectoryItem item)
|
||||
@@ -1267,7 +1252,7 @@ ORDER BY names.NMTP, tips.TP, sizeInfo.DPZN, z.NNZV;";
|
||||
return instruments;
|
||||
}
|
||||
|
||||
public Task<IReadOnlyList<AvailableInstrumentItem>> LoadCustomerInstrumentsAsync(int customerId, CancellationToken cancellationToken = default)
|
||||
public async Task<IReadOnlyList<AvailableInstrumentItem>> LoadCustomerInstrumentsAsync(int customerId, CancellationToken cancellationToken = default)
|
||||
{
|
||||
const string sql = @"
|
||||
SELECT
|
||||
@@ -1343,7 +1328,7 @@ OUTER APPLY
|
||||
WHERE z.IDFRPDV = @CustomerId
|
||||
ORDER BY names.NMTP, tips.TP, sizeInfo.DPZN, z.NNZV;";
|
||||
|
||||
return SqlServerConnectionFactory.Current.QueryOpenConnectionAsync(
|
||||
return await SqlServerConnectionFactory.Current.QueryOpenConnectionAsync(
|
||||
sql,
|
||||
delegate(SqlDataReader reader)
|
||||
{
|
||||
@@ -1371,10 +1356,7 @@ ORDER BY names.NMTP, tips.TP, sizeInfo.DPZN, z.NNZV;";
|
||||
ConfigureCommandTimeout(command);
|
||||
command.Parameters.Add("@CustomerId", SqlDbType.Int).Value = customerId;
|
||||
},
|
||||
cancellationToken).ContinueWith<IReadOnlyList<AvailableInstrumentItem>>(delegate(Task<List<AvailableInstrumentItem>> task)
|
||||
{
|
||||
return task.Result;
|
||||
}, cancellationToken, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
|
||||
cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public IReadOnlyList<AvailableInstrumentItem> LoadInstrumentTypes()
|
||||
@@ -1468,7 +1450,7 @@ ORDER BY names.NMTP, tips.TP, sizeInfo.DPZN, sizeInfo.NNGSRS;";
|
||||
return instrumentTypes;
|
||||
}
|
||||
|
||||
public Task<IReadOnlyList<AvailableInstrumentItem>> LoadInstrumentTypesAsync(CancellationToken cancellationToken = default)
|
||||
public async Task<IReadOnlyList<AvailableInstrumentItem>> LoadInstrumentTypesAsync(CancellationToken cancellationToken = default)
|
||||
{
|
||||
const string sql = @"
|
||||
SELECT
|
||||
@@ -1522,7 +1504,7 @@ OUTER APPLY
|
||||
) periodByType
|
||||
ORDER BY names.NMTP, tips.TP, sizeInfo.DPZN, sizeInfo.NNGSRS;";
|
||||
|
||||
return SqlServerConnectionFactory.Current.QueryOpenConnectionAsync(
|
||||
return await SqlServerConnectionFactory.Current.QueryOpenConnectionAsync(
|
||||
sql,
|
||||
delegate(SqlDataReader reader)
|
||||
{
|
||||
@@ -1546,10 +1528,7 @@ ORDER BY names.NMTP, tips.TP, sizeInfo.DPZN, sizeInfo.NNGSRS;";
|
||||
};
|
||||
},
|
||||
ConfigureCommandTimeout,
|
||||
cancellationToken).ContinueWith<IReadOnlyList<AvailableInstrumentItem>>(delegate(Task<List<AvailableInstrumentItem>> task)
|
||||
{
|
||||
return task.Result;
|
||||
}, cancellationToken, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
|
||||
cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public IReadOnlyList<OpenDocumentConflictInfo> FindOpenDocumentConflicts(int customerId, string currentDocumentNumber, IEnumerable<PsvDocumentLine> candidateLines)
|
||||
|
||||
@@ -30,11 +30,42 @@
|
||||
<DataGrid.ContextMenu>
|
||||
<ContextMenu DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}">
|
||||
<MenuItem Header="Добавить"
|
||||
Command="{Binding AddCommand}" />
|
||||
Command="{Binding AddCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Grid Width="16" Height="16">
|
||||
<Ellipse Width="14" Height="14" Fill="{StaticResource AppMenuIconAccentBrush}" />
|
||||
<Rectangle Width="2" Height="8" Fill="White" RadiusX="1" RadiusY="1" />
|
||||
<Rectangle Width="8" Height="2" Fill="White" RadiusX="1" RadiusY="1" />
|
||||
</Grid>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Изменить"
|
||||
Command="{Binding EditCommand}" />
|
||||
Command="{Binding EditCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Path Fill="{StaticResource AppMenuIconAccentBrush}" Data="M11.7,1.4 L14.6,4.3 L5.5,13.4 L2.5,13.9 L3,10.9 Z" />
|
||||
<Path Fill="#FFEAF3FB" Data="M10.7,2.4 L13.6,5.3 L12.8,6.1 L9.9,3.2 Z" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Удалить"
|
||||
Command="{Binding DeleteCommand}" />
|
||||
Command="{Binding DeleteCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Rectangle Canvas.Left="4" Canvas.Top="5" Width="8" Height="8" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="3" Canvas.Top="3" Width="10" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="6" Canvas.Top="1.5" Width="4" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="6" Canvas.Top="6.5" Width="1" Height="5" Fill="White" />
|
||||
<Rectangle Canvas.Left="9" Canvas.Top="6.5" Width="1" Height="5" Fill="White" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
</DataGrid.ContextMenu>
|
||||
<DataGrid.RowStyle>
|
||||
|
||||
@@ -57,14 +57,54 @@
|
||||
<DataGrid.ContextMenu>
|
||||
<ContextMenu DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}">
|
||||
<MenuItem Header="Добавить"
|
||||
Command="{Binding AddTipsCommand}" />
|
||||
Command="{Binding AddTipsCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Grid Width="16" Height="16">
|
||||
<Ellipse Width="14" Height="14" Fill="{StaticResource AppMenuIconAccentBrush}" />
|
||||
<Rectangle Width="2" Height="8" Fill="White" RadiusX="1" RadiusY="1" />
|
||||
<Rectangle Width="8" Height="2" Fill="White" RadiusX="1" RadiusY="1" />
|
||||
</Grid>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Изменить"
|
||||
Command="{Binding EditTipsCommand}" />
|
||||
Command="{Binding EditTipsCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Path Fill="{StaticResource AppMenuIconAccentBrush}" Data="M11.7,1.4 L14.6,4.3 L5.5,13.4 L2.5,13.9 L3,10.9 Z" />
|
||||
<Path Fill="#FFEAF3FB" Data="M10.7,2.4 L13.6,5.3 L12.8,6.1 L9.9,3.2 Z" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Удалить"
|
||||
Command="{Binding DeleteTipsCommand}" />
|
||||
Command="{Binding DeleteTipsCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Rectangle Canvas.Left="4" Canvas.Top="5" Width="8" Height="8" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="3" Canvas.Top="3" Width="10" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="6" Canvas.Top="1.5" Width="4" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="6" Canvas.Top="6.5" Width="1" Height="5" Fill="White" />
|
||||
<Rectangle Canvas.Left="9" Canvas.Top="6.5" Width="1" Height="5" Fill="White" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<Separator />
|
||||
<MenuItem Header="Виды клейм..."
|
||||
Command="{Binding ManageTpvdklCommand}" />
|
||||
Command="{Binding ManageTpvdklCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Ellipse Canvas.Left="2.5" Canvas.Top="2.5" Width="11" Height="11" Fill="{StaticResource AppMenuIconWarningBrush}" />
|
||||
<Path Fill="White" Data="M8,4 L8.9,6.2 L11.3,6.3 L9.4,7.8 L10.1,10.1 L8,8.8 L5.9,10.1 L6.6,7.8 L4.7,6.3 L7.1,6.2 Z" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
</DataGrid.ContextMenu>
|
||||
<DataGrid.RowStyle>
|
||||
@@ -92,9 +132,40 @@
|
||||
HeadersVisibility="Column">
|
||||
<DataGrid.ContextMenu>
|
||||
<ContextMenu DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}">
|
||||
<MenuItem Header="Добавить" Command="{Binding AddTprzCommand}" />
|
||||
<MenuItem Header="Изменить" Command="{Binding EditTprzCommand}" />
|
||||
<MenuItem Header="Удалить" Command="{Binding DeleteTprzCommand}" />
|
||||
<MenuItem Header="Добавить" Command="{Binding AddTprzCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Grid Width="16" Height="16">
|
||||
<Ellipse Width="14" Height="14" Fill="{StaticResource AppMenuIconAccentBrush}" />
|
||||
<Rectangle Width="2" Height="8" Fill="White" RadiusX="1" RadiusY="1" />
|
||||
<Rectangle Width="8" Height="2" Fill="White" RadiusX="1" RadiusY="1" />
|
||||
</Grid>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Изменить" Command="{Binding EditTprzCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Path Fill="{StaticResource AppMenuIconAccentBrush}" Data="M11.7,1.4 L14.6,4.3 L5.5,13.4 L2.5,13.9 L3,10.9 Z" />
|
||||
<Path Fill="#FFEAF3FB" Data="M10.7,2.4 L13.6,5.3 L12.8,6.1 L9.9,3.2 Z" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Удалить" Command="{Binding DeleteTprzCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Rectangle Canvas.Left="4" Canvas.Top="5" Width="8" Height="8" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="3" Canvas.Top="3" Width="10" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="6" Canvas.Top="1.5" Width="4" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="6" Canvas.Top="6.5" Width="1" Height="5" Fill="White" />
|
||||
<Rectangle Canvas.Left="9" Canvas.Top="6.5" Width="1" Height="5" Fill="White" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
</DataGrid.ContextMenu>
|
||||
<DataGrid.RowStyle>
|
||||
@@ -129,9 +200,40 @@
|
||||
HeadersVisibility="Column">
|
||||
<DataGrid.ContextMenu>
|
||||
<ContextMenu DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}">
|
||||
<MenuItem Header="Добавить" Command="{Binding AddTprmkCommand}" />
|
||||
<MenuItem Header="Изменить" Command="{Binding EditTprmkCommand}" />
|
||||
<MenuItem Header="Удалить" Command="{Binding DeleteTprmkCommand}" />
|
||||
<MenuItem Header="Добавить" Command="{Binding AddTprmkCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Grid Width="16" Height="16">
|
||||
<Ellipse Width="14" Height="14" Fill="{StaticResource AppMenuIconAccentBrush}" />
|
||||
<Rectangle Width="2" Height="8" Fill="White" RadiusX="1" RadiusY="1" />
|
||||
<Rectangle Width="8" Height="2" Fill="White" RadiusX="1" RadiusY="1" />
|
||||
</Grid>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Изменить" Command="{Binding EditTprmkCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Path Fill="{StaticResource AppMenuIconAccentBrush}" Data="M11.7,1.4 L14.6,4.3 L5.5,13.4 L2.5,13.9 L3,10.9 Z" />
|
||||
<Path Fill="#FFEAF3FB" Data="M10.7,2.4 L13.6,5.3 L12.8,6.1 L9.9,3.2 Z" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Удалить" Command="{Binding DeleteTprmkCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Rectangle Canvas.Left="4" Canvas.Top="5" Width="8" Height="8" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="3" Canvas.Top="3" Width="10" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="6" Canvas.Top="1.5" Width="4" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="6" Canvas.Top="6.5" Width="1" Height="5" Fill="White" />
|
||||
<Rectangle Canvas.Left="9" Canvas.Top="6.5" Width="1" Height="5" Fill="White" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
</DataGrid.ContextMenu>
|
||||
<DataGrid.RowStyle>
|
||||
@@ -158,9 +260,40 @@
|
||||
HeadersVisibility="Column">
|
||||
<DataGrid.ContextMenu>
|
||||
<ContextMenu DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}">
|
||||
<MenuItem Header="Добавить" Command="{Binding AddTprmcpCommand}" />
|
||||
<MenuItem Header="Изменить" Command="{Binding EditTprmcpCommand}" />
|
||||
<MenuItem Header="Удалить" Command="{Binding DeleteTprmcpCommand}" />
|
||||
<MenuItem Header="Добавить" Command="{Binding AddTprmcpCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Grid Width="16" Height="16">
|
||||
<Ellipse Width="14" Height="14" Fill="{StaticResource AppMenuIconAccentBrush}" />
|
||||
<Rectangle Width="2" Height="8" Fill="White" RadiusX="1" RadiusY="1" />
|
||||
<Rectangle Width="8" Height="2" Fill="White" RadiusX="1" RadiusY="1" />
|
||||
</Grid>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Изменить" Command="{Binding EditTprmcpCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Path Fill="{StaticResource AppMenuIconAccentBrush}" Data="M11.7,1.4 L14.6,4.3 L5.5,13.4 L2.5,13.9 L3,10.9 Z" />
|
||||
<Path Fill="#FFEAF3FB" Data="M10.7,2.4 L13.6,5.3 L12.8,6.1 L9.9,3.2 Z" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Удалить" Command="{Binding DeleteTprmcpCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="14" Height="14">
|
||||
<Canvas Width="16" Height="16">
|
||||
<Rectangle Canvas.Left="4" Canvas.Top="5" Width="8" Height="8" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="3" Canvas.Top="3" Width="10" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="6" Canvas.Top="1.5" Width="4" Height="2" RadiusX="1" RadiusY="1" Fill="{StaticResource AppMenuIconDangerBrush}" />
|
||||
<Rectangle Canvas.Left="6" Canvas.Top="6.5" Width="1" Height="5" Fill="White" />
|
||||
<Rectangle Canvas.Left="9" Canvas.Top="6.5" Width="1" Height="5" Fill="White" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
</DataGrid.ContextMenu>
|
||||
<DataGrid.RowStyle>
|
||||
|
||||
Reference in New Issue
Block a user