示例#1
0
 /// <summary>
 /// Add Business Change to Push Queue
 /// </summary>
 /// <param name="businessChangeRequest">Business Change Request</param>
 /// <returns>True if change was added to queue</returns>
 public bool AddBusinessChangeToPushQueue(BusinessChangeRequest businessChangeRequest)
 {
     return businessDao.AddBusinessChangeToPushQueue(businessChangeRequest);
 }
示例#2
0
        public bool ResetAvailability(long businessId)
        {
            var request = new BusinessChangeRequest
            {
                Action = BusinessChangeRequestType.AvailabilityReset,
                BusinessId = businessId,
                IsOptinActive = true
            };

            return businessManager.AddBusinessChangeToPushQueue(request);
        }
示例#3
0
            public void AddBusChangeToPushQueue()
            {
                // Arrange
                var change = new BusinessChangeRequest
                                {
                                    BusinessId = 5001,
                                    ChannelGuid = new Guid("FE2A7B02-A74F-4FEB-A4A4-37CBD3633220"),
                                    IsOptinActive = true,
                                    Action = BusinessChangeRequestType.ProviderReset
                                };

                var success = businessDao.AddBusinessChangeToPushQueue(change);

                Assert.True(success, "The business change was not pushed to the queue");
            }
示例#4
0
        /// <summary>
        /// Add Business Change to Push Queue
        /// </summary>
        /// <param name="businessChangeRequest">Business Change Request</param>
        /// <returns>True if change was added to queue</returns>
        public bool AddBusinessChangeToPushQueue(BusinessChangeRequest businessChangeRequest)
        {
            // in parameters
            var parameters = new List<SqlParameter>
            {
                DbHelper.CreateParameter(BusinessMapper.BusinessChangeParameters.BusinessId, businessChangeRequest.BusinessId),
                DbHelper.CreateParameter(BusinessMapper.BusinessChangeParameters.Action, businessChangeRequest.Action.GetCode()),
                DbHelper.CreateParameter(BusinessMapper.BusinessChangeParameters.IsOptinActive, businessChangeRequest.IsOptinActive),
                DbHelper.CreateParameter(BusinessMapper.BusinessChangeParameters.ChannelGuid, businessChangeRequest.ChannelGuid),
                DbHelper.CreateParameter(BusinessMapper.BusinessChangeParameters.UserId, AuditFieldsHelper.GetUserId())
            };

            // out parameters
            SqlParameter itemId;
            parameters.Add(itemId = DbHelper.CreateParameterOut<int>(BusinessMapper.BusinessChangeParameters.ItemId, SqlDbType.Int));

            // Execute the query
            DbHelper.ExecuteNonQueryCommand("Business.AddBusinessChangeToPushQueue", CommandType.StoredProcedure, parameters);

            return (DbHelper.ParameterValue<int>(itemId) != default(int));
        }