// save project public int SaveProject(ProjectDetail projectDetail) { if (projectGateway.IfAnyEntryExists(projectDetail)) { ProjectDetail projectDetailModel = projectGateway.GetProjectInfoByOtherInfo(projectDetail); return(projectDetailModel.Id); } else { int rowsAffected = projectGateway.SaveProject(projectDetail); if (rowsAffected > 0) { ProjectDetail projectDetailModel = projectGateway.GetProjectInfoByOtherInfo(projectDetail); return(projectDetailModel.Id); } else { return(0); } } }