parent
c800334724
commit
cf98e60aa8
|
@ -436,7 +436,7 @@ namespace DM_Weight.ViewModels
|
|||
{
|
||||
SetBtnEnable(chl.DrawerNo);
|
||||
}
|
||||
if (chl.BelongUser == HomeWindowViewModel.Operator.UserBarcode)
|
||||
if (!string.IsNullOrEmpty(chl.BelongUser)&& chl.BelongUser == HomeWindowViewModel.Operator.UserBarcode)
|
||||
{
|
||||
SetBtnEnable(chl.DrawerNo);
|
||||
}
|
||||
|
|
|
@ -224,18 +224,41 @@ namespace DM_Weight.ViewModels
|
|||
ChannelList channelList = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cs => cs.DrawerNo == DrawerNo && cs.MachineId == "DM5").First();
|
||||
if (BoxTypeSelectedItem != null)
|
||||
{
|
||||
int iUpdate = 0;
|
||||
if (BoxTypeSelectedItem.TypeValue == 0 && UserListSelectedItem != null)
|
||||
{
|
||||
//药箱 归属药师
|
||||
|
||||
SqlSugarHelper.Db.Updateable(new ChannelList() { BelongUser = UserListSelectedItem.UserId.ToString(), DrawerType = BoxTypeSelectedItem.TypeValue, Id = channelList.Id }).UpdateColumns(cl => new { cl.BelongUser, cl.DrawerType }).ExecuteCommand();
|
||||
iUpdate=SqlSugarHelper.Db.Updateable(new ChannelList() { BelongUser = UserListSelectedItem.UserId.ToString(), DrawerType = BoxTypeSelectedItem.TypeValue, Id = channelList.Id }).UpdateColumns(cl => new { cl.BelongUser, cl.DrawerType }).ExecuteCommand();
|
||||
}
|
||||
else
|
||||
{
|
||||
//药箱属于公共药箱
|
||||
SqlSugarHelper.Db.Updateable(new ChannelList() { DrawerType = BoxTypeSelectedItem.TypeValue, Id = channelList.Id }).UpdateColumns(cl => new { cl.DrawerType }).ExecuteCommand();
|
||||
iUpdate=SqlSugarHelper.Db.Updateable(new ChannelList() { DrawerType = BoxTypeSelectedItem.TypeValue, Id = channelList.Id }).UpdateColumns(cl => new { cl.DrawerType }).ExecuteCommand();
|
||||
|
||||
}
|
||||
if(iUpdate>0)
|
||||
{
|
||||
//提示请选择药箱
|
||||
AlertMsg alertMsg = new AlertMsg
|
||||
{
|
||||
Message = $"保存完成",
|
||||
Type = MsgType.INFO
|
||||
};
|
||||
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
//提示请选择药箱
|
||||
AlertMsg alertMsg = new AlertMsg
|
||||
{
|
||||
Message = $"保存失败",
|
||||
Type = MsgType.ERROR
|
||||
};
|
||||
_eventAggregator.GetEvent<SnackbarEvent>().Publish(alertMsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue