Example #1
0
 public RozvrhovaAkce(int id, Predmet predmet, TypyVyuky typVyuky, Vyucujici vyucujici, Mistnost mistnost, Dny den, int zacatek, int delka)
 {
     Id              = id;
     Predmet         = predmet;
     TypVyuky        = typVyuky;
     Vyucujici       = vyucujici;
     Den             = den;
     Mistnost        = mistnost;
     Zacatek         = zacatek;
     Delka           = delka;
     StudijniSkupiny = new Dictionary <int, StudijniSkupina>();
 }
Example #2
0
        private string GetMistnost(Dny den, int hodina)
        {
            Dictionary <Dny, Dictionary <int, Models.RozvrhovaAkce> > rozvrh = (Dictionary <Dny, Dictionary <int, Models.RozvrhovaAkce> >)Context["rozvrh"];

            if (Uzivatel.Role == Role.student)
            {
                // student
                string mistnost = rozvrh[den].ContainsKey(hodina) ? String.Format(" U{0}/{1}", rozvrh[den][hodina].Mistnost.Budova, rozvrh[den][hodina].Mistnost.Cislo) : "";
                return(mistnost);
            }
            else
            {
                // vyucujici
                string mistnost = rozvrh[den].ContainsKey(hodina) ? String.Format(" U{0}/{1}", rozvrh[den][hodina].Mistnost.Budova, rozvrh[den][hodina].Mistnost.Cislo) : "";
                return(mistnost);
            }
        }
Example #3
0
        private string GetPredmet(Dny den, int hodina)
        {
            Dictionary <Dny, Dictionary <int, Models.RozvrhovaAkce> > rozvrh = (Dictionary <Dny, Dictionary <int, Models.RozvrhovaAkce> >)Context["rozvrh"];

            if (Uzivatel.Role == Role.student)
            {
                // student
                string predmet = rozvrh[den].ContainsKey(hodina) ? "  " + rozvrh[den][hodina].Predmet.Zkratka : "";
                return(predmet);
            }
            else
            {
                // vyucujici
                string predmet = rozvrh[den].ContainsKey(hodina) ? "  " + rozvrh[den][hodina].Predmet.Zkratka : "";
                return(predmet);
            }
        }
Example #4
0
        /// <summary>
        /// Vytvoří rozvrhové akce a zaregistruje je u vyučujících a místností
        /// </summary>
        public override void LoadRozvrhoveAkce()
        {
            string CSVfile = (@".\csv\rozvrhove_akce.csv");

            using (StreamReader sr = new StreamReader(CSVfile, Encoding.UTF8))
            {
                string line;
                int    it = 1;
                while ((line = sr.ReadLine()) != null)
                {
                    if (it++ == 1)
                    {
                        continue;
                    }
                    // id; predmetId; typVyuky; vyucujiciId; mistnostId; den; zacatek; delka
                    string[]  explode       = line.Split(';');
                    int       id            = int.Parse(explode[0]);
                    int       idPredmetu    = int.Parse(explode[1]);
                    TypyVyuky typ           = (TypyVyuky)Enum.Parse(typeof(TypyVyuky), explode[2]);
                    int       idVyucujiciho = int.Parse(explode[3]);
                    int       idMistnosti   = int.Parse(explode[4]);
                    Dny       den           = (Dny)Enum.Parse(typeof(Dny), explode[5]);
                    int       zacatek       = int.Parse(explode[6]);
                    int       delka         = int.Parse(explode[7]);

                    RozvrhovaAkce ra = new RozvrhovaAkce(id, Predmety[idPredmetu], typ, Vyucujici[idVyucujiciho], Mistnosti[idMistnosti], den, zacatek, delka);
                    RozvrhoveAkce.Add(id, ra);
                    Predmety[ra.Predmet.Id].RozvrhoveAkce.Add(ra.Id, ra);
                    for (int i = 0; i < delka; i++)
                    {
                        Vyucujici[idVyucujiciho].Rozvrh[den].Add(zacatek + i, ra);
                        Mistnosti[idMistnosti].Rozvrh[den].Add(zacatek + i, ra);
                    }
                }
            }
        }
Example #5
0
        private string GetObsazenost(Models.Mistnost mistnost, Dny den, int hodina)
        {
            string obsazenost = mistnost.Rozvrh[den].ContainsKey(hodina) ? "  X" : "";

            return(obsazenost);
        }