diff --git a/PEIS/Presenter/EnrollmentPersonPresenter.cs b/PEIS/Presenter/EnrollmentPersonPresenter.cs index bdc2be5..b4f2101 100644 --- a/PEIS/Presenter/EnrollmentPersonPresenter.cs +++ b/PEIS/Presenter/EnrollmentPersonPresenter.cs @@ -58,7 +58,6 @@ namespace PEIS.Presenter View.ShowCancelRegInfo(new EnrollmentPatientModel().CancelRegInfo(args.ID)); }; View.DeleteOrder += (send, args) => - { View.ShowDeleteOrder(new EnrollmentPatientModel().DeleteOrder(args.ID)); }; diff --git a/PEIS/View/Base/PersonForm.cs b/PEIS/View/Base/PersonForm.cs index 948de71..0d7040a 100644 --- a/PEIS/View/Base/PersonForm.cs +++ b/PEIS/View/Base/PersonForm.cs @@ -1,12 +1,12 @@ - using PEIS.Base; +using PEIS.Base; using PEIS.Entity; using PEIS.Event; using PEIS.Presenter; +using PEIS.Utils; using System; using System.Collections.Generic; - using System.Linq; - using System.Threading; -using PEIS.Utils; +using System.Threading; +using System.Windows.Forms; namespace PEIS.View.Base { @@ -29,11 +29,16 @@ namespace PEIS.View.Base OpsPatient.TsmiDelete.Visible = false; OpsPatient.TsmiSave.Visible = false; OpsPatient.TsmiSearch.Visible = false; - OpsPatient.TstbKey.TextChanged += Search_TextChanged; + OpsPatient.TstbKey.KeyDown += TstbKey_KeyDown; DgvPatient.Initialize(); } + private void TstbKey_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Enter) OnGetBasePatient(); + } + protected override object CreatePresenter() { return new BasePatientPresenter(this); @@ -43,12 +48,6 @@ namespace PEIS.View.Base { ThreadPool.QueueUserWorkItem(state => OnGetBasePatient()); } - private void Search_TextChanged(object sender, EventArgs e) - { - var search = OpsPatient.TstbKey.Text.Trim(); - if (search == @"输入条件查询") return; - DgcPatient.SetDataSource(string.IsNullOrEmpty(search) ? _lstBasePatients : _lstBasePatients.Where(a => a.Name.Contains(search) || a.CardNo.Contains(search)).ToList()); - } private void DgvPatient_CustomColumnDisplayText(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs e) { @@ -80,7 +79,7 @@ namespace PEIS.View.Base } protected virtual void OnGetBasePatient() { - GetBasePatient?.Invoke(this, new Args{}); + GetBasePatient?.Invoke(this, new Args{ Code = OpsPatient.TstbKey.Text.Trim() == "输入条件查询" ? null : string.IsNullOrEmpty(OpsPatient.TstbKey.Text) ? null : OpsPatient.TstbKey.Text.Trim() }); } #endregion