Compare commits

..

3 Commits

Author SHA1 Message Date
maqiao 21082a6e17 绑定药品页面选择药品添加批次与厂家信息
打开药箱方法添加bool返回值,成功发送指令则为true
修改home页子菜单跳转,由原来的绑定做跳转改为添加点击事件进行页面跳转
2024-11-05 08:48:56 +08:00
maqiao cf98e60aa8 打开药箱页面添加判断当前归属用户是否为空的判断
设置药箱页面保存成功弹出提示
2024-11-04 08:46:16 +08:00
maqiao c800334724 药箱设置页面添加如药箱类型是归属药师如无药师则添加请选择信息 2024-11-02 16:20:54 +08:00
3 changed files with 42 additions and 6 deletions

1
.gitignore vendored
View File

@ -361,3 +361,4 @@ MigrationBackup/
# Fody - auto-generated XML schema
FodyWeavers.xsd
/win-x64 (2024-11-4_6湘乡交接柜).zip

View File

@ -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);
}

View File

@ -159,9 +159,21 @@ namespace DM_Weight.ViewModels
//药箱归属药师,把药师信息显示出来
UserStatus = Visibility.Visible;
UserListSelectedItem = _userLists.Where(sul => sul.UserId.ToString() == cnl.BelongUser).FirstOrDefault();
if (UserListSelectedItem == null && _userLists != null)
if (UserListSelectedItem == null)
{
UserListSelectedItem = _userLists[0];
if (UserLists.Where(us => us.UserName == "请选择药师").Count() <= 0)
{
BindUserList nullBind = new BindUserList();
nullBind.UserId = 0;
nullBind.UserName = "请选择药师";
_userLists.Add(nullBind);
}
UserListSelectedItem = UserLists.Where(us => us.UserName == "请选择药师").FirstOrDefault();
}
else
{
UserListSelectedItem = UserLists[0];
}
}
else
@ -212,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