Пример #1
0
        /// <summary>
        /// Add/Update a query with the stored query service.
        /// </summary>
        /// <param name="comms">
        /// <see cref="IGbdxComms"/> used for communicating with the stored query service.
        /// </param>
        /// <param name="netObject">
        /// the network object to be used in communicating with stored query service
        /// </param>
        /// <param name="itemToAddUpdate">
        /// The item to add update.
        /// </param>
        /// <returns>
        /// True if the update/add was successful.
        /// </returns>
        public bool UpdateQuery(IGbdxComms comms, NetObject netObject, SavedQuery itemToAddUpdate)
        {
            try
            {
                // Serialize the workspace
                var serializedWorkspace = JsonConvert.SerializeObject(itemToAddUpdate, Formatting.None);

                // Send the request to the stored query service.
                var response = comms.PushRequest(netObject, serializedWorkspace);

                // Check to see if the response object is null.
                if (response == null)
                {
                    return(false);
                }

                // Return the status of the update to the user.
                return(response.ResponseStatusCode == HttpStatusCode.OK);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Пример #2
0
 /// <summary>
 /// Add/Update a query with the stored query service.
 /// </summary>
 /// <param name="netObject">
 /// the network object to be used in communicating with stored query service
 /// </param>
 /// <param name="itemToAddUpdate">
 /// The item to add update.
 /// </param>
 /// <returns>
 /// True if the update/add was successful.
 /// </returns>
 public bool UpdateQuery(NetObject netObject, SavedQuery itemToAddUpdate)
 {
     return(this.UpdateQuery(this.cloudComms, netObject, itemToAddUpdate));
 }
Пример #3
0
 /// <summary>
 /// Add/Update a query with the stored query service.
 /// </summary>
 /// <param name="netObject">
 /// the network object to be used in communicating with stored query service
 /// </param>
 /// <param name="itemToAddUpdate">
 /// The item to add update.
 /// </param>
 /// <returns>
 /// True if the update/add was successful.
 /// </returns>
 public bool UpdateQuery(NetObject netObject, SavedQuery itemToAddUpdate)
 {
     return this.UpdateQuery(this.cloudComms, netObject,itemToAddUpdate);
 }
Пример #4
0
        /// <summary>
        /// Add/Update a query with the stored query service.
        /// </summary>
        /// <param name="comms">
        /// <see cref="IGbdxComms"/> used for communicating with the stored query service.
        /// </param>
        /// <param name="netObject">
        /// the network object to be used in communicating with stored query service
        /// </param>
        /// <param name="itemToAddUpdate">
        /// The item to add update.
        /// </param>
        /// <returns>
        /// True if the update/add was successful.
        /// </returns>
        public bool UpdateQuery(IGbdxComms comms, NetObject netObject, SavedQuery itemToAddUpdate)
        {
            try
            {
                // Serialize the workspace
                var serializedWorkspace = JsonConvert.SerializeObject(itemToAddUpdate,Formatting.None);

                // Send the request to the stored query service.
                var response = comms.PushRequest(netObject, serializedWorkspace);

                // Check to see if the response object is null.
                if (response == null)
                {
                    return false;
                }

                // Return the status of the update to the user.
                return response.ResponseStatusCode == HttpStatusCode.OK;
            }
            catch (Exception)
            {
                return false;
            }
        }