示例#1
0
        private void btnDispense_Click(object sender, EventArgs e)
        {
            try
            {
                if (ConfigManager.IsChecking(_currentDeptId) == true)
                {
                    MessageBox.Show("药品正在盘点中......");
                    return;
                }
                if (_currentPat.InvoiceNum == "" || _presList.Rows.Count <= 0)
                {
                    MessageBox.Show("没有病人需要发药");
                    return;
                }
                List <YP_DRMaster> listMaster = new List <YP_DRMaster>();
                for (int index = 0; index < _presList.Rows.Count; index++)
                {
                    Prescription dispPres   = GetPresFromDt(index);
                    YP_DRMaster  dispMaster = _billProcessor.BuildNewDispenseMaster(dispPres, (int)_currentDeptId,
                                                                                    (int)_currentUserId);
                    listMaster.Add(dispMaster);
                    List <BillOrder> dispList = _billProcessor.BuildNewDispOrder((DataTable)_recipeTb[dispPres.PrescriptionID], dispMaster, 0);
                    if (dispList != null)
                    {
                        _billProcessor.SaveBill(dispMaster, dispList, _currentDeptId);
                    }
                }
                MessageBox.Show("发药成功,请注意库存...", "发药成功提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                ////2010.10.20 门诊住院发药打印发药清单 add by heyan
                //YP_Printer printer= PrintFactory.GetPrinter(ConfigManager.OP_YF_DISPENSE + "MZ"); ;
                //string startPath = Application.StartupPath+"\\report\\门诊发药单据.grf";
                //for (int i = 0; i < listMaster.Count; i++)
                //{
                //    printer.PrintBill(listMaster[i], null, startPath, (int)_currentUserId);
                //}

                for (int i = 0; i < listMaster.Count; i++) //update by heyan 2010.10.29 点发药时直接打印处方
                {
                    mz_Interface.PrintDocPres(listMaster[i].RecipeID);
                }
                lstPatInfo_DoubleClick(null, null);
                if (chkRefresh.Checked == true)
                {
                    btnRefresh_Click(null, null);
                }
                this.txtQueryNum.Focus();
            }
            catch (Exception error)
            {
                MessageBox.Show(error.Message);
            }
        }
示例#2
0
 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;
         }
         if (CheckRefundNum() == false)
         {
             MessageBox.Show("药品退药数量过多,请重新输入");
             return;
         }
         List <YP_DRMaster> printList = new List <YP_DRMaster>();
         for (int index = 0; index < listMaster.Rows.Count; index++)
         {
             YP_DRMaster dispMaster = GetDRMasterFromDt(index);
             YP_DRMaster refMaster  = _billProcessor.BuildNewDispenseMaster(dispMaster,
                                                                            (int)_currentDeptId, (int)_currentUserId);
             List <BillOrder> refList = _billProcessor.BuildNewDispOrder(_dispOrder, dispMaster, 0);
             if (refList.Count > 0)
             {
                 _billProcessor.SaveBill(refMaster, refList, _currentDeptId);
                 printList.Add(refMaster);
             }
         }
         MessageBox.Show("退药成功,请注意库存...", "退药成功", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message);
     }
     finally
     {
         LoadData(Convert.ToInt32(txtQueryNum.Text).ToString());
         this.txtQueryNum.Focus();
     }
 }
示例#3
0
 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 btnDispense_Click(object sender, EventArgs e)
 {
     try
     {
         Decimal newDispFee = 0;
         this.Cursor = GWMHIS.BussinessLogicLayer.Classes.PublicStaticFun.WaitCursor();
         if (ConfigManager.IsChecking(_currentDeptId) == true)
         {
             MessageBox.Show("药品正在盘点中......");
             return;
         }
         if (this._recipeOrder == null)
         {
             MessageBox.Show("没有药品可发");
             return;
         }
         if (this._recipeOrder.Rows.Count < 1)
         {
             MessageBox.Show("没有药品可发");
             return;
         }
         if (_dispenseModel == 1)
         {
             if (_currentZYPat == null)
             {
                 MessageBox.Show("没有病人需要发药");
                 return;
             }
             YP_DRMaster dispMaster = _billProcessor.BuildNewDispenseMaster(_currentZYPat, (int)_currentDeptId, (int)_currentUserId);
             newDispFee = IN_InterFace.QueryPatDispFee(_currentZYPat, (int)_currentDeptId);
             if (this.CompareFee(newDispFee) == false)
             {
                 MessageBox.Show("该病人因费用冲账发药信息需要刷新,请重新刷新");
                 return;
             }
             if (_recipeOrder != null)
             {
                 List <BillOrder> dispList = _billProcessor.BuildNewDispOrder(_recipeOrder, dispMaster, _dispenseModel);
                 _billProcessor.SaveBill(dispMaster, dispList, _currentDeptId);
                 MessageBox.Show("发药成功...", "发药成功", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                 _recipeOrder = IN_InterFace.QueryRecipeOrder(_currentZYPat, (int)_currentDeptId);
                 dgrdRecipeInfo.DataSource = _recipeOrder;
             }
         }
         //如果是住院统领
         else
         {
             ZY_PatList dispPat;
             for (int index = 0; index < lstPatInfo.CheckedItems.Count; index++)
             {
                 dispPat     = (ZY_PatList)lstPatInfo.CheckedItems[index].Tag;
                 newDispFee += IN_InterFace.QueryPatDispFee(dispPat, (int)_currentDeptId);
             }
             if (CompareFee(newDispFee) == false)
             {
                 MessageBox.Show("有病人因费用冲账发药信息需要刷新,请重新刷新");
                 return;
             }
             List <BillMaster> dispList = new List <BillMaster>();
             for (int index = 0; index < lstPatInfo.CheckedItems.Count; index++)
             {
                 dispPat = (ZY_PatList)lstPatInfo.CheckedItems[index].Tag;
                 YP_DRMaster dispMaster = _billProcessor.BuildNewDispenseMaster(dispPat, (int)_currentDeptId, (int)_currentUserId);
                 dispList.Add(dispMaster);
             }
             YP_DispDeptHis newDispDept = (YP_DispDeptHis)(_billProcessor.SaveBills(dispList, _searchDeptId, _allDispPats));
             MessageBox.Show("发药成功,开始打印统领发药单据...", "发药成功", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
             PrintDispTL(dispList, newDispDept);
             LoadTLMessage();
         }
         this.txtQueryNum.Focus();
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message);
     }
     finally
     {
         this.Cursor = DefaultCursor;
     }
 }