예제 #1
0
        /// <summary>
        /// 查询
        /// </summary>
        public int Query()
        {
            if (this.dept == null)
            {
                MessageBox.Show(Language.Msg("请设置查询药房"));
                return(-1);
            }
            if (this.drug == null)
            {
                MessageBox.Show(Language.Msg("请设置查询药品"));
                return(-1);
            }
            if (this.deptHelper != null)
            {
                this.dept = this.deptHelper.GetObjectFromID(this.cmbDept.Tag.ToString());
            }
            if (this.drugHelpter != null)
            {
                this.drug = this.drugHelpter.GetObjectFromID(this.cmbItem.Tag.ToString());
            }

            int intervalDays = (this.DtEnd - this.DtBegin).Days;

            this.lbItemInfo.Text = string.Format("药品编码:{0} 规格:{1} 单位:{2}", this.drug.Name, this.drug.Memo, this.drug.User01);

            Neusoft.HISFC.BizLogic.Pharmacy.Item itemMgr = new Neusoft.HISFC.BizLogic.Pharmacy.Item();
            decimal totOutNum    = 0;
            decimal perDayOutNum = 0;

            if (this.isOnlyPatientInOut)
            {
                if (itemMgr.FindByExpand(this.dept.ID, this.drug.ID, intervalDays, this.DtEnd, true, out totOutNum, out perDayOutNum) == -1)
                {
                    MessageBox.Show("统计药品日消耗信息失败!" + itemMgr.Err);
                    return(-1);
                }
            }
            else
            {
                if (itemMgr.FindByExpand(this.dept.ID, this.drug.ID, intervalDays, this.DtEnd, out totOutNum, out perDayOutNum) == -1)
                {
                    MessageBox.Show("统计药品日消耗信息失败!" + itemMgr.Err);
                    return(-1);
                }
            }

            this.lbExpandInfo.Text = string.Format("参考天数:{0}天 出库总量:{1} 日消耗:{2}", intervalDays.ToString(), totOutNum.ToString("N"), perDayOutNum.ToString("N"));

            return(1);
        }
예제 #2
0
        /// <summary>
        /// 科室消耗信息统计
        ///
        ///  {F4D82F23-CCDC-45a6-86A1-95D41EF856B8} 更改函数名称及调用函数
        /// </summary>
        protected void QueryDeptExpandData()
        {
            Neusoft.FrameWork.WinForms.Classes.Function.ShowWaitForm("正在进行药品消耗统计 请稍候...");
            Application.DoEvents();

            Neusoft.HISFC.BizLogic.Pharmacy.Item itemManager = new Neusoft.HISFC.BizLogic.Pharmacy.Item();
            this.expandList = itemManager.FindByExpand(this.deptCode, this.DtBegin, this.DtEnd);
            if (this.expandList == null)
            {
                Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm();
                MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("获取科室消耗信息发生错误!") + itemManager.Err);
                return;
            }

            foreach (Neusoft.FrameWork.Models.NeuObject info in this.expandList)
            {
                info.User02 = (System.Math.Ceiling(NConvert.ToDecimal(info.User01) / (this.DtEnd - this.DtBegin).Days * NConvert.ToDecimal(this.txtMinDays.Text))).ToString();
                info.User03 = (System.Math.Ceiling(NConvert.ToDecimal(info.User01) / (this.DtEnd - this.DtBegin).Days * NConvert.ToDecimal(this.txtMaxDays.Text))).ToString();
            }

            Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm();
        }