Esempio n. 1
0
 public override Hashtable ChangeStoreNum(BillMaster billMaster, List <BillOrder> orderList)
 {
     try
     {
         Hashtable storeNumHash = new Hashtable();
         foreach (BillOrder order in orderList)
         {
             YP_StoreNum storeNum      = new YP_StoreNum();
             YP_OutOrder orderOutstore = (YP_OutOrder)order;
             storeNum.smallUnit  = orderOutstore.LeastUnit;
             storeNum.makerDicId = orderOutstore.MakerDicID;
             decimal reduceNum = orderOutstore.OutNum;
             decimal rtn       = ReduceStoreNum(orderOutstore.MakerDicID, orderOutstore.DeptID, reduceNum);
             if (rtn != -1)
             {
                 storeNum.storeNum = rtn;
                 storeNum.queryKey = storeNum.makerDicId.ToString() + orderOutstore.ProductNum;
             }
             else
             {
                 string drugName = DrugBaseDataBll.GetDurgName(storeNum.makerDicId);
                 throw new Exception("[" + drugName + "]" + "出库数量过多,审核失败");
             }
             storeNumHash.Add(storeNum.queryKey, storeNum);
         }
         BatchProcessor.ReduceBatchNum(orderList);
         return(storeNumHash);
     }
     catch (Exception error)
     {
         throw error;
     }
 }
Esempio n. 2
0
 /// <summary>
 /// 更新药品批次信息
 /// </summary>
 /// <param name="batch">药品批次实体</param>
 /// <param name="newValidityTime">更新的到效日期</param>
 public void UpdateBatch(YP_Batch batch, DateTime newValidityTime)
 {
     try
     {
         BatchProcessor.UpdateBatch(batch, newValidityTime);
     }
     catch (Exception error)
     {
         throw error;
     }
 }
Esempio n. 3
0
 /// <summary>
 /// 更新药品批次
 /// </summary>
 /// <param name="orderList">药品盘存明细信息表</param>
 public void UpdateBatch(List <YP_CheckOrder> orderList)
 {
     try
     {
         BatchProcessor.UpdateBatchNum(orderList);
     }
     catch (Exception error)
     {
         throw error;
     }
 }
Esempio n. 4
0
        public override Hashtable ChangeStoreNum(BillMaster billMaster, List <BillOrder> orderList)
        {
            try
            {
                Hashtable   storeNumHash = new Hashtable();
                YP_InMaster inStore      = (YP_InMaster)billMaster;
                foreach (BillOrder order in orderList)
                {
                    YP_StoreNum storeNum     = new YP_StoreNum();
                    YP_InOrder  orderInstore = (YP_InOrder)order;
                    storeNum.makerDicId = orderInstore.MakerDicID;
                    storeNum.smallUnit  = orderInstore.LeastUnit;
                    IBaseDAL <YP_Storage> storeDao = BindEntity <YP_Storage> .CreateInstanceDAL(oleDb, BLL.Tables.YK_STORAGE);

                    //增加库存
                    decimal rtn = base.AddStoreNum(orderInstore.MakerDicID, orderInstore.DeptID, orderInstore.InNum);
                    if (rtn == -1)
                    {
                        YP_Storage drugStore = new YP_Storage();
                        drugStore.CurrentNum  = orderInstore.InNum;
                        drugStore.Del_Flag    = 0;
                        drugStore.DeptID      = inStore.DeptID;
                        drugStore.LeastUnit   = storeNum.smallUnit;
                        drugStore.LowerLimit  = 0;
                        drugStore.LStockPrice = orderInstore.StockPrice;
                        drugStore.MakerDicID  = orderInstore.MakerDicID;
                        drugStore.RegTime     = inStore.RegTime;
                        drugStore.UnitNum     = orderInstore.UnitNum;
                        drugStore.UpperLimit  = 0;
                        storeDao.Add(drugStore);
                        storeNum.storeNum = orderInstore.InNum;
                    }
                    else
                    {
                        storeNum.storeNum = rtn;
                    }
                    storeNum.queryKey = orderInstore.MakerDicID.ToString() + orderInstore.BatchNum.ToString();
                    storeNumHash.Add(storeNum.queryKey, storeNum);
                }
                BatchProcessor.AddBatchNum(orderList, inStore.RegTime);
                return(storeNumHash);
            }
            catch (Exception error)
            {
                throw error;
            }
        }
Esempio n. 5
0
        public override Hashtable ChangeStoreNum(BillMaster billMaster, List <BillOrder> orderList)
        {
            try
            {
                Hashtable   storeNumHash = new Hashtable();
                YP_InMaster inStore      = (YP_InMaster)billMaster;
                foreach (BillOrder order in orderList)
                {
                    YP_StoreNum storeNum     = new YP_StoreNum();
                    YP_InOrder  orderInstore = (YP_InOrder)order;
                    storeNum.makerDicId = orderInstore.MakerDicID;
                    storeNum.smallUnit  = orderInstore.LeastUnit;
                    IBaseDAL <YP_Storage> storeDao = BindEntity <YP_Storage> .CreateInstanceDAL(oleDb, BLL.Tables.YK_STORAGE);

                    //增加库存
                    decimal rtn = base.ReduceStoreNum(orderInstore.MakerDicID, orderInstore.DeptID, orderInstore.InNum);
                    if (rtn != -1)
                    {
                        storeNum.storeNum = rtn;
                        storeNum.queryKey = storeNum.makerDicId.ToString() + orderInstore.BatchNum;
                    }
                    else
                    {
                        string drugName = DrugBaseDataBll.GetDurgName(storeNum.makerDicId);
                        throw new Exception("[" + drugName + "]" + "退库数量过多,审核失败");
                    }
                    storeNumHash.Add(storeNum.queryKey, storeNum);
                }
                BatchProcessor.BackBatchNum(orderList);
                return(storeNumHash);
            }
            catch (Exception error)
            {
                throw error;
            }
        }