public bool DeleteProjectCode(ProjectCode projectCode) { if (projectCode == null) return false; _unitOfWork.ProjectCodeRepository.Delete(projectCode); _unitOfWork.Save(); return true; }
public bool EditProjectCode(ProjectCode projectCode) { _unitOfWork.ProjectCodeRepository.Edit(projectCode); _unitOfWork.Save(); return true; }
public bool AddProjectCode(ProjectCode projectCode) { _unitOfWork.ProjectCodeRepository.Add(projectCode); _unitOfWork.Save(); return true; }
/// <summary> /// Gets the project code id W ith create. /// </summary> /// <param name="projectNumber">The project number.</param> /// <returns></returns> public ProjectCode GetProjectCodeIdWIthCreate(string projectNumber) { var projCode = _unitOfWork.ProjectCodeRepository.FindBy(i => i.Value.ToUpper() == projectNumber.ToUpper()).SingleOrDefault(); if (projCode != null) { return projCode; } else { ProjectCode newProjectCode = new ProjectCode() { Value = projectNumber.ToUpperInvariant() }; _unitOfWork.ProjectCodeRepository.Add(newProjectCode); _unitOfWork.Save(); return newProjectCode; } }