32 lines
		
	
	
		
			922 B
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			32 lines
		
	
	
		
			922 B
		
	
	
	
		
			C#
		
	
	
	
| 
								 | 
							
								using DM_Weight.Models;
							 | 
						|||
| 
								 | 
							
								using DM_Weight.util;
							 | 
						|||
| 
								 | 
							
								using System;
							 | 
						|||
| 
								 | 
							
								using System.Collections.Generic;
							 | 
						|||
| 
								 | 
							
								using System.Globalization;
							 | 
						|||
| 
								 | 
							
								using System.Linq;
							 | 
						|||
| 
								 | 
							
								using System.Text;
							 | 
						|||
| 
								 | 
							
								using System.Threading.Tasks;
							 | 
						|||
| 
								 | 
							
								using System.Windows.Data;
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								namespace DM_Weight.Converter
							 | 
						|||
| 
								 | 
							
								{
							 | 
						|||
| 
								 | 
							
								    public class AddUnitConverter : IValueConverter
							 | 
						|||
| 
								 | 
							
								    {
							 | 
						|||
| 
								 | 
							
								        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            int val = int.Parse(value.ToString());
							 | 
						|||
| 
								 | 
							
								            if (val <= 0)
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                return "";
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								            string userName = SqlSugarHelper.Db.Queryable<UserList>().Where(ul => ul.Id == val).Select(ul => new { ul.Nickname }).First().Nickname;
							 | 
						|||
| 
								 | 
							
								            return userName;
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            throw new NotImplementedException();
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								    }
							 | 
						|||
| 
								 | 
							
								}
							 |