public TeamUnderwriterSetting CreateOrEditUnderwriterTeamSignature(TeamUnderwriterSetting teamUnderwriterSetting) { var dbTeamUnderwriterSetting = ConsoleRepository.Query<TeamUnderwriterSetting>( tws => tws.TeamId == teamUnderwriterSetting.TeamId && tws.UnderwriterCode == teamUnderwriterSetting.UnderwriterCode).SingleOrDefault(); if (dbTeamUnderwriterSetting != null) { dbTeamUnderwriterSetting.Signature = teamUnderwriterSetting.Signature; } else { ConsoleRepository.Add(teamUnderwriterSetting); dbTeamUnderwriterSetting = teamUnderwriterSetting; } ConsoleRepository.SaveChanges(); return dbTeamUnderwriterSetting; }
public ActionResult CreateOrEditUnderwriterTeamSignature(TeamUnderwriterSetting teamUnderwriterSetting) { if (!ModelState.IsValid) throw new HttpException(406, "Not Acceptable - Invalid Data"); try { var newteamUnderwriterSetting = _adminModuleManager.CreateOrEditUnderwriterTeamSignature(teamUnderwriterSetting); return new JsonNetResult { Data = newteamUnderwriterSetting }; } catch (Exception ex) { _logHandler.WriteLog(ex.ToString(), LogSeverity.Error, LogCategory.BusinessComponent); throw new HttpException(500, "Server Error"); } }