Example #1
0
        public static void WriteCustomer(String email, String pass, Customer customer)
        {
            ConnectToDataBase();
            var new_customer = new Customer_Data {
                username = email, password = pass, account_id = customer.Id
            };

            FireBaseMethods.InsertData("Customers/" + customer.Id, new_customer);
        }
Example #2
0
        public static List <Customer_Data> ReadAllCustomers()
        {
            ConnectToDataBase();
            var    response = GetData("Customers");
            object json     = JsonConvert.DeserializeObject(response.Body);
            List <Customer_Data> customers = new List <Customer_Data>();

            foreach (JToken item in ((JToken)(json)).Children())
            {
                System.Diagnostics.Debug.WriteLine(item.ToString());

                foreach (JToken data in item.Children())
                {
                    Customer_Data customer = data.ToObject <Customer_Data>();
                    customers.Add(customer);
                }
            }
            return(customers);
        }