public void OutputInsertionOrder(InsertionOrder dataObject)
 {
     if (null != dataObject)
     {
         OutputStatusMessage("* * * Begin OutputInsertionOrder * * *");
         OutputStatusMessage(string.Format("AccountId: {0}", dataObject.AccountId));
         OutputStatusMessage(string.Format("BalanceAmount: {0}", dataObject.BalanceAmount));
         OutputStatusMessage(string.Format("BookingCountryCode: {0}", dataObject.BookingCountryCode));
         OutputStatusMessage(string.Format("Comment: {0}", dataObject.Comment));
         OutputStatusMessage(string.Format("EndDate: {0}", dataObject.EndDate));
         OutputStatusMessage(string.Format("Id: {0}", dataObject.Id));
         OutputStatusMessage(string.Format("LastModifiedByUserId: {0}", dataObject.LastModifiedByUserId));
         OutputStatusMessage(string.Format("LastModifiedTime: {0}", dataObject.LastModifiedTime));
         OutputStatusMessage(string.Format("NotificationThreshold: {0}", dataObject.NotificationThreshold));
         OutputStatusMessage(string.Format("ReferenceId: {0}", dataObject.ReferenceId));
         OutputStatusMessage(string.Format("SpendCapAmount: {0}", dataObject.SpendCapAmount));
         OutputStatusMessage(string.Format("StartDate: {0}", dataObject.StartDate));
         OutputStatusMessage(string.Format("Name: {0}", dataObject.Name));
         OutputStatusMessage(string.Format("Status: {0}", dataObject.Status));
         OutputStatusMessage(string.Format("PurchaseOrder: {0}", dataObject.PurchaseOrder));
         OutputStatusMessage("PendingChanges:");
         OutputInsertionOrderPendingChanges(dataObject.PendingChanges);
         OutputStatusMessage("* * * End OutputInsertionOrder * * *");
     }
 }
        public async Task <AddInsertionOrderResponse> AddInsertionOrderAsync(
            InsertionOrder insertionOrder)
        {
            var request = new AddInsertionOrderRequest
            {
                InsertionOrder = insertionOrder
            };

            return(await CustomerBillingService.CallAsync((s, r) => s.AddInsertionOrderAsync(r), request));
        }
예제 #3
0
        /// <summary>
        /// Put a Value in the hashtable with the Key. If the key already exists then we change it with input value
        /// </summary>
        /// <param name="key">The key</param>
        /// <param name="value">The value to store in the HashTable</param>
        public void Put(K key, V value)
        {
            int hashIndex = HashIndex(key);

            // If the key is not in the HashTable then we add it, else we change it
            if (!Contains(key))
            {
                var newEntry = new Entry(key, value);
                table[hashIndex].AddLast(newEntry);
                InsertionOrder.AddLast(newEntry.Value);
            }
            else
            {
                table[hashIndex].SingleOrDefault(x => x.Key.Equals(key)).Value = value;
            }
        }
예제 #4
0
        /// <summary>
        /// Removes the value that is stored with the key.
        /// </summary>
        /// <returns>If it exist and was deleted</returns>
        public bool Remove(K key)
        {
            if (!Contains(key))
            {
                return(false);
            }

            int hashIndex = HashIndex(key);

            var entry = table[hashIndex].SingleOrDefault(x => x.Key.Equals(key));

            InsertionOrder.Remove(entry.Value);

            // Remove it from the table
            table[hashIndex].Remove(entry);

            return(true);
        }
예제 #5
0
        /// <summary>
        /// Adds an insertion order to the specified account.
        /// https://msdn.microsoft.com/en-US/library/bing-ads-billing-addinsertionorder(v=msads.90).aspx
        /// </summary>
        /// <param name="auth">Do not use ApiAuthentication directly. Use PasswordAuthentication or OAuthAuthentication derives from it instead.</param>
        /// <param name="order">An insertion order to add to the account specified in the InsertionOrder object.</param>
        /// <returns>AddInsertionOrderResponse</returns>
        public AddInsertionOrderResponse AddInsertionOrder(ApiAuthentication auth, InsertionOrder order)
        {
            var request = new AddInsertionOrderRequest
            {
                InsertionOrder = order,
            };

            try
            {
                SetAuthHelper.SetAuth(auth, request);

                return(Check().AddInsertionOrder(request));
            }
            catch (Exception ex)
            {
                Log(new LogEventArgs(ServiceType.CustomerBilling, "AddInsertionOrder", ex.Message, new { Request = request }, ex));
            }

            return(null);
        }
예제 #6
0
 public AddInsertionOrderResponse TryAddInsertionOrder(ApiAuthentication auth, InsertionOrder order)
 {
     return(MethodHelper.TryGet(AddInsertionOrder, this, auth, order));
 }
예제 #7
0
        public async Task <UpdateInsertionOrderResponse> UpdateInsertionOrderAsync(ApiAuthentication auth, InsertionOrder order)
        {
            var request = new UpdateInsertionOrderRequest
            {
                InsertionOrder = order,
            };

            try
            {
                SetAuthHelper.SetAuth(auth, request);

                return(await Check().UpdateInsertionOrderAsync(request));
            }
            catch (Exception ex)
            {
                Log(new LogEventArgs(ServiceType.CustomerBilling, "UpdateInsertionOrderAsync", ex.Message, new { Request = request }, ex));
            }

            return(null);
        }