コード例 #1
0
        public HttpStatusCode saveNotifications(string query) // convert to json
        {
            var            response = new HttpResponseMessage();
            HttpStatusCode res;

            try
            {
                Notifications notifications = Notifications.Deserialize(query);
                bool          idExists      = _stockScreenerService.NotificationsIdExists(notifications.Id);

                if (idExists)
                {
                    return(HttpStatusCode.Ambiguous);
                }

                Notifications list = _stockScreenerService.Create(notifications);
                res = response.StatusCode;
            }
            catch (Exception ex)
            {
                if (ex is System.ArgumentNullException)
                {
                    Console.WriteLine("Exception " + ex);
                }

                Console.WriteLine("Exception " + ex);

                res = response.StatusCode;
            }

            return(res);
        }