예제 #1
0
 private void tsrbtnSave_Click(object sender, EventArgs e)
 {
     try
     {
         this.Cursor = GWMHIS.BussinessLogicLayer.Classes.PublicStaticFun.WaitCursor();
         if (CheckInput() == true)
         {
             if (_currentState == ADD)
             {
                 _billProcessor.SaveBill(_currentMaster, GetOrderList(), _currentDeptId);
                 MessageBox.Show("保存成功,当前库房已是盘点状态,请及时审核单据....");
             }
             else
             {
                 _billProcessor.UpdateBill(_currentMaster, GetOrderList(), _currentDeptId);
                 MessageBox.Show("修改成功,请及时审核盘点单据......");
             }
             _currentState = QUERY;
             ShowInQuery();
         }
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message);
     }
     finally
     {
         this.Cursor = this.DefaultCursor;
     }
 }
예제 #2
0
 public void SaveBill()
 {
     try
     {
         if (_currentMaster != null && _orderDt != null)
         {
             List <BillOrder> orderList = new List <BillOrder>();
             for (int index = 0; index < _orderDt.Rows.Count; index++)
             {
                 YP_PlanOrder order = ChangeDataRowToObj(_orderDt.Rows[index]);
                 orderList.Add(order);
             }
             if (_currentMaster.PlanMasterId == 0)
             {
                 _billProcessor.SaveBill(_currentMaster, orderList, 0);
             }
             else
             {
                 _billProcessor.UpdateBill(_currentMaster, orderList, 0);
             }
             _currentState = NORMAL;
             _frmstockplan.ChangeCurrentState(_currentState);
         }
     }
     catch (Exception error)
     {
         throw error;
     }
 }
예제 #3
0
 private void tsrbtnSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (ConfigManager.IsChecking(_currentDeptId))
         {
             MessageBox.Show("药品正在盘点中......");
             return;
         }
         if (CheckSaveBill() == true)
         {
             if (_currentState == ADD)
             {
                 if (_opType == ConfigManager.OP_YF_PJDB)
                 {
                     _billProcessor.SaveBill(ChangeOutmasterToIntmaster(_currentMaster), GetListOrder(), _currentDeptId);
                 }
                 else
                 {
                     _billProcessor.SaveBill(_currentMaster, GetListOrder(), _currentDeptId);
                 }
             }
             else
             {
                 if (_opType == ConfigManager.OP_YF_APPLYIN)
                 {
                     _billProcessor.UpdateBill(ChangeOutmasterToIntmaster(_currentMaster), GetListOrder(), _currentDeptId);
                 }
                 else
                 {
                     _billProcessor.UpdateBill(_currentMaster, GetListOrder(), _currentDeptId);
                 }
             }
             MessageBox.Show("保存成功,请及时审核以确保药品出库。。。");
             tsrbtnNew_Click(null, null);
             tsrOutOrder.Focus();
         }
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message);
     }
 }
예제 #4
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);
            }
        }
예제 #5
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();
     }
 }
예제 #6
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;
     }
 }
예제 #7
0
 private void dgrdInMaker_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         if (_currentMaster.Audit_Flag == 0 && e.ColumnIndex == dgrdInMaker.Columns["ColBtnBackStore"].Index)
         {
             MessageBox.Show("该张单据还未审核,不需要退库,可直接进行修改或删除。", "退库提示",
                             MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
             return;
         }
         if (e.ColumnIndex == dgrdInMaker.Columns["ColBtnBackStore"].Index)
         {
             if (_currentMaster.OpType == ConfigManager.OP_YK_BACKSTORE)
             {
                 MessageBox.Show("退库单无法进行退库。", "退库提示",
                                 MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                 return;
             }
             if (MessageBox.Show("您确定要退该张单据么,单据号:" + _currentMaster.BillNum,
                                 "退库提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
             {
                 this.Cursor = GWMHIS.BussinessLogicLayer.Classes.PublicStaticFun.WaitCursor();
                 _currentMaster.RetailFee     = 0;
                 _currentMaster.StockFee      = 0;
                 _currentMaster.TradeFee      = 0;
                 _currentMaster.Audit_Flag    = 0;
                 _currentMaster.AuditPeopleID = 0;
                 _currentMaster.AuditTime     = new DateTime();
                 _currentMaster.RegTime       = HIS.SYSTEM.PubicBaseClasses.XcDate.ServerDateTime;
                 _currentMaster.RegPeopleID   = (int)_currentUserId;
                 _currentMaster.OpType        = ConfigManager.OP_YK_BACKSTORE;
                 _billProcessor.SaveBill(_currentMaster, _billQurey.GetBackStoreOrderList(_currentMaster), _currentDeptId);
                 tsrbtnRefresh_Click(null, null);
             }
         }
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message);
     }
     finally
     {
         this.Cursor = DefaultCursor;
     }
 }
예제 #8
0
 private void tsrbtnExecute_Click(object sender, EventArgs e)
 {
     try
     {
         if (CheckSaveBill() == true)
         {
             _billProcessor.SaveBill(_adjMaster, GetListOrder(), 0);
             MessageBox.Show("调价执行成功,请及时通知各执行科室。。。");
             tsrbtnNew_Click(null, null);
             tsrAdjOrder.Focus();
         }
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message);
         tsrAdjOrder.Focus();
         tsrbtnQuit.Select();
     }
 }
예제 #9
0
 private void tsrbtnSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (CheckSaveBill() == true)
         {
             if (_currentState == ADD)
             {
                 _billProcessor.SaveBill(_currentMaster, GetListOrder(), _outDept.DeptID);
             }
             else
             {
                 _billProcessor.UpdateBill(_currentMaster, GetListOrder(), _outDept.DeptID);
             }
             ShowInQuery();
             tsrInOrder.Focus();
             MessageBox.Show("保存成功,请告知药库审核入库申请单以确保药品及时入库...");
         }
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message);
     }
 }
예제 #10
0
 private void tsrbtnSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (CheckSaveBill() == true)
         {
             List <BillOrder> listOrder = GetListOrder();
             if (_currentState == ADD || _currentState == BACK)
             {
                 _billProcessor.SaveBill(_currentMaster, listOrder, _currentDeptId);
             }
             else
             {
                 _billProcessor.UpdateBill(_currentMaster, listOrder, _currentDeptId);
             }
             tsrbtnNew_Click(null, null);
             MessageBox.Show("单据成功保存,请及时对单据进行审核以确保药品成功入库");
         }
     }
     catch (Exception error)
     {
         MessageBox.Show(error.Message);
     }
 }
예제 #11
0
 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;
     }
 }