public bool finish(int id)
        {
            var construction = ConstructionRepository.find(id);

            if (construction.Status != "In progress of constructing")
            {
                return(false);
            }

            ConstructionRepository.finish(construction);
            return(true);
        }
        public bool start(int id)
        {
            var construction = ConstructionRepository.find(id);

            if (construction.Status != "Waiting for constructing")
            {
                return(false);
            }

            ConstructionRepository.start(construction);
            return(true);
        }
        public bool add(int ideaID)
        {
            var lists = ConstructionRepository.getAllConstruction();

            foreach (Construction c in lists)
            {
                if (c.IdeaID == ideaID)
                {
                    return(false);
                }
            }

            var construction = ConstructionFactory.create(ideaID);

            ConstructionRepository.add(construction);
            return(true);
        }
Esempio n. 4
0
 public bool Delete(ConstructionDTO entityDto)
 {
     return(ConstructionRepository.Build().Delete(ConstructionMapper.Build().ToEntity(entityDto)));
 }
Esempio n. 5
0
 public ConstructionDTO GetWithChildren(int id)
 {
     return(ConstructionMapper.Build().ToDtoWithChildren(ConstructionRepository.Build().GetWithChildren(id)));
 }
Esempio n. 6
0
        //public bool CreateOrUpdate(ConstructionDTO entityDto)
        //{
        //    return entityDto.Id > 0 ? Update(entityDto) : Create(entityDto);
        //}

        public List <ConstructionDTO> GetAll()
        {
            return(ConstructionMapper.Build().ToDtoList(ConstructionRepository.Build().GetAll()).ToList());
        }
Esempio n. 7
0
 public bool UpdateWithChildren(ConstructionDTO entityDto)
 {
     return(ConstructionRepository.Build().UpdateWithChildren(ConstructionMapper.Build().ToEntityWithChildren(entityDto)));
 }
Esempio n. 8
0
 public int Create(ConstructionDTO entityDto)
 {
     return(ConstructionRepository.Build().Create(ConstructionMapper.Build().ToEntity(entityDto)));
 }
 public List <Construction> getAll()
 {
     return(ConstructionRepository.getAllConstruction());
 }