public void GetNotificationTypes_Success(string name) { RunInitSql(name, "ConnectionStringAlerts"); GetNotificationTypes request = PrepareRequest <GetNotificationTypes>(name); GetNotificationTypesResponse response = Post <GetNotificationTypes, GetNotificationTypesResponse>("GetNotificationTypes", request); RunFinalizeSql(name, "ConnectionStringAlerts"); Assert.AreEqual(response.Success, true, "GetNotificationTypes call failed"); Assert.IsNotEmpty(response.Payload.Types, "Types is empty"); }
public object Any(GetNotificationTypes request) { GetNotificationTypesResponse response = new GetNotificationTypesResponse(); TransferHeader(request, response); try { IAlertsDalGetAlertNotificationTypesParams getParams = _dal.CreateGetAlertNotificationTypesParams(); var getResult = _dal.GetAlertNotificationTypes(getParams); if (getResult.Success) { foreach (var at in getResult.Types) { response.Payload.Types.Add(new DTO.NotificationType() { ID = at.ID, Name = at.Value }); } response.Success = true; } } catch (Exception ex) { response.Success = false; response.Errors.Add(new Interfaces.Error() { Code = Interfaces.EErrorCodes.GeneralError, Type = Interfaces.EErrorType.Error, Message = ex.Message }); } return(response); }
public GetNotificationTypesResponse PostGetNotificationTypes(GetNotificationTypes request) { GetNotificationTypesResponse response = Post <GetNotificationTypes, GetNotificationTypesResponse>("GetNotificationTypes", request); return(response); }