Esempio n. 1
0
        public async Task <CustomerResponse> InsertUpdateGuest(string token)
        {
            sw.Start();
            CustomerResponse output = null;

            try
            {
                var uri      = new Uri(ServiceURL + "InsertUpdateguests/" + token + "/token/1");
                var content  = JsonConvert.SerializeObject(token);
                var cont     = new StringContent(content, System.Text.Encoding.UTF8, "application/json");
                var response = await client.GetStringAsync(uri).ConfigureAwait(false);

                output = JsonConvert.DeserializeObject <CustomerResponse>(response);
                CurrentUser.PutGuestId(output.customer.CustomerID.ToString());
            }
            catch (Exception ex)
            {
                LoggingClass.LogError(ex.ToString(), screen, ex.StackTrace);
            }
            sw.Stop();
            LoggingClass.LogServiceInfo("Service " + sw.Elapsed.TotalSeconds, "Guest Service");
            //Console.WriteLine("Guest service Time Elapsed"+sw.Elapsed.TotalSeconds);
            return(output);
        }