private void txtQueryNum_KeyDown(object sender, KeyEventArgs e)
 {
     try
     {
         //发药模式为住院发药
         if (_dispenseModel == 1 && e.KeyValue == 13)
         {
             if (this.txtQueryNum.Text.Trim() == "")
             {
                 return;
             }
             lstPatInfo.Items.Clear();
             _currentZYPat = IN_InterFace.QueryPatByInpatNum(this.txtQueryNum.Text.Trim());
             if (_currentZYPat == null)
             {
                 MessageBox.Show(this.txtQueryNum, "该病人不存在");
                 this.txtQueryNum.Text = "";
                 return;
             }
             ListViewItem lstItem = new ListViewItem(_currentZYPat.PatientInfo.PatName);
             lstPatInfo.Items.Add(lstItem);
             lstItem.SubItems.Add(_currentZYPat.PatientInfo.PatSex);
             lstItem.SubItems.Add(_currentZYPat.PatientInfo.PatBriDate.ToString("yyyy-mm-dd"));
             lstItem.Tag = _currentZYPat;
             lstPatInfo.Items[0].Selected = true;
             lstPatInfo_DoubleClick(null, null);
             ShowCurrentPat();
             this.btnDispense.Focus();
         }
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message);
     }
 }
 private void btnQuery_Click(object sender, EventArgs e)
 {
     try
     {
         this.Cursor   = GWMHIS.BussinessLogicLayer.Classes.PublicStaticFun.WaitCursor();
         _currentZYPat = IN_InterFace.QueryPatByInpatNum(this.txtQueryNum.Text.Trim());
         if (_currentZYPat == null)
         {
             MessageBox.Show(this.txtQueryNum, "该病人不存在");
             this.txtQueryNum.Text = "";
             return;
         }
         if (_currentZYPat.PatType != "2")
         {
             MessageBox.Show(this.txtQueryNum, "该病人已出院,无法退药");
             this.txtQueryNum.Text = "";
             return;
         }
         ShowCurrentPat();
         _dispOrder = IN_InterFace.QueryRefRecipeOrder(_currentZYPat, (int)_currentDeptId,
                                                       cobBeginDate.Value, cobEndDate.Value);
         dgrdDispOrder.DataSource = _dispOrder;
         this.btnRefund.Focus();
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message);
     }
     finally
     {
         this.Cursor = this.DefaultCursor;
     }
 }