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; } }
private void btnRefund_Click(object sender, EventArgs e) { try { if (ConfigManager.IsChecking(_currentDeptId)) { MessageBox.Show("药品正在盘点中......"); return; } if (MessageBox.Show("您确定要退以下药品么?", "退药确认", MessageBoxButtons.OKCancel) == DialogResult.Cancel) { return; } if (_dispOrder == null || _dispOrder.Rows.Count < 1) { MessageBox.Show("没有药品可退", "警告", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); return; } this.Cursor = GWMHIS.BussinessLogicLayer.Classes.PublicStaticFun.WaitCursor(); ZY_DispPresInfo presInfo = new ZY_DispPresInfo(); presInfo.CureDocCode = _currentZYPat.CureDocCode; presInfo.CureNo = _currentZYPat.CureNo; presInfo.drFlag = 0; presInfo.opType = ConfigManager.OP_YF_REFUND; presInfo.PatListId = _currentZYPat.PatListID; presInfo.PatName = _currentZYPat.PatientInfo.PatName; presInfo.presDeptId = Convert.ToInt32(_currentZYPat.CurrDeptCode); presInfo.recipeNum = 1; YP_DRMaster refMaster = _billProcessor.BuildNewDispenseMaster(presInfo, (int)_currentDeptId, (int)_currentUserId); List <BillOrder> refList = _billProcessor.BuildNewDispOrder(_dispOrder, refMaster, 1); _billProcessor.SaveBill(refMaster, refList, _currentDeptId); MessageBox.Show("退药成功,请及时告知记账护士进行冲账"); this.txtQueryNum.Focus(); } catch (Exception error) { MessageBox.Show(error.Message); } finally { _dispOrder = IN_InterFace.QueryRefRecipeOrder(_currentZYPat, (int)_currentDeptId, cobBeginDate.Value, cobEndDate.Value); dgrdDispOrder.DataSource = _dispOrder; this.Cursor = DefaultCursor; } }
private void LoadData(string invoiceNum) { try { if (Convert.ToInt32(invoiceNum) != 0) { listMaster = _billQuery.LoadDispMaster(invoiceNum, (int)_currentDeptId); dgrdDispMaster.AutoGenerateColumns = false; dgrdDispMaster.DataSource = listMaster; _dispOrder = IN_InterFace.QueryRefRecipeOrder(invoiceNum); dgrdDispOrder.AutoGenerateColumns = false; dgrdDispOrder.DataSource = _dispOrder; } } catch (Exception error) { throw error; } }