Esempio n. 1
0
        /// <summary>
        /// 检查库存
        /// </summary>
        /// <param name="iCheck"></param>
        /// <param name="itemID"></param>
        /// <param name="itemName"></param>
        /// <param name="deptCode"></param>
        /// <param name="qty"></param>
        /// <returns></returns>
        public static bool CheckPharmercyItemStock(int iCheck, string itemID, string itemName, string deptCode, decimal qty)
        {
            //Neusoft.HISFC.Manager.Item manager = new Neusoft.HISFC.BizLogic.Pharmacy.Item();
            //Neusoft.HISFC.Models.Pharmacy.item item = null;
            //.
            Neusoft.HISFC.BizProcess.Integrate.Pharmacy phaManager = new Neusoft.HISFC.BizProcess.Integrate.Pharmacy();

            Neusoft.HISFC.Models.Pharmacy.Storage phaItem = null;


            switch (iCheck)
            {
            case 0:
                phaItem = phaManager.GetItemForInpatient(deptCode, itemID);
                if (phaItem == null)
                {
                    return(true);
                }
                if (qty > Neusoft.FrameWork.Function.NConvert.ToDecimal(phaItem.StoreQty))
                {
                    return(false);
                }
                break;

            case 1:
                phaItem = phaManager.GetItemForInpatient(deptCode, itemID);


                if (phaItem == null)
                {
                    return(true);
                }
                if (qty > Neusoft.FrameWork.Function.NConvert.ToDecimal(phaItem.StoreQty))
                {
                    if (MessageBox.Show("药品【" + itemName + "】的库存不够!是否继续执行!", "提示库存不足", MessageBoxButtons.OKCancel) == DialogResult.OK)
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
                break;

            case 2:
                break;

            default:
                return(true);
            }
            return(true);
        }