Example #1
0
        public async Task addRetetaAsync(Reteta reteta)
        {
            FirebaseResponse idResponse = await client.GetAsync("Counter/RetCNT");

            Counter get = idResponse.ResultAs <Counter>();

            get.nr   = get.nr + 1;
            nrRetete = reteta.Id = get.nr;
            //Se face update in baza de date la numarul de comenzi adaugate
            FirebaseResponse updateId = await client.UpdateAsync("Counter/RetCNT", get);

            SetResponse response = await client.SetAsync("Retete/" + get.nr, reteta);

            Reteta result = response.ResultAs <Reteta>();
        }
Example #2
0
        public async void listaRetete()
        {
            this.listRetete.Clear();
            FirebaseResponse idResponse = await client.GetAsync("Counter/RetCNT");

            Counter get = idResponse.ResultAs <Counter>();

            nrRetete = get.nr;

            for (int i = 1; i <= get.nr; i++)
            {
                FirebaseResponse ReteteResp = await client.GetAsync("Retete/" + i.ToString());

                Reteta ret = ReteteResp.ResultAs <Reteta>();
                if (ret != null)
                {
                    this.listRetete.Add(ret);
                }
            }
            this.l4 = true;
        }
Example #3
0
 public async Task UpdateRetetaAsync(Reteta reteta)
 {
     FirebaseResponse response = await client.UpdateAsync("Retete/" + reteta.Id, reteta);
 }