예제 #1
0
        public async void Izbaci(ClanZbora clan)
        {
            if (clan.IdKorisnik == App.Korisnik.Id)
            {
                return;
            }
            var glas = clan.Glas.ToLower();

            if (glas.Equals("sopran"))
            {
                Soprani.Remove(clan);
            }
            else if (glas.Equals("alt"))
            {
                Alti.Remove(clan);
            }
            else if (glas.Equals("tenor"))
            {
                Tenori.Remove(clan);
            }
            else if (glas.Equals("bas"))
            {
                Basi.Remove(clan);
            }
            else
            {
                Nerazvrstani.Remove(clan);
            }
            await _apiServices.ObrisiClanZboraAsync(clan.Id);
        }
예제 #2
0
        public async void PromjenaGlasa(ClanZbora clan, int stariIndex, int noviIndex)
        {
            if (stariIndex == noviIndex)
            {
                return;
            }
            if (Nerazvrstani.Contains(clan))
            {
                Nerazvrstani.Remove(clan);
            }
            else if (stariIndex == 0)
            {
                Soprani.Remove(clan);
            }
            else if (stariIndex == 1)
            {
                Alti.Remove(clan);
            }
            else if (stariIndex == 2)
            {
                Tenori.Remove(clan);
            }
            else if (stariIndex == 3)
            {
                Basi.Remove(clan);
            }

            if (noviIndex == 0)
            {
                Soprani.Add(clan);
                clan.Glas = "sopran";
            }
            else if (noviIndex == 1)
            {
                Alti.Add(clan);
                clan.Glas = "alt";
            }
            else if (noviIndex == 2)
            {
                Tenori.Add(clan);
                clan.Glas = "tenor";
            }
            else if (noviIndex == 3)
            {
                Basi.Add(clan);
                clan.Glas = "bas";
            }

            await _apiServices.PromjenaGlasaAsync(clan.Id, noviIndex + 1);
        }