예제 #1
0
        internal override void excuteAction()
        {
            o.Delete();
            DeleteAction deleteA;

            if (o is Smer)
            {
                Smer s = o as Smer;
                termini = DataManger.getTerminsBySmer(s);
            }
            else if (o is Predmet)
            {
                Predmet p = o as Predmet;
                termini = DataManger.getTerminsByPredmet(p);
            }
            foreach (Termin t in termini)
            {
                deleteA = new DeleteAction(t);
                deleteA.excuteAction();
            }
            base.excuteAction();
        }
예제 #2
0
        public TerminForm(Nedelja nedelja, Predmet predmet, DateTime dan, Termin termin)
        {
            this.termin  = termin;
            this.predmet = predmet;
            this.nedelja = nedelja;
            InitializeComponent();
            InicijalizacijaCasovaUnos();
            InicijalizacijaUnosVremena();

            DateTime ponedeljak = (nedelja == null) ? dan : nedelja.Ponedeljak;

            dateTimePicker1.MinDate = new DateTime(ponedeljak.Year, ponedeljak.Month, dan.Day, 7, 0, 0);
            dateTimePicker1.MaxDate = new DateTime(ponedeljak.Year, ponedeljak.Month, dan.Day, 22, 0, 0);
            KeyPreview = true;
            KeyDown   += (object sender, KeyEventArgs e) =>
            {
                if (e.KeyCode == Keys.F1)
                {
                    DataManger.goToHelp("termin");
                }
            };
        }
예제 #3
0
 private static void addPredmet(Predmet predmet)
 {
     predmet.SmerPredmeta.Predmeti.Add(predmet);
     predmet.SmerPredmeta.OnValueChanged(null);
 }
예제 #4
0
 private static void removePredmet(Predmet predmet)
 {
     predmet.SmerPredmeta.Predmeti.Remove(predmet);
     predmet.SmerPredmeta.OnValueChanged(null);
 }
예제 #5
0
파일: PredmetForm.cs 프로젝트: filipxa/HCI2
        public PredmetForm(Predmet predmet, Smer smer)
        {
            this.smer    = smer;
            this.predmet = predmet;
            InitializeComponent();
            comboBoxSmer.SelectedValueChanged += ComboBoxSmer_SelectedIndexChanged;
            checkedListBox1.ItemCheck         += CheckedListBox1_ItemCheck;

            if (predmet != null)
            {
                popuniPolja();
                textBoxID.Enabled = false;

                comboBoxSmer.Text    = predmet.SmerPredmeta.ToString();
                comboBoxSmer.Enabled = false;
                rezimRada            = Rezim.Izmena;
            }
            else
            {
                if (smer == null)
                {
                    rezimRada = Rezim.Dodavanje;
                    foreach (Smer s in DataManger.getSmers())
                    {
                        comboBoxSmer.Items.Add(s);
                    }
                    if (comboBoxSmer.Items.Count == 0)
                    {
                        comboBoxSmer.Enabled = false;
                    }
                    else
                    {
                        comboBoxSmer.SelectedIndex = 0;
                    }
                }
                else
                {
                    rezimRada = Rezim.DodavanjeNovomSmeru;
                    comboBoxSmer.Items.Add(smer);
                    comboBoxSmer.SelectedIndex = 0;
                    comboBoxSmer.Enabled       = false;
                }
            }
            popuniOpremaBox();



            KeyPreview = true;
            KeyDown   += (object sender, KeyEventArgs e) =>
            {
                if (e.KeyCode == Keys.F1)
                {
                    if (rezimRada == Rezim.Dodavanje || rezimRada == Rezim.DodavanjeNovomSmeru)
                    {
                        DataManger.goToHelp("dodavanjePredmet");
                    }
                    else
                    {
                        DataManger.goToHelp("izmenaPredmet");
                    }
                }
            };
            popuniSoftvere();
        }