Esempio n. 1
0
        /// <summary>
        /// 获取模版明细信息
        /// </summary>
        /// <param name="rowIndex">行索引</param>
        /// <returns>成功返回模版明细信息 失败返回null</returns>
        protected Neusoft.HISFC.Models.Preparation.Stencil GetStencilData(int rowIndex)
        {
            Neusoft.HISFC.Models.Preparation.Stencil info = new Neusoft.HISFC.Models.Preparation.Stencil();

            info.Drug = this.fsDrug_Sheet1.Rows[this.fsDrug_Sheet1.ActiveRowIndex].Tag as Neusoft.HISFC.Models.Pharmacy.Item;
            if (info.Drug == null)
            {
                MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("获取当前选择制剂成品信息时发生错误"));
                return(null);
            }

            info.Type.ID   = this.fsStencil_Sheet1.Cells[rowIndex, 0].Text;     //类别
            info.Type.Name = this.fsStencil_Sheet1.Cells[rowIndex, 1].Text;

            info.ItemType = this.GetEnumFromDescription(this.fsStencil_Sheet1.Cells[rowIndex, 2].Text);

            info.Item.Name   = this.fsStencil_Sheet1.Cells[rowIndex, 3].Text;
            info.StandardMax = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.fsStencil_Sheet1.Cells[rowIndex, 4].Text);
            info.StandardMin = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.fsStencil_Sheet1.Cells[rowIndex, 5].Text);
            info.StandardDes = this.fsStencil_Sheet1.Cells[rowIndex, 6].Text;
            info.Memo        = this.fsStencil_Sheet1.Cells[rowIndex, 7].Text;
            info.ID          = this.fsStencil_Sheet1.Cells[rowIndex, 8].Text;

            return(info);
        }
Esempio n. 2
0
        /// <summary>
        /// 模版信息保存
        /// </summary>
        /// <returns>成功返回1 失败返回-1</returns>
        protected int SaveStencil()
        {
            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();
            this.preparationManager.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);

            DateTime sysTime = this.preparationManager.GetDateTimeFromSysDateTime();

            for (int i = 0; i < this.fsStencil_Sheet1.Rows.Count; i++)
            {
                Neusoft.HISFC.Models.Preparation.Stencil info = this.GetStencilData(i);

                info.OperEnv.ID       = this.preparationManager.Operator.ID;
                info.OperEnv.OperTime = sysTime;

                if (this.preparationManager.SetStencil(info) == -1)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("模版信息更新失败") + this.preparationManager.Err);
                    return(-1);
                }
            }

            Neusoft.FrameWork.Management.PublicTrans.Commit();
            MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("保存成功"));

            return(1);
        }
Esempio n. 3
0
        /// <summary>
        /// 删除模版明细信息
        /// </summary>
        protected int DelStencilData()
        {
            int rowIndex = this.fsStencil_Sheet1.ActiveRowIndex;

            if (rowIndex >= 0)
            {
                DialogResult rs = MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("是否确认删除该明细信息"), "", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (rs == DialogResult.No)
                {
                    return(-1);
                }
            }

            Neusoft.HISFC.Models.Preparation.Stencil tempStencil = this.GetStencilData(rowIndex);
            if (tempStencil != null)
            {
                if (this.preparationManager.DelStencil(tempStencil.ID) == -1)
                {
                    MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("删除失败") + this.preparationManager.Err);
                    return(-1);
                }

                MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("删除成功"));
            }

            this.fsStencil_Sheet1.Rows.Remove(rowIndex, 1);

            return(1);
        }
Esempio n. 4
0
        /// <summary>
        /// 获取报告单明细信息
        /// </summary>
        /// <param name="rowIndex">行索引</param>
        /// <returns>成功返回报告单明细信息 失败返回null</returns>
        protected Neusoft.HISFC.Models.Preparation.Process GetProcessData(int row)
        {
            Neusoft.HISFC.Models.Preparation.Process process = new Neusoft.HISFC.Models.Preparation.Process();

            if (this.fsReport_Sheet1.Rows[row].Tag is Neusoft.HISFC.Models.Preparation.Stencil)
            {
                Neusoft.HISFC.Models.Preparation.Stencil stencil = this.fsReport_Sheet1.Rows[row].Tag as Neusoft.HISFC.Models.Preparation.Stencil;
                if (stencil == null)
                {
                    MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("获取当前选择的报告单明细信息时发生错误"));
                    return(null);
                }
                process.Preparation = this.preparation;
                process.ItemType    = stencil.Type.Name;
                process.ProcessItem = stencil.Item;
            }
            else if (this.fsReport_Sheet1.Rows[row].Tag is Neusoft.HISFC.Models.Preparation.Process)
            {
                process = this.fsReport_Sheet1.Rows[row].Tag as Neusoft.HISFC.Models.Preparation.Process;
            }

            process.ResultQty     = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.fsReport_Sheet1.Cells[row, (int)ReportColumnEnum.ColNum].Text);   //实际值
            process.ResultStr     = this.fsReport_Sheet1.Cells[row, (int)ReportColumnEnum.ColDes].Text;
            process.IsEligibility = this.ConvertStringToBool(this.fsReport_Sheet1.Cells[row, (int)ReportColumnEnum.ColEli].Text);

            return(process);
        }
Esempio n. 5
0
        private void fsStencil_CellDoubleClick(object sender, FarPoint.Win.Spread.CellClickEventArgs e)
        {
            int row = this.fsStencil_Sheet1.ActiveRowIndex;

            Neusoft.HISFC.Models.Preparation.Stencil info = this.fsStencil_Sheet1.Rows[row].Tag as Neusoft.HISFC.Models.Preparation.Stencil;

            if (info != null)
            {
                this.AddStencilToReport(info);
            }
        }
Esempio n. 6
0
        /// <summary>
        /// 模版信息
        /// </summary>
        /// <param name="stencil">模版信息</param>
        private void AddStencilData(Neusoft.HISFC.Models.Preparation.Stencil stencil)
        {
            int row = this.fsStencil_Sheet1.Rows.Count;

            this.fsStencil_Sheet1.Rows.Add(row, 1);

            this.fsStencil_Sheet1.Cells[row, (int)StencilColumnEnum.ColType].Text = stencil.Type.Name;
            this.fsStencil_Sheet1.Cells[row, (int)StencilColumnEnum.ColItem].Text = stencil.Item.Name;
            this.fsStencil_Sheet1.Cells[row, (int)StencilColumnEnum.ColMin].Text  = stencil.StandardMin.ToString();
            this.fsStencil_Sheet1.Cells[row, (int)StencilColumnEnum.ColMax].Text  = stencil.StandardMax.ToString();
            this.fsStencil_Sheet1.Cells[row, (int)StencilColumnEnum.ColDes].Text  = stencil.StandardDes;

            this.fsStencil_Sheet1.Rows[row].Tag = stencil;
        }
Esempio n. 7
0
        /// <summary>
        /// 根据选择的模版项目初始化录入信息
        /// </summary>
        /// <param name="stencil">模版信息</param>
        private void AddStencilToReport(Neusoft.HISFC.Models.Preparation.Stencil stencil)
        {
            if (this.hsStencilReport.ContainsKey(stencil.Type.Name + stencil.Item.Name))
            {
                MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("该项目已添加到报告单内"));
                return;
            }

            int row = this.fsReport_Sheet1.Rows.Count;

            this.fsReport_Sheet1.Rows.Add(row, 1);

            this.SetReportCellType(this.fsReport, this.fsReport_Sheet1, stencil.ItemType, row, (int)ReportColumnEnum.ColDes);

            this.fsReport_Sheet1.Cells[row, (int)ReportColumnEnum.ColType].Text = stencil.Type.Name;
            this.fsReport_Sheet1.Cells[row, (int)ReportColumnEnum.ColItem].Text = stencil.Item.Name;



            this.fsReport_Sheet1.Rows[row].Tag = stencil;

            this.hsStencilReport.Add(stencil.Type.Name + stencil.Item.Name, null);
        }