public async Task updateComandaAsync(Comanda comanda) { var data = new DateComanda { Id = comanda.id, Sursa = comanda.sursa, Beneficiar = comanda.beneficiar, DataComanda = comanda.dataComanda.ToString("dd/MM/yyyy"), DataLivrare = comanda.dataLivrare.ToString("dd/MM/yyyy"), ZiuaLivrare = comanda.ziuaLivrare, OraLivrare = comanda.oraLivrare, Adresa = comanda.adresa, Telefon = comanda.telefon, TelefonRezerva = comanda.telefonRezerva, Servicii = comanda.servicii, PretTotal = comanda.pretTotal, Avans = comanda.avans, Rest = comanda.rest, BCF = comanda.bcf }; FirebaseResponse response = await client.UpdateAsync("Comenzi/" + data.Id, data); DateComanda result = response.ResultAs <DateComanda>(); //listaComenzi(); }
public async void listaComenzi() { this.listComenzi.Clear(); FirebaseResponse idResponse = await client.GetAsync("Counter/ComCNT"); Counter get = idResponse.ResultAs <Counter>(); nrComenzi = get.nr; for (int i = 1; i <= get.nr; i++) { FirebaseResponse prodResp = await client.GetAsync("Comenzi/" + i.ToString()); DateComanda dt = prodResp.ResultAs <DateComanda>(); if (dt != null) { this.listComenzi.Add(dt); } } this.l2 = 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 addComandaAsync(Comanda comanda) { //Se ia numarul de id-uri din baza de date FirebaseResponse idResponse = await client.GetAsync("Counter/ComCNT"); Counter get = idResponse.ResultAs <Counter>(); get.nr = get.nr + 1; nrComenzi = get.nr; //Se face update in baza de date la numarul de comenzi adaugate FirebaseResponse updateId = await client.UpdateAsync("Counter/ComCNT", get); var data = new DateComanda { Id = get.nr, Sursa = comanda.sursa, Beneficiar = comanda.beneficiar, DataComanda = comanda.dataComanda.ToString("dd/MM/yyyy"), DataLivrare = comanda.dataLivrare.ToString("dd/MM/yyyy"), ZiuaLivrare = comanda.ziuaLivrare, OraLivrare = comanda.oraLivrare, Adresa = comanda.adresa, Telefon = comanda.telefon, TelefonRezerva = comanda.telefonRezerva, Servicii = comanda.servicii, PretTotal = comanda.pretTotal, Avans = comanda.avans, Rest = comanda.rest, BCF = comanda.bcf }; SetResponse response = await client.SetAsync("Comenzi/" + get.nr, data); DateComanda result = response.ResultAs <DateComanda>(); //listaComenzi(); }