From 289a26f3415c40a3153d934b553b763d1c78854d Mon Sep 17 00:00:00 2001 From: maqiao <625215135@qq.com> Date: Sat, 2 Nov 2024 15:32:50 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=91=E5=AE=9A=E5=BA=93=E4=BD=8D=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E4=B8=AD=E8=8D=AF=E5=93=81=E4=B8=8B=E6=8B=89=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=89=B9=E5=8F=B7=E5=8F=8A=E5=8E=82=E5=AE=B6=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DM_Weight/Models/DrugInfo.cs | 2 ++ DM_Weight/ViewModels/BindingChannelDialogViewModel.cs | 7 +++++-- DM_Weight/Views/Dialog/BindingChannelDialog.xaml | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/DM_Weight/Models/DrugInfo.cs b/DM_Weight/Models/DrugInfo.cs index 948246c..ef9e55d 100644 --- a/DM_Weight/Models/DrugInfo.cs +++ b/DM_Weight/Models/DrugInfo.cs @@ -97,6 +97,8 @@ namespace DM_Weight.Models set { SetProperty(ref _base, value); } } + [SugarColumn(IsIgnore = true)] + public string drug_name_spec { get; set; } } diff --git a/DM_Weight/ViewModels/BindingChannelDialogViewModel.cs b/DM_Weight/ViewModels/BindingChannelDialogViewModel.cs index 6f06729..83dbe8b 100644 --- a/DM_Weight/ViewModels/BindingChannelDialogViewModel.cs +++ b/DM_Weight/ViewModels/BindingChannelDialogViewModel.cs @@ -165,8 +165,11 @@ namespace DM_Weight.ViewModels private void GetAllDrugInfos() { - var list = SqlSugarHelper.Db.Queryable().Includes(di => di.DrugManuNos).OrderBy(di => di.DrugId).ToList(); - DrugInfos = list; + //var list = SqlSugarHelper.Db.Queryable().Includes(di => di.DrugManuNos).OrderBy(di => di.DrugId).ToList(); + //DrugInfos = list; + string str = "SELECT d.drug_id,d.py_code,d.drug_barcode,d.drug_name,d.drug_brand_name,d.drug_spec,d.dosage,d.pack_unit,d.manufactory,d.max_stock,CONCAT(drug_name,' / ',drug_spec,' / ',manufactory) as drug_name_spec FROM `drug_info` d"; + DrugInfos = SqlSugarHelper.Db.SqlQueryable(str).OrderBy(di => di.DrugName).OrderBy(di => di.DrugId).ToList(); + } private void GetChannelsByDrawerNo() diff --git a/DM_Weight/Views/Dialog/BindingChannelDialog.xaml b/DM_Weight/Views/Dialog/BindingChannelDialog.xaml index a383533..53857ac 100644 --- a/DM_Weight/Views/Dialog/BindingChannelDialog.xaml +++ b/DM_Weight/Views/Dialog/BindingChannelDialog.xaml @@ -52,7 +52,7 @@ IsEditable="True" ItemsSource="{Binding DrugInfos}" SelectedItem="{Binding DrugInfo}" - DisplayMemberPath="DrugName" IsEnabled="True" IsTextSearchEnabled="False" KeyUp="ComboBox_KeyUp" + DisplayMemberPath="drug_name_spec" IsEnabled="True" IsTextSearchEnabled="False" KeyUp="ComboBox_KeyUp" />