Exemplo n.º 1
0
 private void provjeraDopustenjaKorisnika(object sender, FormClosedEventArgs e)
 {
     kori = Autentifikator.dohvatiPrijavljenogKorisnika();
     if (kori.ulogaNaziv == "Kupac")
     {
         msIzbornikArtikli.Visible     = false;
         msIzbornikServisi.Visible     = false;
         msIzbornikRacun.Visible       = false;
         msIzbornikZaposlenici.Visible = false;
         msIzbornikKupci.Visible       = false;
     }
     else
     {
         msIzbornikUredjaji.Visible = false;
     }
 }
Exemplo n.º 2
0
        public async Task odhlasenie(string email, bool async)
        {
            Debug.WriteLine("Metoda odhlasenie bola vykonana");

            var obsah = new Dictionary <string, string>
            {
                { "email", email }
            };

            HttpResponseMessage odpoved = await new Request().postRequestUdalostiServer(obsah, Nastavenia.SERVER_ODHLASENIE);

            if (odpoved.IsSuccessStatusCode)
            {
                Autentifikator autentifikator     = JsonConvert.DeserializeObject <Autentifikator>(await odpoved.Content.ReadAsStringAsync());
                Dictionary <string, string> udaje = new Dictionary <string, string>();

                if (!autentifikator.chyba)
                {
                    if (async)
                    {
                        await this.odpovedeOdServera.odpovedServeraAsync(Nastavenia.VSETKO_V_PORIADKU, Nastavenia.AUTENTIFIKACIA_ODHLASENIE, null);
                    }
                    else
                    {
                        this.odpovedeOdServera.odpovedServer(Nastavenia.VSETKO_V_PORIADKU, Nastavenia.AUTENTIFIKACIA_ODHLASENIE, null);
                    }
                }
            }
            else
            {
                if (async)
                {
                    await this.odpovedeOdServera.odpovedServeraAsync("Server je momentalne nedostupný!", Nastavenia.AUTENTIFIKACIA_ODHLASENIE, null);
                }
                else
                {
                    this.odpovedeOdServera.odpovedServer("Server je momentalne nedostupný!", Nastavenia.AUTENTIFIKACIA_ODHLASENIE, null);
                }
            }
        }