Exemple #1
0
        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);
        }
Exemple #3
0
        public GetNotificationTypesResponse PostGetNotificationTypes(GetNotificationTypes request)
        {
            GetNotificationTypesResponse response = Post <GetNotificationTypes, GetNotificationTypesResponse>("GetNotificationTypes", request);

            return(response);
        }
 public object Get(GetNotificationTypes request)
 {
     return(_notificationManager.GetNotificationTypes());
 }
        public object Get(GetNotificationTypes request)
        {
            var result = _notificationManager.GetNotificationTypes();

            return(ToOptimizedResult(result));
        }