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); }
public bool Delete(ConstructionDTO entityDto) { return(ConstructionRepository.Build().Delete(ConstructionMapper.Build().ToEntity(entityDto))); }
public ConstructionDTO GetWithChildren(int id) { return(ConstructionMapper.Build().ToDtoWithChildren(ConstructionRepository.Build().GetWithChildren(id))); }
//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()); }
public bool UpdateWithChildren(ConstructionDTO entityDto) { return(ConstructionRepository.Build().UpdateWithChildren(ConstructionMapper.Build().ToEntityWithChildren(entityDto))); }
public int Create(ConstructionDTO entityDto) { return(ConstructionRepository.Build().Create(ConstructionMapper.Build().ToEntity(entityDto))); }
public List <Construction> getAll() { return(ConstructionRepository.getAllConstruction()); }