核对处方及根据状态判断能否勾选

This commit is contained in:
maqiao 2024-11-25 11:09:59 +08:00
parent 4cf2de08e1
commit 9f918d8aeb
5 changed files with 219 additions and 121 deletions

View File

@ -16,7 +16,7 @@ namespace DM_Weight.Converter
int iLength = value[0].ToString().Length; int iLength = value[0].ToString().Length;
int ButtonDrawerNo = int.Parse(value[0].ToString().Substring(0, iLength-3)); int ButtonDrawerNo = int.Parse(value[0].ToString().Substring(0, iLength-3));
int SelectedDrawerNo = int.Parse(value[1].ToString()); int SelectedDrawerNo = int.Parse(value[1].ToString());
return ButtonDrawerNo == SelectedDrawerNo; return ButtonDrawerNo == SelectedDrawerNo+1;
} }
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)

View File

@ -162,6 +162,7 @@ namespace DM_Weight.ViewModels
public bool IsEnabled18 { get => _IsEnabled18; set => SetProperty(ref _IsEnabled18, value); } public bool IsEnabled18 { get => _IsEnabled18; set => SetProperty(ref _IsEnabled18, value); }
#endregion #endregion
#region
private Brush _button1Color = Brushes.White; private Brush _button1Color = Brushes.White;
public Brush Button1Color public Brush Button1Color
{ {
@ -270,6 +271,7 @@ namespace DM_Weight.ViewModels
get => _button18Color; get => _button18Color;
set => SetProperty(ref _button18Color, value); set => SetProperty(ref _button18Color, value);
} }
#endregion
IEventAggregator _eventAggregator; IEventAggregator _eventAggregator;
private PortUtil _portUtil; private PortUtil _portUtil;
@ -761,7 +763,7 @@ namespace DM_Weight.ViewModels
DrawerNo = Convert.ToInt32(strDrawerNo); DrawerNo = Convert.ToInt32(strDrawerNo);
MachineRecord machineRecord = new MachineRecord(); MachineRecord machineRecord = new MachineRecord();
machineRecord.MachineId = "DM5"; machineRecord.MachineId = "DM5";
machineRecord.DrawerNo = DrawerNo; machineRecord.DrawerNo = DrawerNo + 1;
machineRecord.Operator = HomeWindowViewModel.Operator?.Id; machineRecord.Operator = HomeWindowViewModel.Operator?.Id;
machineRecord.OperationTime = DateTime.Now; machineRecord.OperationTime = DateTime.Now;
machineRecord.Type = 55; machineRecord.Type = 55;
@ -770,7 +772,6 @@ namespace DM_Weight.ViewModels
if (DrawerNo > 0) if (DrawerNo > 0)
{ {
DrawerNo -= 1;
RequestData(); RequestData();
Status = 1; Status = 1;
_portUtil.SpeakAsync($"正在打开{DrawerNo + 1}号药箱"); _portUtil.SpeakAsync($"正在打开{DrawerNo + 1}号药箱");
@ -781,11 +782,16 @@ namespace DM_Weight.ViewModels
//设置对应药箱按钮可用状态 //设置对应药箱按钮可用状态
SetIsEnableStatus(DrawerNo, false); SetIsEnableStatus(DrawerNo, false);
//_eventAggregator.GetEvent<BoxOpenStatusEvent>().Publish(); //_eventAggregator.GetEvent<BoxOpenStatusEvent>().Publish();
CheckBoxStatusTimer = new System.Timers.Timer(); if (CheckBoxStatusTimer is null)
{
CheckBoxStatusTimer.Elapsed += new System.Timers.ElapsedEventHandler(GetAllBoxState); CheckBoxStatusTimer = new System.Timers.Timer();
CheckBoxStatusTimer.Interval = 3000; }
CheckBoxStatusTimer.Start(); if (!CheckBoxStatusTimer.Enabled)
{
CheckBoxStatusTimer.Elapsed += new System.Timers.ElapsedEventHandler(GetAllBoxState);
CheckBoxStatusTimer.Interval = 3000;
CheckBoxStatusTimer.Start();
}
//设置对应药箱按钮可用状态 //设置对应药箱按钮可用状态
//SetIsEnableStatus(DrawerNo, false); //SetIsEnableStatus(DrawerNo, false);
} }
@ -869,11 +875,14 @@ namespace DM_Weight.ViewModels
//查询药箱是否关闭,如果已经关闭则按钮可用,可继续开该编号的药箱 //查询药箱是否关闭,如果已经关闭则按钮可用,可继续开该编号的药箱
if (DrawerNo >= 0) if (DrawerNo >= 0)
{ {
bool[] boolArrs = { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false };// ModbusHelper.GetInstance().GetAllBoxState(); bool[] boolArrs = ModbusHelper.GetInstance().GetAllBoxState();
bool allFalse = Array.TrueForAll(boolArrs, b => b == false); bool allFalse = Array.TrueForAll(boolArrs, b => b == false);
if (allFalse) if (allFalse)
{ {
CheckBoxStatusTimer.Stop(); if (CheckBoxStatusTimer.Enabled)
{
CheckBoxStatusTimer.Stop();
}
} }
for (int i = 0; i < boolArrs.Length; i++) for (int i = 0; i < boolArrs.Length; i++)
{ {

View File

@ -16,6 +16,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Timers;
using System.Windows.Media; using System.Windows.Media;
namespace DM_Weight.ViewModels namespace DM_Weight.ViewModels
@ -23,6 +24,7 @@ namespace DM_Weight.ViewModels
internal class CheckSelfOrderWindowViewModel : BindableBase, INavigationAware, IRegionMemberLifetime internal class CheckSelfOrderWindowViewModel : BindableBase, INavigationAware, IRegionMemberLifetime
{ {
private readonly ILog logger = LogManager.GetLogger(typeof(CheckOrderNewWindowViewModel)); private readonly ILog logger = LogManager.GetLogger(typeof(CheckOrderNewWindowViewModel));
System.Timers.Timer CheckBoxStatusTimer;
private int _drawerType = -1; private int _drawerType = -1;
public int DrawerType public int DrawerType
@ -147,6 +149,7 @@ namespace DM_Weight.ViewModels
private OrderInfo _selectOrderInfo; private OrderInfo _selectOrderInfo;
public OrderInfo selectOrderInfo { get => _selectOrderInfo; set => SetProperty(ref _selectOrderInfo, value); } public OrderInfo selectOrderInfo { get => _selectOrderInfo; set => SetProperty(ref _selectOrderInfo, value); }
#region
private Brush _button1Color = Brushes.White; private Brush _button1Color = Brushes.White;
public Brush Button1Color public Brush Button1Color
{ {
@ -363,7 +366,7 @@ namespace DM_Weight.ViewModels
get => _button18Enable; get => _button18Enable;
set => SetProperty(ref _button18Enable, value); set => SetProperty(ref _button18Enable, value);
} }
#endregion
//设置按钮颜色 //设置按钮颜色
private void SetBtnColor(int drawerNo) private void SetBtnColor(int drawerNo)
{ {
@ -428,108 +431,108 @@ namespace DM_Weight.ViewModels
} }
} }
//设置按钮可用状态 //设置按钮可用状态
private void SetBtnEnable(int drawerNo) private void SetBtnEnable(int drawerNo,bool status)
{ {
switch (drawerNo) switch (drawerNo)
{ {
case 1: case 1:
Button1Enable = true; Button1Enable = status;
//SelfEnable=true; //SelfEnable=status;
break; break;
case 2: case 2:
Button2Enable = true; Button2Enable = status;
//SelfEnable = true; //SelfEnable = status;
break; break;
case 3: case 3:
Button3Enable = true; Button3Enable = status;
//SelfEnable = true; //SelfEnable = status;
break; break;
case 4: case 4:
Button4Enable = true; Button4Enable = status;
//SelfEnable = true; //SelfEnable = status;
break; break;
case 5: case 5:
Button5Enable = true; Button5Enable = status;
//SelfEnable = true; //SelfEnable = status;
break; break;
case 6: case 6:
Button6Enable = true; Button6Enable = status;
//SelfEnable = true; //SelfEnable = status;
break; break;
case 7: case 7:
Button7Enable = true; Button7Enable = status;
//SelfEnable = true; //SelfEnable = status;
break; break;
case 8: case 8:
Button8Enable = true; Button8Enable = status;
//SelfEnable = true; //SelfEnable = status;
break; break;
case 9: case 9:
Button9Enable = true; Button9Enable = status;
//SelfEnable = true; //SelfEnable = status;
break; break;
case 10: case 10:
Button10Enable = true; Button10Enable = status;
//SelfEnable = true; //SelfEnable = status;
break; break;
case 11: case 11:
Button11Enable = true; Button11Enable = status;
//SelfEnable = true; //SelfEnable = status;
break; break;
case 12: case 12:
Button12Enable = true; Button12Enable = status;
//SelfEnable = true; //SelfEnable = status;
break; break;
case 13: case 13:
Button13Enable = true; Button13Enable = status;
//SelfEnable = true; //SelfEnable = status;
break; break;
case 14: case 14:
Button14Enable = true; Button14Enable = status;
//SelfEnable = true; //SelfEnable = status;
break; break;
case 15: case 15:
Button15Enable = true; Button15Enable = status;
//SelfEnable = true; //SelfEnable = status;
break; break;
case 16: case 16:
Button16Enable = true; Button16Enable = status;
//SelfEnable = true; //SelfEnable = status;
break; break;
case 17: case 17:
Button17Enable = true; Button17Enable = status;
//SelfEnable = true; //SelfEnable = status;
break; break;
case 18: case 18:
Button18Enable = true; Button18Enable = status;
//SelfEnable = true; //SelfEnable = status;
break; break;
default: default:
break; break;
} }
} }
//打开某个药箱时不可点击其他药箱按钮避免保存数据时减错药箱库存(确认或取消后按钮即可用) ////打开某个药箱时不可点击其他药箱按钮避免保存数据时减错药箱库存(确认或取消后按钮即可用)
private void SetAllBtnEnableFalse() //private void SetAllBtnEnableFalse()
{ //{
Button1Enable = false; // Button1Enable = false;
Button2Enable = false; // Button2Enable = false;
Button3Enable = false; // Button3Enable = false;
Button4Enable = false; // Button4Enable = false;
Button5Enable = false; // Button5Enable = false;
Button6Enable = false; // Button6Enable = false;
Button7Enable = false; // Button7Enable = false;
Button8Enable = false; // Button8Enable = false;
Button9Enable = false; // Button9Enable = false;
Button10Enable = false; // Button10Enable = false;
Button11Enable = false; // Button11Enable = false;
Button12Enable = false; // Button12Enable = false;
Button13Enable = false; // Button13Enable = false;
Button14Enable = false; // Button14Enable = false;
Button15Enable = false; // Button15Enable = false;
Button16Enable = false; // Button16Enable = false;
Button17Enable = false; // Button17Enable = false;
Button18Enable = false; // Button18Enable = false;
} //}
IEventAggregator _eventAggregator; IEventAggregator _eventAggregator;
private PortUtil _portUtil; private PortUtil _portUtil;
@ -654,34 +657,34 @@ namespace DM_Weight.ViewModels
} }
else else
{ {
GetUseBox();
//List<ChannelList> chlList = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cl => cl.MachineId == "DM5").ToList();//.Select(cl => cl.BelongUser).First();
List<ChannelList> chlList = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cl => cl.MachineId == "DM5").ToList();//.Select(cl => cl.BelongUser).First(); //if (chlList != null && chlList.Count > 0)
//{
// for (int i = 0; i < chlList.Count; i++)
// {
// ChannelList chl = chlList[i];
// if (Convert.ToDateTime(chl.EffDate).ToString("yyyy-MM-dd") == DateTime.Now.ToString("yyyy-MM-dd"))
// {
// SetBtnColor(chl.DrawerNo);
// }
if (chlList != null && chlList.Count > 0) // //DrawerType== 1为公共药箱
{ // if (chl.DrawerType == 1)
for (int i = 0; i < chlList.Count; i++) // {
{ // SetBtnEnable(chl.DrawerNo);
ChannelList chl = chlList[i]; // }
if (Convert.ToDateTime(chl.EffDate).ToString("yyyy-MM-dd") == DateTime.Now.ToString("yyyy-MM-dd")) // if (!string.IsNullOrEmpty(chl.BelongUser) && chl.BelongUser == HomeWindowViewModel.Operator.UserBarcode)
{ // {
SetBtnColor(chl.DrawerNo); // if (DrawerType == -1)
} // {
// DrawerType = chl.DrawerType;
//DrawerType== 1为公共药箱 // }
if (chl.DrawerType == 1) // SetBtnEnable(chl.DrawerNo);
{ // }
SetBtnEnable(chl.DrawerNo); // }
} //}
if (!string.IsNullOrEmpty(chl.BelongUser) && chl.BelongUser == HomeWindowViewModel.Operator.UserBarcode)
{
if (DrawerType == -1)
{
DrawerType = chl.DrawerType;
}
SetBtnEnable(chl.DrawerNo);
}
}
}
//查询当前药师下所有的待确认的单子 //查询当前药师下所有的待确认的单子
string currentDrawerUser = HomeWindowViewModel.Operator.UserBarcode; string currentDrawerUser = HomeWindowViewModel.Operator.UserBarcode;
OrderInfoList = SqlSugarHelper.Db.Queryable<OrderInfo>() OrderInfoList = SqlSugarHelper.Db.Queryable<OrderInfo>()
@ -721,6 +724,7 @@ namespace DM_Weight.ViewModels
} }
public async void OpenBoxAction(string strDrawerNo) public async void OpenBoxAction(string strDrawerNo)
{ {
//SetAllBtnEnableFalse();
DrawerNo = Convert.ToInt32(strDrawerNo); DrawerNo = Convert.ToInt32(strDrawerNo);
//DrawerType = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cl => cl.MachineId == "DM5" && cl.DrawerNo == Convert.ToInt32(strDrawerNo)).Select(cl => cl.DrawerType).First(); //DrawerType = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cl => cl.MachineId == "DM5" && cl.DrawerNo == Convert.ToInt32(strDrawerNo)).Select(cl => cl.DrawerType).First();
//SelfEnable = true; //SelfEnable = true;
@ -750,6 +754,25 @@ namespace DM_Weight.ViewModels
//记录开药箱日志 //记录开药箱日志
SqlSugarHelper.Db.Insertable(machineRecord).ExecuteCommand(); SqlSugarHelper.Db.Insertable(machineRecord).ExecuteCommand();
ModbusHelper.GetInstance().OpenBoxDoor(DrawerNo); ModbusHelper.GetInstance().OpenBoxDoor(DrawerNo);
SetBtnEnable(DrawerNo + 1, false);
if (CheckBoxStatusTimer is null)
{
CheckBoxStatusTimer = new System.Timers.Timer();
}
if (!CheckBoxStatusTimer.Enabled)
{
CheckBoxStatusTimer.Elapsed += new System.Timers.ElapsedEventHandler(GetAllBoxState);
CheckBoxStatusTimer.Interval = 3000;
CheckBoxStatusTimer.Start();
}
//记录药箱打开时间
ChannelList channelList = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cl => cl.MachineId == "DM5" && cl.DrawerNo == DrawerNo + 1).First();
if (channelList != null && (channelList.EffDate is null || Convert.ToDateTime(channelList.EffDate).ToString("yyyy-MM-dd") != DateTime.Now.ToString("yyyy-MM-dd")))
{
channelList.EffDate = DateTime.Now.ToString();
SqlSugarHelper.Db.Updateable(channelList).UpdateColumns(it => new { it.EffDate }).ExecuteCommand();
}
} }
//if (DrawerType == 1) //公共药箱 //if (DrawerType == 1) //公共药箱
//{ //{
@ -866,15 +889,13 @@ namespace DM_Weight.ViewModels
{ {
get => new DelegateCommand(() => get => new DelegateCommand(() =>
{ {
CheckOrderAction(); GetUseBox();
}); });
} }
void CheckOrderAction() void CheckOrderAction()
{ {
SetBtnEnable(DrawerNo);
var confirmData = OrderInfoList.Where(oi => oi.ItemIsChecked == true).ToList(); var confirmData = OrderInfoList.Where(oi => oi.ItemIsChecked == true).ToList();
if (confirmData.Count > 0) if (confirmData.Count > 0)
{ {
@ -1095,6 +1116,7 @@ namespace DM_Weight.ViewModels
Type = MsgType.SUCCESS, Type = MsgType.SUCCESS,
}; };
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg); _eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
RequestData();
} }
if (!f.IsSuccess) if (!f.IsSuccess)
{ {
@ -1127,7 +1149,35 @@ namespace DM_Weight.ViewModels
RequestData(); RequestData();
}); });
} }
private void GetUseBox()
{
List<ChannelList> chlList = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cl => cl.MachineId == "DM5").ToList();//.Select(cl => cl.BelongUser).First();
if (chlList != null && chlList.Count > 0)
{
for (int i = 0; i < chlList.Count; i++)
{
ChannelList chl = chlList[i];
if (Convert.ToDateTime(chl.EffDate).ToString("yyyy-MM-dd") == DateTime.Now.ToString("yyyy-MM-dd"))
{
SetBtnColor(chl.DrawerNo);
}
//DrawerType== 1为公共药箱
if (chl.DrawerType == 1)
{
SetBtnEnable(chl.DrawerNo,true);
}
if (!string.IsNullOrEmpty(chl.BelongUser) && chl.BelongUser == HomeWindowViewModel.Operator.UserBarcode)
{
if (DrawerType == -1)
{
DrawerType = chl.DrawerType;
}
SetBtnEnable(chl.DrawerNo,true);
}
}
}
}
public void OnNavigatedTo(NavigationContext navigationContext) public void OnNavigatedTo(NavigationContext navigationContext)
{ {
RequestData(); RequestData();
@ -1135,6 +1185,7 @@ namespace DM_Weight.ViewModels
int drawerNo = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cl => cl.MachineId == "DM5" && cl.BelongUser == HomeWindowViewModel.Operator.UserBarcode).Select(cl => cl.DrawerNo).First(); int drawerNo = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cl => cl.MachineId == "DM5" && cl.BelongUser == HomeWindowViewModel.Operator.UserBarcode).Select(cl => cl.DrawerNo).First();
if (drawerNo > 0) if (drawerNo > 0)
{ {
//SetAllBtnEnableFalse();
DrawerNo = drawerNo; DrawerNo = drawerNo;
//进入页面打开当前用户的第一个药箱 //进入页面打开当前用户的第一个药箱
//记录开药箱日志 //记录开药箱日志
@ -1152,6 +1203,44 @@ namespace DM_Weight.ViewModels
_portUtil.SpeakAsync($"正在打开{drawerNo}号药箱"); _portUtil.SpeakAsync($"正在打开{drawerNo}号药箱");
logger.Info($"正在打开{drawerNo}号药箱"); logger.Info($"正在打开{drawerNo}号药箱");
ModbusHelper.GetInstance().OpenBoxDoor(drawerNo - 1); ModbusHelper.GetInstance().OpenBoxDoor(drawerNo - 1);
SetBtnEnable(drawerNo, false);
if (CheckBoxStatusTimer is null)
{
CheckBoxStatusTimer = new System.Timers.Timer();
}
if (!CheckBoxStatusTimer.Enabled)
{
CheckBoxStatusTimer.Elapsed += new System.Timers.ElapsedEventHandler(GetAllBoxState);
CheckBoxStatusTimer.Interval = 3000;
CheckBoxStatusTimer.Start();
}
//记录药箱打开时间
ChannelList channelList = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cl => cl.MachineId == "DM5" && cl.DrawerNo == drawerNo).First();
if (channelList != null && (channelList.EffDate is null || Convert.ToDateTime(channelList.EffDate).ToString("yyyy-MM-dd") != DateTime.Now.ToString("yyyy-MM-dd")))
{
channelList.EffDate = DateTime.Now.ToString();
SqlSugarHelper.Db.Updateable(channelList).UpdateColumns(it => new { it.EffDate }).ExecuteCommand();
}
}
}
private void GetAllBoxState(object sender, ElapsedEventArgs e)
{
//查询药箱是否关闭,如果已经关闭则按钮可用,可继续开该编号的药箱
if (DrawerNo >= 0)
{
bool[] boolArrs = ModbusHelper.GetInstance().GetAllBoxState();
bool allFalse = Array.TrueForAll(boolArrs, b => b == false);
if (allFalse)
{
if (CheckBoxStatusTimer.Enabled)
{
CheckBoxStatusTimer.Stop();
}
}
//设置对应药箱按钮可用状态
SetBtnEnable(DrawerNo, !boolArrs[DrawerNo]);
} }
} }

View File

@ -40,7 +40,7 @@
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource MaterialDesignPaperLightButton}"> <Style TargetType="{x:Type Button}" BasedOn="{StaticResource MaterialDesignPaperLightButton}">
<Setter Property="Foreground" Value="#00a0ea" /> <Setter Property="Foreground" Value="#00a0ea" />
<Setter Property="BorderBrush" Value="#00a0ea" /> <Setter Property="BorderBrush" Value="#00a0ea" />
<Style.Triggers> <!--<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True"> <Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#d1e7f5" /> <Setter Property="Background" Value="#d1e7f5" />
<Setter Property="BorderBrush" Value="#d1e7f5" /> <Setter Property="BorderBrush" Value="#d1e7f5" />
@ -55,7 +55,7 @@
<Setter Property="Background" Value="#d1e7f5" /> <Setter Property="Background" Value="#d1e7f5" />
<Setter Property="BorderBrush" Value="#d1e7f5" /> <Setter Property="BorderBrush" Value="#d1e7f5" />
</DataTrigger> </DataTrigger>
</Style.Triggers> </Style.Triggers>-->
</Style> </Style>
</Grid.Resources> </Grid.Resources>
<Grid.RowDefinitions> <Grid.RowDefinitions>
@ -74,26 +74,26 @@
<ColumnDefinition /> <ColumnDefinition />
<ColumnDefinition /> <ColumnDefinition />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Button Margin="0 0 3 0" Grid.Row="0" Grid.Column="0" Width="120" Content="1号药箱" Background="{Binding Button1Color}" Command="{Binding UpdateDrawerNo,ConverterParameter=1}" CommandParameter="1" IsEnabled="{Binding IsEnabled1}"/> <Button Margin="0 0 3 0" Grid.Row="0" Grid.Column="0" Width="120" Content="1号药箱" Background="{Binding Button1Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="0" IsEnabled="{Binding IsEnabled1}"/>
<Button Margin="0 0 3 0" Grid.Row="1" Grid.Column="0" Width="120" Content="2号药箱" Background="{Binding Button2Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="2" IsEnabled="{Binding IsEnabled2}"/> <Button Margin="0 0 3 0" Grid.Row="1" Grid.Column="0" Width="120" Content="2号药箱" Background="{Binding Button2Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="1" IsEnabled="{Binding IsEnabled2}"/>
<Button Margin="0 0 3 0" Grid.Row="2" Grid.Column="0" Width="120" Content="3号药箱" Background="{Binding Button3Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="3" IsEnabled="{Binding IsEnabled3}"/> <Button Margin="0 0 3 0" Grid.Row="2" Grid.Column="0" Width="120" Content="3号药箱" Background="{Binding Button3Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="2" IsEnabled="{Binding IsEnabled3}"/>
<Button Margin="0 0 3 0" Grid.Row="3" Grid.Column="0" Width="120" Content="4号药箱" Background="{Binding Button4Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="4" IsEnabled="{Binding IsEnabled4}"/> <Button Margin="0 0 3 0" Grid.Row="3" Grid.Column="0" Width="120" Content="4号药箱" Background="{Binding Button4Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="3" IsEnabled="{Binding IsEnabled4}"/>
<Button Margin="0 0 3 0" Grid.Row="4" Grid.Column="0" Width="120" Content="5号药箱" Background="{Binding Button5Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="5" IsEnabled="{Binding IsEnabled5}"/> <Button Margin="0 0 3 0" Grid.Row="4" Grid.Column="0" Width="120" Content="5号药箱" Background="{Binding Button5Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="4" IsEnabled="{Binding IsEnabled5}"/>
<Button Margin="0 0 3 0" Grid.Row="5" Grid.Column="0" Width="120" Content="6号药箱" Background="{Binding Button6Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="6" IsEnabled="{Binding IsEnabled6}"/> <Button Margin="0 0 3 0" Grid.Row="5" Grid.Column="0" Width="120" Content="6号药箱" Background="{Binding Button6Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="5" IsEnabled="{Binding IsEnabled6}"/>
<Button Margin="0 0 3 0" Grid.Row="6" Grid.Column="0" Width="120" Content="7号药箱" Background="{Binding Button7Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="7" IsEnabled="{Binding IsEnabled7}"/> <Button Margin="0 0 3 0" Grid.Row="6" Grid.Column="0" Width="120" Content="7号药箱" Background="{Binding Button7Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="6" IsEnabled="{Binding IsEnabled7}"/>
<Button Margin="0 0 3 0" Grid.Row="7" Grid.Column="0" Width="120" Content="8号药箱" Background="{Binding Button8Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="8" IsEnabled="{Binding IsEnabled8}"/> <Button Margin="0 0 3 0" Grid.Row="7" Grid.Column="0" Width="120" Content="8号药箱" Background="{Binding Button8Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="7" IsEnabled="{Binding IsEnabled8}"/>
<Button Margin="0 0 3 0" Grid.Row="8" Grid.Column="0" Width="120" Content="9号药箱" Background="{Binding Button9Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="9" IsEnabled="{Binding IsEnabled9}"/> <Button Margin="0 0 3 0" Grid.Row="8" Grid.Column="0" Width="120" Content="9号药箱" Background="{Binding Button9Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="8" IsEnabled="{Binding IsEnabled9}"/>
<Button Margin="0 0 3 0" Grid.Row="0" Grid.Column="1" Width="120" Content="10号药箱" Background="{Binding Button10Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="10" IsEnabled="{Binding IsEnabled10}"/> <Button Margin="0 0 3 0" Grid.Row="0" Grid.Column="1" Width="120" Content="10号药箱" Background="{Binding Button10Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="9" IsEnabled="{Binding IsEnabled10}"/>
<Button Grid.Row="1" Grid.Column="1" Width="120" Content="11号药箱" Background="{Binding Button11Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="11" IsEnabled="{Binding IsEnabled11}"/> <Button Grid.Row="1" Grid.Column="1" Width="120" Content="11号药箱" Background="{Binding Button11Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="10" IsEnabled="{Binding IsEnabled11}"/>
<Button Grid.Row="2" Grid.Column="1" Width="120" Content="12号药箱" Background="{Binding Button12Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="12" IsEnabled="{Binding IsEnabled12}"/> <Button Grid.Row="2" Grid.Column="1" Width="120" Content="12号药箱" Background="{Binding Button12Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="11" IsEnabled="{Binding IsEnabled12}"/>
<Button Grid.Row="3" Grid.Column="1" Width="120" Content="13号药箱" Background="{Binding Button13Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="13" IsEnabled="{Binding IsEnabled13}"/> <Button Grid.Row="3" Grid.Column="1" Width="120" Content="13号药箱" Background="{Binding Button13Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="12" IsEnabled="{Binding IsEnabled13}"/>
<Button Grid.Row="4" Grid.Column="1" Width="120" Content="14号药箱" Background="{Binding Button14Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="14" IsEnabled="{Binding IsEnabled14}"/> <Button Grid.Row="4" Grid.Column="1" Width="120" Content="14号药箱" Background="{Binding Button14Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="13" IsEnabled="{Binding IsEnabled14}"/>
<Button Grid.Row="5" Grid.Column="1" Width="120" Content="15号药箱" Background="{Binding Button15Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="15" IsEnabled="{Binding IsEnabled15}"/> <Button Grid.Row="5" Grid.Column="1" Width="120" Content="15号药箱" Background="{Binding Button15Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="14" IsEnabled="{Binding IsEnabled15}"/>
<Button Grid.Row="6" Grid.Column="1" Width="120" Content="16号药箱" Background="{Binding Button16Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="16" IsEnabled="{Binding IsEnabled16}"/> <Button Grid.Row="6" Grid.Column="1" Width="120" Content="16号药箱" Background="{Binding Button16Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="15" IsEnabled="{Binding IsEnabled16}"/>
<Button Grid.Row="7" Grid.Column="1" Width="120" Content="17号药箱" Background="{Binding Button17Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="17" IsEnabled="{Binding IsEnabled17}"/> <Button Grid.Row="7" Grid.Column="1" Width="120" Content="17号药箱" Background="{Binding Button17Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="16" IsEnabled="{Binding IsEnabled17}"/>
<Button Grid.Row="8" Grid.Column="1" Width="120" Content="18号药箱" Background="{Binding Button18Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="18" IsEnabled="{Binding IsEnabled18}"/> <Button Grid.Row="8" Grid.Column="1" Width="120" Content="18号药箱" Background="{Binding Button18Color}" Command="{Binding UpdateDrawerNo}" CommandParameter="17" IsEnabled="{Binding IsEnabled18}"/>
<!--<Button Grid.Row="8" Grid.Column="1" Width="120" Content="19号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="19" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=19}"/> <!--<Button Grid.Row="8" Grid.Column="1" Width="120" Content="19号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="19" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=19}"/>
<Button Grid.Row="9" Grid.Column="1" Width="120" Content="20号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="20" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=20}"/>--> <Button Grid.Row="9" Grid.Column="1" Width="120" Content="20号药箱" Command="{Binding UpdateDrawerNo}" CommandParameter="20" IsEnabled="{Binding DrawerNo, Converter={StaticResource BoxNumConverter}, ConverterParameter=20}"/>-->

View File

@ -40,7 +40,7 @@
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource MaterialDesignPaperLightButton}"> <Style TargetType="{x:Type Button}" BasedOn="{StaticResource MaterialDesignPaperLightButton}">
<Setter Property="Foreground" Value="#00a0ea" /> <Setter Property="Foreground" Value="#00a0ea" />
<Setter Property="BorderBrush" Value="#00a0ea" /> <Setter Property="BorderBrush" Value="#00a0ea" />
<Style.Triggers> <!--<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True"> <Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#d1e7f5" /> <Setter Property="Background" Value="#d1e7f5" />
<Setter Property="BorderBrush" Value="#d1e7f5" /> <Setter Property="BorderBrush" Value="#d1e7f5" />
@ -55,7 +55,7 @@
<Setter Property="Background" Value="#d1e7f5" /> <Setter Property="Background" Value="#d1e7f5" />
<Setter Property="BorderBrush" Value="#d1e7f5" /> <Setter Property="BorderBrush" Value="#d1e7f5" />
</DataTrigger> </DataTrigger>
</Style.Triggers> </Style.Triggers>-->
</Style> </Style>
</Grid.Resources> </Grid.Resources>
<Grid.RowDefinitions> <Grid.RowDefinitions>