Exemplo n.º 1
0
        public static ObservableCollection <Ucionica> ucitajUcionice()
        {
            ObservableCollection <Ucionica> ucionice = new ObservableCollection <Ucionica>();

            string[] lines = System.IO.File.ReadAllLines(@".\..\..\files\ucionice.txt");

            foreach (string ss in lines)
            {
                Ucionica u = new Ucionica();
                if (ss == "")
                {
                    return(ucionice);
                }

                string[] param = ss.Split('|');

                u.Id           = param[0];
                u.Opis         = param[1];
                u.brojMjesta   = Convert.ToInt32(param[2]);
                u.Projektor    = Convert.ToBoolean(param[3]);
                u.Tabla        = Convert.ToBoolean(param[4]);
                u.PametnaTabla = Convert.ToBoolean(param[5]);
                u.InstaliranOS = (OS)Convert.ToInt32(param[6]);
                string[]       id_softvera = param[7].Split(',');
                List <Softver> softveri    = SoftverPage.getInstance().Softveri.ToList();
                foreach (string s_id in id_softvera)
                {
                    Softver found = softveri.Find(i => i.Id.Equals(s_id));
                    u.instaliraniSoftver.Add(found);
                }
                ucionice.Add(u);
            }

            return(ucionice);
        }
 public ModelovanRaspored(Ucionica u)
 {
     Rasporedi = new List <List <Predmet> >();
     for (int i = 0; i < 36; i++)
     {
         List <Predmet> novi_red = new List <Predmet>();
         for (int j = 0; j < 7; j++)
         {
             Predmet p = new Predmet();
             novi_red.Add(p);
         }
         Rasporedi.Add(novi_red);
     }
     _ucionica = u;
 }
 public ModelovanRaspored(Ucionica ucionica, List <List <Predmet> > raspored)
 {
     _ucionica = ucionica;
     Rasporedi = raspored;
 }