Exemple #1
0
        public BomMaster AddBomMaster(BomMaster newBomMaster)
        {
            BomMaster bomMaster = null;

            try
            {
                _bomMasterDal.Add(newBomMaster);
                bomMaster = newBomMaster;
            }
            catch (RepositoryException ex)
            {
                throw new AisinoMesServiceException("添加物料清单主档信息失败!", ex);
            }
            return(bomMaster);
        }
Exemple #2
0
        public BomMaster UpdateBomMaster(BomMaster updBomMaster)
        {
            BomMaster bomMaster = null;

            try
            {
                _bomMasterDal.Update(updBomMaster);
                bomMaster = updBomMaster;
            }
            catch (RepositoryException ex)
            {
                throw new AisinoMesServiceException("修改物料清单主档信息失败!", ex);
            }
            return(bomMaster);
        }
Exemple #3
0
 public bool CheckAddBomDetail(BomDetail addBomDetail, BomMaster selectBomMaster, bool isBomMaster)
 {
     if (!isBomMaster)
     {
         return(false);
     }
     foreach (BomMaster bomMaster in addBomDetail.GoodsKind.BomMasters)
     {
         if (bomMaster.BomDetails.Any(d => d.GoodsKind.goods_kind_id == selectBomMaster.GoodsKind.goods_kind_id))
         {
             isBomMaster = false;
             break;
         }
         else
         {
             foreach (BomDetail bomDetail in bomMaster.BomDetails)
             {
                 isBomMaster = CheckAddBomDetail(bomDetail, selectBomMaster, isBomMaster);
             }
         }
     }
     return(isBomMaster);
 }
Exemple #4
0
        public BomMaster DeleteBomMaster(BomMaster delBomMaster)
        {
            BomMaster bomMaster = null;

            try
            {
                delBomMaster.bom_master_deleted = true;
                _unitOfWork.AddAction(delBomMaster, DataActions.Update);
                bomMaster = delBomMaster;
                //删除BorGroupDetails表中对应的品号组记录
                //List<BorLine> borLineList = _borLineDal.Find(d => d.bor_group_master_id == delBorGroupMaster.id).Entities.ToList();
                //foreach (BorLine borLine in borLineList)
                //{
                //    _unitOfWork.AddAction(borLine, DataActions.Delete);
                //}

                _unitOfWork.Save();
            }
            catch (RepositoryException ex)
            {
                throw new AisinoMesServiceException("删除物料清单主档信息失败!", ex);
            }
            return(bomMaster);
        }