Esempio n. 1
0
        public static Tuple <bool, string> VratiSveTimove(ref List <Tim> result)
        {
            OpstaSistemskaOperacija vratiSveTimove = new VratiSveTimoveSO();

            if (vratiSveTimove.IzvrsiSO(new Tim()))
            {
                var timovi = (List <IOpstiDomenskiObjekat>)vratiSveTimove.Rezultat;
                OpstaSistemskaOperacija ucitajTim = new UcitajTimSO();
                List <Tim> konacan = new List <Tim>();
                foreach (var tim in timovi)
                {
                    if (ucitajTim.IzvrsiSO(tim))
                    {
                        konacan.Add((Tim)ucitajTim.Rezultat);
                    }
                    else
                    {
                        return(new Tuple <bool, string>(true, "Sistem ne moze da ucita sve timove."));
                    }
                }
                result = konacan;
                return(new Tuple <bool, string>(true, "Uspesno ucitane sve timove."));
            }
            else
            {
                return(new Tuple <bool, string>(true, "Sistem ne moze da ucita sve timove."));
            }
        }
Esempio n. 2
0
        public static Tuple <bool, string> UcitajTim(Tim tim, ref Tim result)
        {
            OpstaSistemskaOperacija ucitajTim = new UcitajTimSO();

            if (ucitajTim.IzvrsiSO(tim))
            {
                result = (Tim)ucitajTim.Rezultat;
                return(new Tuple <bool, string>(true, "Uspešno učitan tim."));
            }
            else
            {
                return(new Tuple <bool, string>(false, "Sistem ne može da učita tim."));
            }
        }
Esempio n. 3
0
        public static Tuple <bool, string> ZapamtiTim(Tim tim)
        {
            OpstaSistemskaOperacija ucitajTim = new UcitajTimSO();

            if (ucitajTim.IzvrsiSO(tim))
            {
                //tim vec postoji
                return(new Tuple <bool, string>(false, "Tim već postoji!"));
            }
            else
            {
                OpstaSistemskaOperacija zapamtiTim = new ZapamtiTimSO();
                bool result = zapamtiTim.IzvrsiSO(tim);
                if (result)
                {
                    return(new Tuple <bool, string>(true, "Uspešno sačuvan tim."));
                }
                else
                {
                    return(new Tuple <bool, string>(false, "Sistem ne može da sačuva tim."));
                }
            }
        }