92 lines
		
	
	
		
			2.9 KiB
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			92 lines
		
	
	
		
			2.9 KiB
		
	
	
	
		
			C#
		
	
	
	
| 
								 | 
							
								using DM_Weight.Models;
							 | 
						|||
| 
								 | 
							
								using DM_Weight.util;
							 | 
						|||
| 
								 | 
							
								using System;
							 | 
						|||
| 
								 | 
							
								using System.Collections.Generic;
							 | 
						|||
| 
								 | 
							
								using System.Collections.ObjectModel;
							 | 
						|||
| 
								 | 
							
								using System.Configuration;
							 | 
						|||
| 
								 | 
							
								using System.Globalization;
							 | 
						|||
| 
								 | 
							
								using System.Linq;
							 | 
						|||
| 
								 | 
							
								using System.Text;
							 | 
						|||
| 
								 | 
							
								using System.Threading.Tasks;
							 | 
						|||
| 
								 | 
							
								using System.Windows.Data;
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								namespace DM_Weight.Converter
							 | 
						|||
| 
								 | 
							
								{
							 | 
						|||
| 
								 | 
							
								    /// <summary>
							 | 
						|||
| 
								 | 
							
								    /// 请领列表页面状态转换
							 | 
						|||
| 
								 | 
							
								    /// </summary>
							 | 
						|||
| 
								 | 
							
								    public class ApplyListConverter : IValueConverter
							 | 
						|||
| 
								 | 
							
								    {
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            //用户名
							 | 
						|||
| 
								 | 
							
								            if (parameter.ToString().Equals("UserId"))
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                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;
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								            //请领单状态
							 | 
						|||
| 
								 | 
							
								            if (parameter.ToString().Equals("PleaseStatus"))
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                int val = int.Parse(value.ToString());
							 | 
						|||
| 
								 | 
							
								                string retStr = "状态:";
							 | 
						|||
| 
								 | 
							
								                switch (val)
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    case 0:
							 | 
						|||
| 
								 | 
							
								                        return retStr + "已创建";
							 | 
						|||
| 
								 | 
							
								                    case 1:
							 | 
						|||
| 
								 | 
							
								                        return retStr + "审核通过";
							 | 
						|||
| 
								 | 
							
								                    case 2:
							 | 
						|||
| 
								 | 
							
								                        return retStr + "已出库";
							 | 
						|||
| 
								 | 
							
								                    case 3:
							 | 
						|||
| 
								 | 
							
								                        return retStr + "已入库";
							 | 
						|||
| 
								 | 
							
								                    default:
							 | 
						|||
| 
								 | 
							
								                        return retStr + "状态未知";
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								            //处方状态
							 | 
						|||
| 
								 | 
							
								            if (parameter.ToString().Equals("OrderStatus"))
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                int val = int.Parse(value.ToString());
							 | 
						|||
| 
								 | 
							
								                switch (val)
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    case 0:
							 | 
						|||
| 
								 | 
							
								                        return "已申请";
							 | 
						|||
| 
								 | 
							
								                    case 1:
							 | 
						|||
| 
								 | 
							
								                        return "已接收";
							 | 
						|||
| 
								 | 
							
								                    case 2:
							 | 
						|||
| 
								 | 
							
								                        return "已退回";
							 | 
						|||
| 
								 | 
							
								                    default:
							 | 
						|||
| 
								 | 
							
								                        return "状态未知";
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								            //请领药库
							 | 
						|||
| 
								 | 
							
								            if (parameter.ToString().Equals("machineId"))
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                string val = value.ToString();
							 | 
						|||
| 
								 | 
							
								                string[] colloctedId = ConfigurationManager.AppSettings["colloctedId"].Split(',');
							 | 
						|||
| 
								 | 
							
								                if (Array.IndexOf(colloctedId, val)>0)
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    return colloctedId[Array.IndexOf(colloctedId, val) - 1].ToString();
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								                else
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    return "未知";
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								            return "";
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            throw new NotImplementedException();
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								    }
							 | 
						|||
| 
								 | 
							
								}
							 |