Compare commits
	
		
			3 Commits
		
	
	
		
			9b36ba3feb
			...
			21082a6e17
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
							
							
								
								 | 
						21082a6e17 | 
							 | 
					|
| 
							
							
								
								 | 
						cf98e60aa8 | 
							 | 
					|
| 
							
							
								
								 | 
						c800334724 | 
							 | 
					
| 
						 | 
					@ -361,3 +361,4 @@ MigrationBackup/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Fody - auto-generated XML schema
 | 
					# Fody - auto-generated XML schema
 | 
				
			||||||
FodyWeavers.xsd
 | 
					FodyWeavers.xsd
 | 
				
			||||||
 | 
					/win-x64 (2024-11-4_6湘乡交接柜).zip
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -436,7 +436,7 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        SetBtnEnable(chl.DrawerNo);
 | 
					                        SetBtnEnable(chl.DrawerNo);
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    if (chl.BelongUser == HomeWindowViewModel.Operator.UserBarcode)
 | 
					                    if (!string.IsNullOrEmpty(chl.BelongUser)&& chl.BelongUser == HomeWindowViewModel.Operator.UserBarcode)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        SetBtnEnable(chl.DrawerNo);
 | 
					                        SetBtnEnable(chl.DrawerNo);
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -159,9 +159,21 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
                            //药箱归属药师,把药师信息显示出来
 | 
					                            //药箱归属药师,把药师信息显示出来
 | 
				
			||||||
                            UserStatus = Visibility.Visible;
 | 
					                            UserStatus = Visibility.Visible;
 | 
				
			||||||
                            UserListSelectedItem = _userLists.Where(sul => sul.UserId.ToString() == cnl.BelongUser).FirstOrDefault();
 | 
					                            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
 | 
					                        else
 | 
				
			||||||
| 
						 | 
					@ -212,18 +224,41 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
                    ChannelList channelList = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cs => cs.DrawerNo == DrawerNo && cs.MachineId == "DM5").First();
 | 
					                    ChannelList channelList = SqlSugarHelper.Db.Queryable<ChannelList>().Where(cs => cs.DrawerNo == DrawerNo && cs.MachineId == "DM5").First();
 | 
				
			||||||
                    if (BoxTypeSelectedItem != null)
 | 
					                    if (BoxTypeSelectedItem != null)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
 | 
					                        int iUpdate = 0;
 | 
				
			||||||
                        if (BoxTypeSelectedItem.TypeValue == 0 && UserListSelectedItem != null)
 | 
					                        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
 | 
					                        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
 | 
					                else
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue