Files
DE70/UserControl/MaintainanceUC.xaml.cs

61 lines
1.7 KiB
C#

using DE70_CMDv2;
using SafeBagDE70.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace SafeBagDE70
{
/// <summary>
/// Interaction logic for CollectionUC.xaml
/// </summary>
public partial class MaintainanceUC : UserControl
{
private bool _bContinue = false;
private bool _bPlaySound = false;
public MaintainanceUC()
{
InitializeComponent();
}
public void ShowInfor(string strInfor, bool bContinue = false, bool bPlaySound=true)
{
lblInfor.Text = strInfor;
_bContinue = bContinue;
_bPlaySound = bPlaySound;
if (_bPlaySound)
SoundManager.StartWarningSound();
}
private void btnEnd_Click(object sender, RoutedEventArgs e)
{
if (_bContinue)
{
((MainWindow)Application.Current.MainWindow).ShowDepositScreen(false);
((MainWindow)Application.Current.MainWindow).ResetTimers();
}
else
((MainWindow)Application.Current.MainWindow).ShowWelcomeScreen();
SoundManager.StopWarningSound();
}
private void btnCancel_Click(object sender, RoutedEventArgs e)
{
if (AppData.cCmdRsp != null)
AppData.cCmdRsp.SendXXCmd((byte)Command.CMD_DE_CANCEL);
SoundManager.StopWarningSound();
}
}
}