多批次页面添加药品厂家信息

This commit is contained in:
maqiao 2024-11-05 11:21:04 +08:00
parent 65d425b66c
commit 9e07f293a0
2 changed files with 6 additions and 4 deletions

View File

@ -208,8 +208,10 @@ namespace DM_Weight.ViewModels
private void GetAllDrugInfos() private void GetAllDrugInfos()
{ {
var list = SqlSugarHelper.Db.Queryable<DrugInfo>().Includes<DrugManuNo>(di => di.DrugManuNos).OrderBy(di => di.DrugId).ToList(); //var list = SqlSugarHelper.Db.Queryable<DrugInfo>().Includes<DrugManuNo>(di => di.DrugManuNos).OrderBy(di => di.DrugId).ToList();
DrugInfos = list; //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<DrugInfo>(str).OrderBy(di => di.DrugName).OrderBy(di => di.DrugId).ToList();
//DrugInfos_PY = list; //DrugInfos_PY = list;
} }
@ -468,7 +470,7 @@ namespace DM_Weight.ViewModels
public void UpdateComboBoxItems(string text) public void UpdateComboBoxItems(string text)
{ {
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, 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)as drug_name_spec FROM `drug_info` d"; d.manufactory,d.max_stock,CONCAT(drug_name,' / ',drug_spec,' / ',manufactory) as drug_name_spec FROM `drug_info` d";
if (string.IsNullOrEmpty(text)) if (string.IsNullOrEmpty(text))
{ {
DrugInfos = SqlSugarHelper.Db.SqlQueryable<DrugInfo>(str).OrderBy(di => di.DrugName).OrderBy(di => di.DrugId).ToList(); DrugInfos = SqlSugarHelper.Db.SqlQueryable<DrugInfo>(str).OrderBy(di => di.DrugName).OrderBy(di => di.DrugId).ToList();

View File

@ -71,7 +71,7 @@
IsEditable="True" IsEditable="True"
ItemsSource="{Binding DrugInfos}" ItemsSource="{Binding DrugInfos}"
SelectedItem="{Binding DrugInfo}" SelectedItem="{Binding DrugInfo}"
DisplayMemberPath="DrugName" IsEnabled="True" IsTextSearchEnabled="False" KeyUp="ComboBox_KeyUp" DisplayMemberPath="drug_name_spec" IsEnabled="True" IsTextSearchEnabled="False" KeyUp="ComboBox_KeyUp"
/> />
<StackPanel HorizontalAlignment="Right" Grid.Column="3" Orientation="Horizontal"> <StackPanel HorizontalAlignment="Right" Grid.Column="3" Orientation="Horizontal">
<Button <Button