Esempio n. 1
0
        /// <summary>
        /// 药柜处理
        /// </summary>
        private void SetArkDept(ref Neusoft.FrameWork.Models.NeuObject operDept)
        {
            Neusoft.HISFC.BizLogic.Pharmacy.Constant   phaConsManager = new Neusoft.HISFC.BizLogic.Pharmacy.Constant();
            Neusoft.HISFC.Models.Pharmacy.DeptConstant deptCons       = phaConsManager.QueryDeptConstant(operDept.ID);
            if (deptCons == null)
            {
                MessageBox.Show(Language.Msg("根据科室编码获取科室常数信息发生错误") + phaConsManager.Err);
                return;
            }

            if (deptCons.IsArk)         //对药柜管理科室进行以下处理
            {
                Neusoft.HISFC.BizProcess.Integrate.Manager managerIntegrate = new Neusoft.HISFC.BizProcess.Integrate.Manager();
                ArrayList al = managerIntegrate.LoadPhaParentByChildren(operDept.ID);
                if (al == null || al.Count == 0)
                {
                    MessageBox.Show(Language.Msg("获取科室结构信息发生错误") + managerIntegrate.Err);
                    return;
                }

                Neusoft.HISFC.Models.Base.DepartmentStat deptStat = al[0] as Neusoft.HISFC.Models.Base.DepartmentStat;
                if (deptStat.PardepCode.Substring(0, 1) == "S")     //上级节点为分类编码 不进行处理
                {
                    return;
                }
                else
                {
                    operDept.ID   = deptStat.PardepCode;
                    operDept.Name = deptStat.PardepName;
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 显示科室列表
        /// </summary>
        private int ShowDeptList()
        {
            this.neuSpread1_Sheet1.RowCount = 0;

            //取科室常数信息
            ArrayList al = this.phaConsManager.QueryDeptConstantList();

            if (al == null)
            {
                MessageBox.Show(Language.Msg(this.phaConsManager.Err));
                return(-1);
            }

            try
            {
                this.hsphaDept.Clear();

                Neusoft.HISFC.Models.Pharmacy.DeptConstant deptConstant = null;
                this.neuSpread1_Sheet1.RowCount = 0;

                int iCount = 0;

                for (int i = 0; i < al.Count; i++)
                {
                    deptConstant = al[i] as Neusoft.HISFC.Models.Pharmacy.DeptConstant;

                    this.hsphaDept.Add(deptConstant.ID, null);

                    if (deptConstant.ID.Substring(0, 1) == "S")
                    {
                        continue;
                    }

                    this.neuSpread1_Sheet1.Rows.Add(iCount, 1);

                    this.neuSpread1_Sheet1.Cells[iCount, (int)ColumnSet.ColDeptID].Value        = deptConstant.ID;                                //部门编码
                    this.neuSpread1_Sheet1.Cells[iCount, (int)ColumnSet.ColDeptName].Value      = deptConstant.Name;                              //部门名称
                    this.neuSpread1_Sheet1.Cells[iCount, (int)ColumnSet.ColIsStore].Value       = deptConstant.IsStore;                           //是否管理库存
                    this.neuSpread1_Sheet1.Cells[iCount, (int)ColumnSet.ColIsBatch].Value       = deptConstant.IsBatch;                           //是否按批号管理
                    this.neuSpread1_Sheet1.Cells[iCount, (int)ColumnSet.ColUnitFlag].Value      = deptConstant.UnitFlag == "1" ? "包装单位" : "最小单位"; //库存管理默认单位:0最小单位,1包装单位
                    this.neuSpread1_Sheet1.Cells[iCount, (int)ColumnSet.ColMaxDays].Value       = deptConstant.StoreMaxDays;                      //库存上限天数
                    this.neuSpread1_Sheet1.Cells[iCount, (int)ColumnSet.ColMinDays].Value       = deptConstant.StoreMinDays;                      //库存下限天数
                    this.neuSpread1_Sheet1.Cells[iCount, (int)ColumnSet.ColReferenceDays].Value = deptConstant.ReferenceDays;                     //参考天数
                    this.neuSpread1_Sheet1.Cells[iCount, (int)ColumnSet.ColIsArk].Value         = deptConstant.IsArk;                             //药柜管理标志 是否药柜管理
                    this.neuSpread1_Sheet1.Cells[iCount, (int)ColumnSet.ColInListNO].Value      = deptConstant.InListNO;
                    this.neuSpread1_Sheet1.Cells[iCount, (int)ColumnSet.ColOutListNO].Value     = deptConstant.OutListNO;

                    iCount++;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return(-1);
            }
            return(1);
        }
        /// <summary>
        /// 药柜处理
        /// </summary>
        private void SetArkDept(ref Neusoft.FrameWork.Models.NeuObject operDept)
        {
            Neusoft.HISFC.BizLogic.Pharmacy.Constant   phaConsManager = new Neusoft.HISFC.BizLogic.Pharmacy.Constant();
            Neusoft.HISFC.Models.Pharmacy.DeptConstant deptCons       = phaConsManager.QueryDeptConstant(operDept.ID);
            if (deptCons == null)
            {
                MessageBox.Show(Language.Msg("根据科室编码获取科室常数信息发生错误") + phaConsManager.Err);
                return;
            }

            operDept.Memo = Neusoft.FrameWork.Function.NConvert.ToInt32(deptCons.IsArk).ToString();
            if (this.tvDrugMessage1.StockMarkDept == null || (this.tvDrugMessage1.StockMarkDept.ID != operDept.ID))
            {
                this.tvDrugMessage1.StockMarkDept = operDept.Clone();
            }

            if (deptCons.IsArk)         //对药柜管理科室进行以下处理
            {
                #region 药柜处理

                Neusoft.HISFC.BizProcess.Integrate.Manager managerIntegrate = new Neusoft.HISFC.BizProcess.Integrate.Manager();
                ArrayList al = managerIntegrate.LoadPhaParentByChildren(operDept.ID);
                if (al == null || al.Count == 0)
                {
                    MessageBox.Show(Language.Msg("获取科室结构信息发生错误") + managerIntegrate.Err);
                    return;
                }

                Neusoft.HISFC.Models.Base.DepartmentStat deptStat = al[0] as Neusoft.HISFC.Models.Base.DepartmentStat;
                if (deptStat.PardepCode.Substring(0, 1) == "S")     //上级节点为分类编码 不进行处理
                {
                    return;
                }
                else
                {
                    this.ucDrugDetail1.ArkDept  = operDept.Clone();
                    this.ucDrugMessage1.ArkDept = operDept.Clone();

                    //核准扣库科室为药柜所属药房
                    this.ucDrugDetail1.ApproveDept      = new Neusoft.FrameWork.Models.NeuObject();
                    this.ucDrugDetail1.ApproveDept.ID   = deptStat.PardepCode;
                    this.ucDrugDetail1.ApproveDept.Name = deptStat.PardepName;

                    this.ucDrugMessage1.ApproveDept      = new Neusoft.FrameWork.Models.NeuObject();
                    this.ucDrugMessage1.ApproveDept.ID   = deptStat.PardepCode;
                    this.ucDrugMessage1.ApproveDept.Name = deptStat.PardepName;

                    operDept.ID   = deptStat.PardepCode;
                    operDept.Name = deptStat.PardepName;
                }

                #endregion

                this.isArkDept = true;
            }
        }
Esempio n. 4
0
        /// <summary>
        /// 判断某科室是否为药柜
        /// </summary>
        /// <param name="deptCode">科室编码</param>
        /// <returns>成功返回1 失败返回-1</returns>
        private bool ArkJudge(string deptCode)
        {
            Neusoft.HISFC.BizLogic.Pharmacy.Constant phaConsManager = new Neusoft.HISFC.BizLogic.Pharmacy.Constant();

            Neusoft.HISFC.Models.Pharmacy.DeptConstant deptCons = phaConsManager.QueryDeptConstant(deptCode);
            if (deptCons == null)
            {
                MessageBox.Show(Language.Msg("根据科室编码获取科室常数信息失败") + phaConsManager.Err);
                return(false);
            }

            return(deptCons.IsArk);
        }
Esempio n. 5
0
 /// <summary>
 /// 根据所赋值的库房编码 设置信息显示
 /// </summary>
 public void SetData()
 {
     Neusoft.HISFC.BizLogic.Pharmacy.Constant   consMgr  = new Neusoft.HISFC.BizLogic.Pharmacy.Constant();
     Neusoft.HISFC.Models.Pharmacy.DeptConstant deptCons = consMgr.QueryDeptConstant(this.deptCode);
     if (deptCons == null)
     {
         MessageBox.Show(Language.Msg("获取科室常数发生错误! \n" + consMgr.Err));
         return;
     }
     this.dtpEnd.Value        = consMgr.GetDateTimeFromSysDateTime().Date.AddDays(1).AddSeconds(-1);
     this.dtpBegin.Value      = this.dtpEnd.Value.AddDays(-deptCons.ReferenceDays);
     this.txtMaxDays.Text     = deptCons.StoreMaxDays.ToString();
     this.txtMinDays.Text     = deptCons.StoreMinDays.ToString();
     this.lbIntervalDays.Text = deptCons.ReferenceDays.ToString() + "天";
 }
Esempio n. 6
0
        /// <summary>
        /// 获取科室结构信息
        /// </summary>
        /// <returns></returns>
        private int ShowDeptStat()
        {
            Neusoft.HISFC.BizLogic.Manager.DepartmentStatManager deptStatManager = new Neusoft.HISFC.BizLogic.Manager.DepartmentStatManager();
            ArrayList alDeptStat = deptStatManager.LoadDepartmentStat("03");

            if (alDeptStat == null)
            {
                MessageBox.Show(Language.Msg("获取科室节点信息失败"));
                return(-1);
            }

            foreach (Neusoft.HISFC.Models.Base.DepartmentStat deptStat in alDeptStat)
            {
                if (this.hsphaDept.ContainsKey(deptStat.DeptCode))
                {
                    continue;
                }

                if (deptStat.DeptCode.Substring(0, 1) == "S")
                {
                    continue;
                }

                Neusoft.HISFC.Models.Pharmacy.DeptConstant deptConstant = new Neusoft.HISFC.Models.Pharmacy.DeptConstant();

                deptConstant.ID   = deptStat.DeptCode;
                deptConstant.Name = deptStat.DeptName;

                int iCount = this.neuSpread1_Sheet1.Rows.Count;

                this.neuSpread1_Sheet1.Rows.Add(iCount, 1);

                this.neuSpread1_Sheet1.Cells[iCount, (int)ColumnSet.ColDeptID].Value   = deptConstant.ID;               //部门编码
                this.neuSpread1_Sheet1.Cells[iCount, (int)ColumnSet.ColDeptName].Value = deptConstant.Name;             //部门名称

                this.neuSpread1_Sheet1.Cells[iCount, (int)ColumnSet.ColIsStore].Value  = false;
                this.neuSpread1_Sheet1.Cells[iCount, (int)ColumnSet.ColIsBatch].Value  = false;  //是否按批号管理
                this.neuSpread1_Sheet1.Cells[iCount, (int)ColumnSet.ColUnitFlag].Value = "最小单位"; //库存管理默认单位:0最小单位,1包装单位
                this.neuSpread1_Sheet1.Cells[iCount, (int)ColumnSet.ColIsArk].Value    = false;  //药柜管理标志 是否药柜管理

                this.neuSpread1_Sheet1.Cells[iCount, (int)ColumnSet.ColInListNO].Value  = "";    //药柜管理标志 是否药柜管理
                this.neuSpread1_Sheet1.Cells[iCount, (int)ColumnSet.ColOutListNO].Value = "";    //药柜管理标志 是否药柜管理
            }
            return(1);
        }
Esempio n. 7
0
        /// <summary>
        /// 保存
        /// </summary>
        private int SaveDeptCons()
        {
            if (this.neuSpread1_Sheet1.RowCount == 0)
            {
                MessageBox.Show(Language.Msg("没有可以保存的数据"));
                return(-1);
            }

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

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

            phaConsManager.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);

            Neusoft.HISFC.Models.Pharmacy.DeptConstant deptConstant = null;

            for (int i = 0; i < this.neuSpread1_Sheet1.RowCount; i++)
            {
                deptConstant = new Neusoft.HISFC.Models.Pharmacy.DeptConstant();

                deptConstant.ID            = this.neuSpread1_Sheet1.Cells[i, (int)ColumnSet.ColDeptID].Text;                                    //部门编码
                deptConstant.Name          = this.neuSpread1_Sheet1.Cells[i, (int)ColumnSet.ColDeptName].Text;                                  //部门名称
                deptConstant.IsStore       = NConvert.ToBoolean(this.neuSpread1_Sheet1.Cells[i, (int)ColumnSet.ColIsStore].Value.ToString());   //是否管理库存
                deptConstant.IsBatch       = NConvert.ToBoolean(this.neuSpread1_Sheet1.Cells[i, (int)ColumnSet.ColIsBatch].Value.ToString());   //是否按批号管理
                deptConstant.UnitFlag      = this.neuSpread1_Sheet1.Cells[i, (int)ColumnSet.ColUnitFlag].Text.ToString() == "包装单位" ? "1" : "0"; //库存管理默认单位:0最小单位,1包装单位
                deptConstant.StoreMaxDays  = NConvert.ToInt32(this.neuSpread1_Sheet1.Cells[i, (int)ColumnSet.ColMaxDays].Text);                 //库存上限天数
                deptConstant.StoreMinDays  = NConvert.ToInt32(this.neuSpread1_Sheet1.Cells[i, (int)ColumnSet.ColMinDays].Text);                 //库存下限天数
                deptConstant.ReferenceDays = NConvert.ToInt32(this.neuSpread1_Sheet1.Cells[i, (int)ColumnSet.ColReferenceDays].Text);           //参考天数
                deptConstant.IsArk         = NConvert.ToBoolean(this.neuSpread1_Sheet1.Cells[i, (int)ColumnSet.ColIsArk].Value.ToString());     //是否药柜管理
                //{849BBA57-0A27-4e6b-BC8C-C92A9B9B325F}
                //deptConstant.InListNO = this.neuSpread1_Sheet1.Cells[i, (int)ColumnSet.ColInListNO].Value.ToString();
                //deptConstant.OutListNO = this.neuSpread1_Sheet1.Cells[i, (int)ColumnSet.ColOutListNO].Value.ToString();
                try
                {
                    deptConstant.InListNO = this.neuSpread1_Sheet1.Cells[i, (int)ColumnSet.ColInListNO].Value.ToString();
                }
                catch (Exception)
                {
                    deptConstant.InListNO = "";
                }

                try
                {
                    deptConstant.OutListNO = this.neuSpread1_Sheet1.Cells[i, (int)ColumnSet.ColOutListNO].Value.ToString();
                }
                catch (Exception)
                {
                    deptConstant.OutListNO = "";
                }

                int parm = this.phaConsManager.UpdateDeptConstant(deptConstant);
                if (parm == 0)
                {
                    if (this.phaConsManager.InsertDeptConstant(deptConstant) != 1)
                    {
                        Neusoft.FrameWork.Management.PublicTrans.RollBack();
                        MessageBox.Show(Language.Msg(this.phaConsManager.Err));
                        return(-1);
                    }
                }
                else if (parm == -1)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    MessageBox.Show(Language.Msg(this.phaConsManager.Err));
                    return(-1);
                }
            }

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

            return(1);
        }