Beispiel #1
0
        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();
        }
Beispiel #2
0
        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;
        }
Beispiel #3
0
        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>();
        }
Beispiel #4
0
        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();
        }