public void UpdateStatus(string key, CodeStatus status) { var code = _codeMapRepository.Find(key); code.Status = status; code.UpdatedOn = DateTime.Now; if (status == CodeStatus.InActive) { code.RemovedOn = DateTime.Now; } _codeMapRepository.Update(code); }
public void AddProject(ProjectViewModel4Create viewModel) { var codeMap = _codeMapRepository.Find(viewModel.ProjectState); var securityKey = new SecurityKey { SecurityCode = BitConverter.ToString(Guid.NewGuid().ToByteArray()) .Replace("-", string.Empty).ToUpper(), Key = _securityKeyRepository.GetKey() }; _securityKeyRepository.Add(securityKey); var project = new Project { Key = _projectRepository.GetKey(), Name = viewModel.ProjectName, ProjectState = codeMap, SecurityKey = securityKey }; _projectRepository.Add(project); }