添加权限:2、管理员能开所有抽屉,留1-2层所有人能开,其他6层管理员才能开
This commit is contained in:
parent
7bb4fb8fcc
commit
fa7f9cc2ea
|
@ -256,6 +256,22 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
if (Status == 0)
|
if (Status == 0)
|
||||||
{
|
{
|
||||||
|
if (HomeWindowViewModel.Operator.Role != null && HomeWindowViewModel.Operator.Role.RoleName != "管理员")
|
||||||
|
{
|
||||||
|
//查看当前用户是否有所在药品抽屉的权限;1-2层所有人能开,其他6层管理员才能开
|
||||||
|
bool bDrawer = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 2).Any();
|
||||||
|
if (bDrawer)
|
||||||
|
{
|
||||||
|
AlertMsg alertMsg = new AlertMsg
|
||||||
|
{
|
||||||
|
Message = "当前用户没有打开抽屉的权限!",
|
||||||
|
Type = MsgType.ERROR,
|
||||||
|
};
|
||||||
|
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
enumerable = ChannelStocks.GroupBy(cs => cs.DrawerNo, cs => cs);
|
enumerable = ChannelStocks.GroupBy(cs => cs.DrawerNo, cs => cs);
|
||||||
enumerator = enumerable.GetEnumerator();
|
enumerator = enumerable.GetEnumerator();
|
||||||
enumerator.MoveNext();
|
enumerator.MoveNext();
|
||||||
|
|
|
@ -508,6 +508,22 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
if (Status == 0)
|
if (Status == 0)
|
||||||
{
|
{
|
||||||
|
if (HomeWindowViewModel.Operator.Role != null && HomeWindowViewModel.Operator.Role.RoleName != "管理员")
|
||||||
|
{
|
||||||
|
//查看当前用户是否有所在药品抽屉的权限;1-2层所有人能开,其他6层管理员才能开
|
||||||
|
bool bDrawer = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 2).Any();
|
||||||
|
if (bDrawer)
|
||||||
|
{
|
||||||
|
AlertMsg alertMsg = new AlertMsg
|
||||||
|
{
|
||||||
|
Message = "当前用户没有打开抽屉的权限!",
|
||||||
|
Type = MsgType.ERROR,
|
||||||
|
};
|
||||||
|
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
if (AddChannels == null || AddChannels.Count <= 0)
|
if (AddChannels == null || AddChannels.Count <= 0)
|
||||||
{
|
{
|
||||||
AlertMsg alertMsg = new AlertMsg
|
AlertMsg alertMsg = new AlertMsg
|
||||||
|
|
|
@ -111,6 +111,21 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
get => new DelegateCommand<string>((DrawerNo) =>
|
get => new DelegateCommand<string>((DrawerNo) =>
|
||||||
{
|
{
|
||||||
|
if (HomeWindowViewModel.Operator.Role != null && HomeWindowViewModel.Operator.Role.RoleName != "管理员")
|
||||||
|
{
|
||||||
|
//查看当前用户是否有所在药品抽屉的权限;1-2层所有人能开,其他6层管理员才能开
|
||||||
|
if (Convert.ToInt32(DrawerNo) > 2)
|
||||||
|
{
|
||||||
|
AlertMsg alertMsg = new AlertMsg
|
||||||
|
{
|
||||||
|
Message = "当前用户没有打开抽屉的权限!",
|
||||||
|
Type = MsgType.ERROR,
|
||||||
|
};
|
||||||
|
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
this.DrawerNo = Convert.ToInt32(DrawerNo);
|
this.DrawerNo = Convert.ToInt32(DrawerNo);
|
||||||
RequestData();
|
RequestData();
|
||||||
}, (DrawerNo) => Status == 0
|
}, (DrawerNo) => Status == 0
|
||||||
|
|
|
@ -199,6 +199,21 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
if (Status == 0)
|
if (Status == 0)
|
||||||
{
|
{
|
||||||
|
if (HomeWindowViewModel.Operator.Role != null && HomeWindowViewModel.Operator.Role.RoleName != "管理员")
|
||||||
|
{
|
||||||
|
//查看当前用户是否有所在药品抽屉的权限;1-2层所有人能开,其他6层管理员才能开
|
||||||
|
if (_ChannelStock.DrawerNo>2)
|
||||||
|
{
|
||||||
|
AlertMsg alertMsg = new AlertMsg
|
||||||
|
{
|
||||||
|
Message = "当前用户没有打开抽屉的权限!",
|
||||||
|
Type = MsgType.ERROR,
|
||||||
|
};
|
||||||
|
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Status = 1;
|
Status = 1;
|
||||||
//_portUtil.SpeakAsync("正在打开" + DrawerNo + "号抽屉");
|
//_portUtil.SpeakAsync("正在打开" + DrawerNo + "号抽屉");
|
||||||
|
|
||||||
|
|
|
@ -125,6 +125,21 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
get => new DelegateCommand(() =>
|
get => new DelegateCommand(() =>
|
||||||
{
|
{
|
||||||
|
if (HomeWindowViewModel.Operator.Role != null && HomeWindowViewModel.Operator.Role.RoleName != "管理员")
|
||||||
|
{
|
||||||
|
//查看当前用户是否有所在药品抽屉的权限;1-2层所有人能开,其他6层管理员才能开
|
||||||
|
if (DrawerNo>2)
|
||||||
|
{
|
||||||
|
AlertMsg alertMsg = new AlertMsg
|
||||||
|
{
|
||||||
|
Message = "当前用户没有打开抽屉的权限!",
|
||||||
|
Type = MsgType.ERROR,
|
||||||
|
};
|
||||||
|
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Status = 1;
|
Status = 1;
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|
|
@ -135,6 +135,21 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
if (Status == 0)
|
if (Status == 0)
|
||||||
{
|
{
|
||||||
|
if (HomeWindowViewModel.Operator.Role != null && HomeWindowViewModel.Operator.Role.RoleName != "管理员")
|
||||||
|
{
|
||||||
|
//查看当前用户是否有所在药品抽屉的权限;1-2层所有人能开,其他6层管理员才能开
|
||||||
|
if (DrawerNo>2)
|
||||||
|
{
|
||||||
|
AlertMsg alertMsg = new AlertMsg
|
||||||
|
{
|
||||||
|
Message = "当前用户没有打开抽屉的权限!",
|
||||||
|
Type = MsgType.ERROR,
|
||||||
|
};
|
||||||
|
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Status = 1;
|
Status = 1;
|
||||||
//_portUtil.SpeakAsync("正在打开" + DrawerNo + "号抽屉");
|
//_portUtil.SpeakAsync("正在打开" + DrawerNo + "号抽屉");
|
||||||
|
|
||||||
|
|
|
@ -175,6 +175,22 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
if (Status == 0)
|
if (Status == 0)
|
||||||
{
|
{
|
||||||
|
if (HomeWindowViewModel.Operator.Role != null && HomeWindowViewModel.Operator.Role.RoleName != "管理员")
|
||||||
|
{
|
||||||
|
//查看当前用户是否有所在药品抽屉的权限;1-2层所有人能开,其他6层管理员才能开
|
||||||
|
bool bDrawer = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 2).Any();
|
||||||
|
if (bDrawer)
|
||||||
|
{
|
||||||
|
AlertMsg alertMsg = new AlertMsg
|
||||||
|
{
|
||||||
|
Message = "当前用户没有打开抽屉的权限!",
|
||||||
|
Type = MsgType.ERROR,
|
||||||
|
};
|
||||||
|
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
enumerator.MoveNext();
|
enumerator.MoveNext();
|
||||||
Status = 1;
|
Status = 1;
|
||||||
OpenOneByOne();
|
OpenOneByOne();
|
||||||
|
|
|
@ -250,6 +250,22 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
if (Status == 0)
|
if (Status == 0)
|
||||||
{
|
{
|
||||||
|
if (HomeWindowViewModel.Operator.Role != null && HomeWindowViewModel.Operator.Role.RoleName != "管理员")
|
||||||
|
{
|
||||||
|
//查看当前用户是否有所在药品抽屉的权限;1-2层所有人能开,其他6层管理员才能开
|
||||||
|
bool bDrawer = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 2).Any();
|
||||||
|
if (bDrawer)
|
||||||
|
{
|
||||||
|
AlertMsg alertMsg = new AlertMsg
|
||||||
|
{
|
||||||
|
Message = "当前用户没有打开抽屉的权限!",
|
||||||
|
Type = MsgType.ERROR,
|
||||||
|
};
|
||||||
|
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
enumerable = ChannelStocks.GroupBy(cs => cs.DrawerNo, cs => cs);
|
enumerable = ChannelStocks.GroupBy(cs => cs.DrawerNo, cs => cs);
|
||||||
enumerator = enumerable.GetEnumerator();
|
enumerator = enumerable.GetEnumerator();
|
||||||
enumerator.MoveNext();
|
enumerator.MoveNext();
|
||||||
|
|
|
@ -245,6 +245,22 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
if (Status == 0)
|
if (Status == 0)
|
||||||
{
|
{
|
||||||
|
if (HomeWindowViewModel.Operator.Role != null && HomeWindowViewModel.Operator.Role.RoleName != "管理员")
|
||||||
|
{
|
||||||
|
//查看当前用户是否有所在药品抽屉的权限;1-2层所有人能开,其他6层管理员才能开
|
||||||
|
bool bDrawer = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 2).Any();
|
||||||
|
if (bDrawer)
|
||||||
|
{
|
||||||
|
AlertMsg alertMsg = new AlertMsg
|
||||||
|
{
|
||||||
|
Message = "当前用户没有打开抽屉的权限!",
|
||||||
|
Type = MsgType.ERROR,
|
||||||
|
};
|
||||||
|
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
enumerable = ChannelStocks.GroupBy(cs => cs.DrawerNo, cs => cs);
|
enumerable = ChannelStocks.GroupBy(cs => cs.DrawerNo, cs => cs);
|
||||||
enumerator = enumerable.GetEnumerator();
|
enumerator = enumerable.GetEnumerator();
|
||||||
enumerator.MoveNext();
|
enumerator.MoveNext();
|
||||||
|
|
|
@ -247,6 +247,24 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
if (Status == 0)
|
if (Status == 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (HomeWindowViewModel.Operator.Role != null && HomeWindowViewModel.Operator.Role.RoleName != "管理员")
|
||||||
|
{
|
||||||
|
//查看当前用户是否有所在药品抽屉的权限;1-2层所有人能开,其他6层管理员才能开
|
||||||
|
bool bDrawer = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 2).Any();
|
||||||
|
if (bDrawer)
|
||||||
|
{
|
||||||
|
AlertMsg alertMsg = new AlertMsg
|
||||||
|
{
|
||||||
|
Message = "当前用户没有打开抽屉的权限!",
|
||||||
|
Type = MsgType.ERROR,
|
||||||
|
};
|
||||||
|
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
enumerable = ChannelStocks.GroupBy(cs => cs.DrawerNo, cs => cs);
|
enumerable = ChannelStocks.GroupBy(cs => cs.DrawerNo, cs => cs);
|
||||||
enumerator = enumerable.GetEnumerator();
|
enumerator = enumerable.GetEnumerator();
|
||||||
enumerator.MoveNext();
|
enumerator.MoveNext();
|
||||||
|
|
|
@ -191,6 +191,22 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
get => new DelegateCommand(() =>
|
get => new DelegateCommand(() =>
|
||||||
{
|
{
|
||||||
|
if (HomeWindowViewModel.Operator.Role != null && HomeWindowViewModel.Operator.Role.RoleName != "管理员")
|
||||||
|
{
|
||||||
|
//查看当前用户是否有所在药品抽屉的权限;1-2层所有人能开,其他6层管理员才能开
|
||||||
|
bool bDrawer = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 2).Any();
|
||||||
|
if (bDrawer)
|
||||||
|
{
|
||||||
|
AlertMsg alertMsg = new AlertMsg
|
||||||
|
{
|
||||||
|
Message = "当前用户没有打开抽屉的权限!",
|
||||||
|
Type = MsgType.ERROR,
|
||||||
|
};
|
||||||
|
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
if (ChannelStock != null)
|
if (ChannelStock != null)
|
||||||
{
|
{
|
||||||
Status = 1;
|
Status = 1;
|
||||||
|
|
|
@ -211,6 +211,21 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
get => new DelegateCommand(() =>
|
get => new DelegateCommand(() =>
|
||||||
{
|
{
|
||||||
|
if (HomeWindowViewModel.Operator.Role != null && HomeWindowViewModel.Operator.Role.RoleName != "管理员")
|
||||||
|
{
|
||||||
|
//查看当前用户是否有所在药品抽屉的权限;1-2层所有人能开,其他6层管理员才能开
|
||||||
|
if (ChannelStock.DrawerNo>2)
|
||||||
|
{
|
||||||
|
AlertMsg alertMsg = new AlertMsg
|
||||||
|
{
|
||||||
|
Message = "当前用户没有打开抽屉的权限!",
|
||||||
|
Type = MsgType.ERROR,
|
||||||
|
};
|
||||||
|
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
if (ChannelStock != null)
|
if (ChannelStock != null)
|
||||||
{
|
{
|
||||||
if (Status == 0)
|
if (Status == 0)
|
||||||
|
|
|
@ -169,6 +169,22 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
if (Status == 0)
|
if (Status == 0)
|
||||||
{
|
{
|
||||||
|
if (HomeWindowViewModel.Operator.Role != null && HomeWindowViewModel.Operator.Role.RoleName != "管理员")
|
||||||
|
{
|
||||||
|
//查看当前用户是否有所在药品抽屉的权限;1-2层所有人能开,其他6层管理员才能开
|
||||||
|
bool bDrawer = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 2).Any();
|
||||||
|
if (bDrawer)
|
||||||
|
{
|
||||||
|
AlertMsg alertMsg = new AlertMsg
|
||||||
|
{
|
||||||
|
Message = "当前用户没有打开抽屉的权限!",
|
||||||
|
Type = MsgType.ERROR,
|
||||||
|
};
|
||||||
|
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
enumerator.MoveNext();
|
enumerator.MoveNext();
|
||||||
Status = 1;
|
Status = 1;
|
||||||
OpenOneByOne();
|
OpenOneByOne();
|
||||||
|
|
|
@ -165,6 +165,22 @@ namespace DM_Weight.ViewModels
|
||||||
{
|
{
|
||||||
if (Status == 0)
|
if (Status == 0)
|
||||||
{
|
{
|
||||||
|
if (HomeWindowViewModel.Operator.Role != null && HomeWindowViewModel.Operator.Role.RoleName != "管理员")
|
||||||
|
{
|
||||||
|
//查看当前用户是否有所在药品抽屉的权限;1-2层所有人能开,其他6层管理员才能开
|
||||||
|
bool bDrawer = ChannelStocks.Select(it => it.DrawerNo).Where(n => n > 2).Any();
|
||||||
|
if (bDrawer)
|
||||||
|
{
|
||||||
|
AlertMsg alertMsg = new AlertMsg
|
||||||
|
{
|
||||||
|
Message = "当前用户没有打开抽屉的权限!",
|
||||||
|
Type = MsgType.ERROR,
|
||||||
|
};
|
||||||
|
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
enumerator.MoveNext();
|
enumerator.MoveNext();
|
||||||
Status = 1;
|
Status = 1;
|
||||||
OpenOneByOne();
|
OpenOneByOne();
|
||||||
|
|
|
@ -148,6 +148,7 @@
|
||||||
</DataGrid.GroupStyle>
|
</DataGrid.GroupStyle>
|
||||||
<DataGrid.Columns>
|
<DataGrid.Columns>
|
||||||
<DataGridTextColumn IsReadOnly="True" Header="药品名称" Binding="{Binding DrugInfo.DrugName}"/>
|
<DataGridTextColumn IsReadOnly="True" Header="药品名称" Binding="{Binding DrugInfo.DrugName}"/>
|
||||||
|
<DataGridTextColumn IsReadOnly="True" Header="药品基数" Binding="{Binding BaseQuantity}"/>
|
||||||
<DataGridTextColumn IsReadOnly="True" Header="需补药数量" Binding="{Binding AddQuantity}"/>
|
<DataGridTextColumn IsReadOnly="True" Header="需补药数量" Binding="{Binding AddQuantity}"/>
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
</DataGrid>
|
</DataGrid>
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
/>
|
/>
|
||||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Column="3">
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Column="3">
|
||||||
<Button
|
<Button
|
||||||
Margin="0 0 3 0"
|
Margin="0 0 3 0" Visibility="Collapsed"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Command="{Binding ReturnEmptyCommand}"
|
Command="{Binding ReturnEmptyCommand}"
|
||||||
Style="{StaticResource MaterialDesignOutlinedLightButton}"
|
Style="{StaticResource MaterialDesignOutlinedLightButton}"
|
||||||
|
|
Loading…
Reference in New Issue