예제 #1
0
        /// <summary>
        /// 特限项目选择框
        /// </summary>
        /// <param name="iIndex"></param>
        /// <returns></returns>
        public void PopSpeItem(int iIndex)
        {
            ArrayList alData = new ArrayList();

            if (this.ActiveSv == this.fpDeptSheet)
            {
                alData = this.alDpet;
            }
            else
            {
                alData = this.alPerson;
            }

            string[] label   = { "项目", "项目名称" };
            float[]  width   = { 80F, 100F };
            bool[]   visible = { true, true };
            Neusoft.FrameWork.Models.NeuObject speObj = new Neusoft.FrameWork.Models.NeuObject();
            if (Neusoft.FrameWork.WinForms.Classes.Function.ChooseItem(alData, ref speObj) == 1)
            {
                Neusoft.HISFC.Models.Pharmacy.DrugSpecial drugSpe = this.ActiveSv.Rows[iIndex].Tag as Neusoft.HISFC.Models.Pharmacy.DrugSpecial;

                drugSpe.SpeItem = speObj;

                this.ActiveSv.Cells[iIndex, 2].Text = speObj.Name;

                this.SetFocus(false);
            }
        }
예제 #2
0
        /// <summary>
        /// 项目信息加入
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        public int AddItem(Neusoft.HISFC.Models.Pharmacy.Item item)
        {
            int iIndex = this.ActiveSv.Rows.Count;

            this.ActiveSv.Rows.Add(iIndex, 1);

            Neusoft.HISFC.Models.Pharmacy.DrugSpecial drugSpe = new Neusoft.HISFC.Models.Pharmacy.DrugSpecial();
            if (this.ActiveSv == this.fpDeptSheet)
            {
                drugSpe.SpeType = Neusoft.HISFC.Models.Pharmacy.EnumDrugSpecialType.Dept;
            }
            else
            {
                drugSpe.SpeType = Neusoft.HISFC.Models.Pharmacy.EnumDrugSpecialType.Doc;
            }

            drugSpe.Item = item;

            this.ActiveSv.Cells[iIndex, 0].Text = item.Name;
            this.ActiveSv.Cells[iIndex, 1].Text = item.Specs;
            this.ActiveSv.Cells[iIndex, 0].Tag  = "New";
            this.ActiveSv.Rows[iIndex].Tag      = drugSpe;

            return(1);
        }
예제 #3
0
        /// <summary>
        /// 特限信息删除
        /// </summary>
        /// <returns></returns>
        public int DelDrugSpecial()
        {
            if (this.ActiveSv.Rows.Count <= 0)
            {
                return(1);
            }

            DialogResult rs = MessageBox.Show(Language.Msg("确认删除该条特限信息吗?"), "", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);

            if (rs == DialogResult.No)
            {
                return(0);
            }

            Neusoft.HISFC.Models.Pharmacy.DrugSpecial drugSpe = this.ActiveSv.Rows[this.ActiveSv.ActiveRowIndex].Tag as Neusoft.HISFC.Models.Pharmacy.DrugSpecial;

            if (this.consManager.DelDrugSpecial(drugSpe) == -1)
            {
                MessageBox.Show(Language.Msg(string.Format("删除{0} - {1} 特限信息失败", drugSpe.Item.Name, drugSpe.SpeItem.Name)) + this.consManager.Err);
                return(-1);
            }

            MessageBox.Show(Language.Msg("删除成功"));

            this.ActiveSv.Rows.Remove(this.ActiveSv.ActiveRowIndex, 1);

            return(1);
        }
예제 #4
0
        /// <summary>
        /// 特限药品信息显示
        /// </summary>
        /// <param name="drugSpe">特限药品信息</param>
        /// <returns>成功返回1 失败返回-1</returns>
        protected int AddItem(Neusoft.HISFC.Models.Pharmacy.DrugSpecial drugSpe)
        {
            this.ActiveSv.Rows.Add(0, 1);

            this.ActiveSv.Cells[0, 0].Text = drugSpe.Item.Name;
            this.ActiveSv.Cells[0, 1].Text = drugSpe.Item.Specs;
            this.ActiveSv.Cells[0, 2].Text = drugSpe.SpeItem.Name;
            this.ActiveSv.Cells[0, 3].Text = drugSpe.Memo;
            this.ActiveSv.Cells[0, 1].Tag  = null;

            this.ActiveSv.Rows[0].Tag = drugSpe;

            return(1);
        }
예제 #5
0
        /// <summary>
        /// 保存特限药品信息
        /// </summary>
        /// <returns></returns>
        public int SaveDrugSpecial()
        {
            if (!this.IsValid())
            {
                return(-1);
            }

            Neusoft.HISFC.Models.Pharmacy.EnumDrugSpecialType speType = Neusoft.HISFC.Models.Pharmacy.EnumDrugSpecialType.Dept;

            if (this.ActiveSv == this.fpDeptSheet)
            {
                speType = Neusoft.HISFC.Models.Pharmacy.EnumDrugSpecialType.Dept;
            }
            else
            {
                speType = Neusoft.HISFC.Models.Pharmacy.EnumDrugSpecialType.Doc;
            }

            DateTime sysTime = this.consManager.GetDateTimeFromSysDateTime();

            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();

            //Neusoft.FrameWork.Management.Transaction t = new Transaction(Neusoft.FrameWork.Management.Connection.Instance);
            //t.BeginTransaction();

            this.consManager.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);

            #region 先删除原特限信息

            if (this.consManager.DelDrugSpecial(speType) == -1)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                MessageBox.Show(Language.Msg("原特限药品信息删除失败") + this.consManager.Err);
                return(-1);
            }

            #endregion

            #region 新特限信息保存

            for (int i = 0; i < this.ActiveSv.Rows.Count; i++)
            {
                Neusoft.HISFC.Models.Pharmacy.DrugSpecial drugSpe = this.ActiveSv.Rows[i].Tag as Neusoft.HISFC.Models.Pharmacy.DrugSpecial;

                drugSpe.Memo          = this.ActiveSv.Cells[i, 3].Text; //备注信息
                drugSpe.Oper.OperTime = sysTime;
                drugSpe.Oper.ID       = this.consManager.Operator.ID;

                if (this.consManager.InsertDrugSpecial(drugSpe) == -1)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    if (this.consManager.DBErrCode == 1)
                    {
                        MessageBox.Show(Language.Msg(string.Format("{0} - {1} 特限信息重复 请删除一条", drugSpe.Item.Name, drugSpe.SpeItem.Name)));
                    }
                    else
                    {
                        MessageBox.Show(Language.Msg(string.Format("保存{0} - {1} 特限信息失败", drugSpe.Item.Name, drugSpe.SpeItem.Name)) + this.consManager.Err);
                    }
                    return(-1);
                }
                this.ActiveSv.Cells[i, 0].Tag = null;
            }

            #endregion

            Neusoft.FrameWork.Management.PublicTrans.Commit();

            MessageBox.Show(Language.Msg("保存成功"));

            return(1);
        }