Пример #1
0
        public bool Insert(ProjectDTO dto)
        {
            if (!dto.IsValid())
            {
                return(false);
            }

            var entity = new Project(dto.Name, dto.Date_Start_Formated, dto.Date_End_Formated, null);

            _projectRepository.Insert(entity);

            return(true);
        }
Пример #2
0
        public bool Update(ProjectDTO dto, int id)
        {
            if (!dto.IsValid())
            {
                return(false);
            }

            var data = _projectRepository.Get(id);

            data.SetName(dto.Name);
            data.SetDateStart(dto.Date_Start_Formated);
            data.SetDateEnd(dto.Date_End_Formated);

            _projectRepository.Update(data);

            return(true);
        }