예제 #1
0
        /// <summary>
        /// 按发票号检索发票基本信息
        /// </summary>
        public int QueryInvoiceInfromationByInvoiceNo()
        {
            // 变量定义
            int    intReturn = 0;
            string strCode   = "";

            System.Data.DataSet dsResult1 = new DataSet();
            System.Data.DataSet dsResult2 = new DataSet();
            System.Data.DataSet dsResult3 = new DataSet();
            Neusoft.HISFC.BizLogic.Fee.Outpatient outpatient = new Neusoft.HISFC.BizLogic.Fee.Outpatient();

            // 获取检索码
            intReturn = this.GetInput(ref strCode);
            if (intReturn == -1)
            {
                this.frmWait.Hide();
                return(-1);
            }

            // 执行查询
            intReturn = outpatient.QueryBalancesByInvoiceNO(strCode, ref dsResult1);
            if (-1 == intReturn)
            {
                MessageBox.Show("获取发票基本信息失败" + outpatient.Err);
                this.frmWait.Hide();
                return(-1);
            }
            this.fpSpread1_Sheet1.DataSource = dsResult1;

            // 按发票号查询同时查询发票明细和费用明细
            intReturn = outpatient.QueryBalanceListsByInvoiceNO(strCode, ref dsResult2);
            if (-1 == intReturn)
            {
                MessageBox.Show("获取发票明细失败" + outpatient.Err);
                this.frmWait.Hide();
                return(-1);
            }
            this.fpSpread1_Sheet2.DataSource = dsResult2;

            intReturn = outpatient.QueryFeeItemListsByInvoiceNO(strCode, ref dsResult3);
            if (-1 == intReturn)
            {
                MessageBox.Show("获取费用明细失败" + outpatient.Err);
                this.frmWait.Hide();
                return(-1);
            }
            this.fpSpread1_Sheet3.DataSource = dsResult3;
            if (this.fpSpread1_Sheet3.RowCount > 0)
            {
                this.SetSheet3DisplayData();
            }
            return(1);
        }
예제 #2
0
        /// <summary>
        /// 双击表格第一页,根据发票号查询发票明细和费用明细
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void fpSpread1_CellDoubleClick(object sender, FarPoint.Win.Spread.CellClickEventArgs e)
        {
            if (this.fpSpread1.ActiveSheet == this.fpSpread1_Sheet1)
            {
                if (this.fpSpread1_Sheet1.RowCount > 0)
                {
                    this.frmWait.Show();
                    // 返回值
                    int intReturn = 0;
                    // 声明变量 = 所选行的发票号
                    string strCode = this.fpSpread1_Sheet1.Cells[e.Row, 0].Text;
                    // 返回的数据源
                    System.Data.DataSet dsResult1 = new DataSet();
                    System.Data.DataSet dsResult2 = new DataSet();
                    // 业务层
                    Neusoft.HISFC.BizLogic.Fee.Outpatient outpatient = new Neusoft.HISFC.BizLogic.Fee.Outpatient();

                    // 查询患者发票明细
                    intReturn = outpatient.QueryBalanceListsByInvoiceNO(strCode, ref dsResult1);
                    if (-1 == intReturn)
                    {
                        this.frmWait.Hide();
                        MessageBox.Show("获取发票明细失败" + outpatient.Err);
                        return;
                    }
                    this.fpSpread1_Sheet2.DataSource = dsResult1;
                    this.fpSpread1.ActiveSheet       = this.fpSpread1_Sheet2;
                    // 查询患者费用明细
                    intReturn = outpatient.QueryFeeItemListsByInvoiceNO(strCode, ref dsResult2);
                    if (-1 == intReturn)
                    {
                        this.frmWait.Hide();
                        MessageBox.Show("获取费用明细失败" + outpatient.Err);
                        return;
                    }
                    this.fpSpread1_Sheet3.DataSource = dsResult2;
                    if (this.fpSpread1_Sheet3.RowCount > 0)
                    {
                        this.SetSheet3DisplayData();
                    }

                    this.frmWait.Hide();
                }
            }
        }
예제 #3
0
        private bool SetFeeInfo(string invoiceNO)
        {
            ArrayList alFee = outPatientManager.QueryFeeItemListsByInvoiceNO(invoiceNO);

            if (alFee == null)
            {
                MessageBox.Show("查询费用明细失败!" + outPatientManager.Err);
                return(false);
            }
            if (alFee.Count == 0)
            {
                MessageBox.Show("该发票号不存在,请重新输入!");
                this.txtInvoiceNO.Focus();
                this.txtInvoiceNO.SelectAll();
                return(false);
            }
            int     count = 0;
            decimal cost  = 0;

            Neusoft.HISFC.Models.Fee.Outpatient.FeeItemList tempf = null;
            foreach (Neusoft.HISFC.Models.Fee.Outpatient.FeeItemList f in alFee)
            {
                string  priceUnit = string.Empty;
                decimal price = 0m, qty = 0m;
                if (f.PayType == PayTypes.Balanced && f.CancelType == CancelTypes.Valid)
                {
                    price     = f.Item.Price;
                    priceUnit = f.Item.PriceUnit;
                    qty       = f.Item.Qty;
                    if (f.Item.ItemType == EnumItemType.Drug)
                    {
                        Neusoft.HISFC.Models.Pharmacy.Item item = phaManager.GetItem(f.Item.ID);
                        if (item == null)
                        {
                            MessageBox.Show("查询药品信息失败!" + phaManager.Err);
                            return(false);
                        }
                        if (item.SplitType == "0")
                        {
                            if (f.Item.PriceUnit != item.PackUnit)
                            {
                                price = Neusoft.FrameWork.Public.String.FormatNumber(f.Item.Price / f.Item.PackQty, 2);
                            }
                            else
                            {
                                qty       = qty / item.PackQty;
                                priceUnit = item.PackUnit;
                            }
                        }
                        else
                        {
                            qty       = Neusoft.FrameWork.Public.String.FormatNumber(f.Item.Qty / f.Item.PackQty, 2);
                            priceUnit = item.PackUnit;
                        }
                    }

                    count = this.neuSpread1_Sheet1.Rows.Count;
                    this.neuSpread1_Sheet1.Rows.Add(count, 1);
                    this.neuSpread1_Sheet1.Cells[count, 0].Text = f.Item.ID;
                    this.neuSpread1_Sheet1.Cells[count, 1].Text = f.Item.Name;
                    this.neuSpread1_Sheet1.Cells[count, 2].Text = f.Item.Specs;
                    this.neuSpread1_Sheet1.Cells[count, 3].Text = Neusoft.FrameWork.Public.String.FormatNumber(price, 2).ToString();
                    this.neuSpread1_Sheet1.Cells[count, 4].Text = priceUnit;
                    this.neuSpread1_Sheet1.Cells[count, 5].Text = Neusoft.FrameWork.Public.String.FormatNumber(qty, 2).ToString();
                    this.neuSpread1_Sheet1.Cells[count, 6].Text = (f.FT.OwnCost + f.FT.PubCost + f.FT.PayCost).ToString();
                    cost += f.FT.OwnCost + f.FT.PubCost + f.FT.PayCost;
                    if (tempf == null)
                    {
                        tempf = f;
                    }
                }
            }
            count = this.neuSpread1_Sheet1.Rows.Count;
            this.neuSpread1_Sheet1.Rows.Add(count, 1);
            this.neuSpread1_Sheet1.Cells[count, 0].Text = "合计";
            this.neuSpread1_Sheet1.Cells[count, 6].Text = cost.ToString();

            FrameWork.Models.NeuObject obj = perManager.GetPersonByID(tempf.RecipeOper.ID);
            if (obj != null)
            {
                lblDoct.Text = obj.Name;
            }

            obj = deptManager.GetDeptmentById(tempf.RecipeOper.Dept.ID);
            if (obj != null)
            {
                lblDept.Text = obj.Name;
            }

            return(true);
        }