public CreateTimeResponse AddTimeSetting(CreateTimeRequest request) { var response = new CreateTimeResponse { ResponseStatus = ResponseStatus.Success }; var settingsProvider = new SettingsProvider(); try { if (request.ActionType == ActionType.Insert) { response.isSuccessful = settingsProvider.AddTimes(request); } else { response.ResponseStatus = ResponseStatus.Failure; response.ResponseDescription = "Not update action"; } } catch (Exception ex) { response.ResponseStatus = ResponseStatus.Failure; response.ResponseDescription = ex.Message; } return(response); }