public bool CreateProject(ProjectDTO project)
        {
            bool result = false;

            try
            {
                Project projectDb          = Mapper.Map <Project>(project);
                int     generatedProjectId = _projectData.CreateProject(projectDb);
                if (generatedProjectId > 0)
                {
                    if (project.UserId != null && project.UserId > 0)
                    {
                        return(_userData.UpdateUserProjectIdTaskId(Convert.ToInt32(project.UserId), generatedProjectId, null));
                    }
                    return(true);
                }
                else
                {
                    result = false;
                }
            }
            catch (Exception ex)
            {
                result = false;
            }
            return(result);
        }
Exemple #2
0
        public async Task <ProjectModel> CreateProject(CreateProjectModel model)
        {
            var entity = await _projectData.CreateProject(model).ConfigureAwait(false);

            var mappedModel = _mapper.Map <ProjectModel>(entity);

            return(mappedModel);
        }