Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="fullProject"></param>
        /// <returns></returns>
        public bool CreateProject(FullProjectDTO fullProject)
        {
            var             result       = false;
            TblProjects     projects     = _mapper.Map <TblProjects>(fullProject.projectDTO);
            TblCustomFields customFileds = _mapper.Map <TblCustomFields>(fullProject.customFieldsDTO);

            result = _projectRepository.CreateProject(projects, customFileds);
            return(result);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="fullProject"></param>
        /// <returns></returns>
        public ProjectDTO CreateProject(FullProjectDTO fullProject)
        {
            TblProjects projects = _mapper.Map <TblProjects>(fullProject.projectDTO);

            projects.CreatedDate = DateTime.UtcNow;
            projects.ProjectId   = Guid.NewGuid().ToString();
            List <TblCustomFields> customFields = CastObject <CustomFieldsDTO, TblCustomFields>(fullProject.customFieldsDTO);

            projects = _projectRepository.CreateProject(projects, customFields);
            ProjectDTO projectdto = _mapper.Map <ProjectDTO>(projects);

            return(projectdto);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="fullProject"></param>
        /// <returns></returns>
        public ProjectDTO UpdateProject(FullProjectDTO fullProject)
        {
            var         result   = false;
            TblProjects projects = _mapper.Map <TblProjects>(fullProject.projectDTO);

            projects.UpdatedDate = DateTime.UtcNow;
            TblCustomFields customFields = _mapper.Map <TblCustomFields>(fullProject.customFieldsDTO);

            projects = _projectRepository.UpdateProject(projects, customFields);
            ProjectDTO projectdto = _mapper.Map <ProjectDTO>(projects);

            return(projectdto);
        }
Beispiel #4
0
 public APIResponse UpdateProject(FullProjectDTO project)
 {
     try
     {
         return(new APIResponse
         {
             returnCode = 0,
             returnMessage = "Success",
             returnObject = _projectService.UpdateProject(project)
         });
     }
     catch (Exception ex)
     {
         return(new APIResponse
         {
             returnCode = -1,
             returnMessage = ex.Message.ToString()
         });
     }
 }
 public bool UpdateProject(FullProjectDTO project)
 {
     project.projectDTO.UpdatedDate = DateTime.UtcNow;
     return(_projectService.UpdateProject(project));
 }