public Action GetAction() { Action action; if (isCreate) { smer.ID = textBoxID.Text; smer.Ime = textBoxIme.Text; smer.DatumUvodjenja = Convert.ToDateTime(dateTimePicker1.Value); smer.Opis = richTextBoxOpis.Text; smer.Predmeti = listBoxPredmeti.Items.Cast <Predmet>().ToList(); action = new CreateAction(smer); } else { action = editAction; smer.ID = textBoxID.Text; smer.Ime = textBoxIme.Text; smer.DatumUvodjenja = Convert.ToDateTime(dateTimePicker1.Value); smer.Opis = richTextBoxOpis.Text; smer.Predmeti = listBoxPredmeti.Items.Cast <Predmet>().ToList(); } if (!actionAdded) { DataControllercs.addAction(action); } return(action); }
public Action GetAction() { Action action; if (predmet == null) { predmet = new Predmet(textBoxID.Text, textBoxNaziv.Text, smer, richTextBoxOpis.Text, Convert.ToInt32(numericUpDownBrojLjudi.Value), Convert.ToInt32(numericUpDownDuzinaTermina.Value), Convert.ToInt32(numericUpDownBrojTermina.Value)); predmet.Assets = getUcionicaAssets(); action = new CreateAction(predmet); } else { action = new EditAction(predmet); predmet.ID = textBoxID.Text; predmet.Ime = textBoxNaziv.Text; predmet.BrLjudi = Convert.ToInt32(numericUpDownBrojLjudi.Value); predmet.BrCasova = Convert.ToInt32(numericUpDownDuzinaTermina.Value); predmet.BrTermina = Convert.ToInt32(numericUpDownBrojTermina.Value); predmet.Opis = richTextBoxOpis.Text; predmet.Assets = getUcionicaAssets(); predmet.SmerPredmeta = smer; predmet.InstalledSoftware = getInstalledSoft(); } if (rezimRada == Rezim.Izmena || rezimRada == Rezim.Dodavanje) { DataControllercs.addAction(action); } return(action); }
public override Action GetReverseAction() { CreateAction a = new CreateAction(o); a.timeOfCreation = timeOfCreation; a.termini = termini; return(a); }
internal override void excuteAction() { DataManger.addObject(o); CreateAction cAction; foreach (Termin t in termini) { cAction = new CreateAction(t); cAction.excuteAction(); } base.excuteAction(); }
private Action GetAction() { Action action; if (software == null) { software = new Software(textBoxID.Text, textBoxIme.Text, textBoxProizvodjac.Text, textBoxURL.Text, textBoxGodina.Text, Convert.ToDouble(textBoxCena.Text), richTextBoxOpis.Text); if (checkBox1.Checked) { software.Assets.Add(UcionicaAssets.windows); } if (checkBox2.Checked) { software.Assets.Add(UcionicaAssets.linux); } action = new CreateAction(software); } else { action = new EditAction(software); software.ID = textBoxID.Text; software.Ime = textBoxIme.Text; software.Proizvodjac = textBoxProizvodjac.Text; software.URL = textBoxURL.Text; software.Godina = textBoxGodina.Text; software.Cena = Convert.ToDouble(textBoxCena.Text); software.Opis = richTextBoxOpis.Text; if (checkBox1.Checked) { software.Assets.Add(UcionicaAssets.windows); } if (checkBox2.Checked) { software.Assets.Add(UcionicaAssets.linux); } } DataControllercs.addAction(action); return(action); }
private Action GetAction() { Action action; if (ucionica == null) { ucionica = new Ucionica(textBoxID.Text, richTextBox1.Text, Convert.ToInt32(numericUpDown1.Value), getUcionicaAssets(), getInstalledSoft()); action = new CreateAction(ucionica); } else { action = new EditAction(ucionica); ucionica.ID = textBoxID.Text; ucionica.Opis = richTextBox1.Text; ucionica.BrRadnihMesta = Convert.ToInt32(numericUpDown1.Value); ucionica.Assets = getUcionicaAssets(); ucionica.InstalledSoftware = getInstalledSoft(); } DataControllercs.addAction(action); return(action); }