public async void listaMateriiprime() { this.listMateriiPrime.Clear(); FirebaseResponse idResponse = await client.GetAsync("Counter/MateriiPrimeCNT"); Counter get = idResponse.ResultAs <Counter>(); nrMateriiPrime = get.nr; for (int i = 1; i <= get.nr; i++) { FirebaseResponse MateriiPrimeResp = await client.GetAsync("Materii_Prime/" + i.ToString()); MateriiPrime mp = MateriiPrimeResp.ResultAs <MateriiPrime>(); if (mp != null) { this.listMateriiPrime.Add(mp); } } this.l3 = true; }
public async Task addMateriePrimaAsync(MateriiPrime materiePrima) { FirebaseResponse idResponse = await client.GetAsync("Counter/MateriiPrimeCNT"); Counter get = idResponse.ResultAs <Counter>(); get.nr = get.nr + 1; nrMateriiPrime = get.nr; //Se face update in baza de date la numarul de comenzi adaugate FirebaseResponse updateId = await client.UpdateAsync("Counter/MateriiPrimeCNT", get); var data = new MateriiPrime { Id = get.nr, Denumire = materiePrima.Denumire, UM = materiePrima.UM, Cantitate = materiePrima.Cantitate, Pret = materiePrima.Pret }; SetResponse response = await client.SetAsync("Materii_Prime/" + get.nr, data); DateComanda result = response.ResultAs <DateComanda>(); }
public async Task UpdateMateriePrimaAsync(MateriiPrime materiePrima) { FirebaseResponse response = await client.UpdateAsync("Materii_Prime/" + materiePrima.Id, materiePrima); }