Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            DateTime krajTermina = dateTimePicker1.Value.AddMinutes(45 * (int)numericUpDown1.Value);

            if (termin.Nedelja.isSlobodan(dateTimePicker1.Value, krajTermina, termin))
            {
                Action action;
                action = new EditAction(termin);
                termin.PocetakTermina = dateTimePicker1.Value;
                termin.KrajTermina    = krajTermina;
                termin.DuzinaTermina  = (int)numericUpDown1.Value;

                DataControllercs.addAction(action);
            }
            else
            {
                DialogResult = DialogResult.None;
                MessageBox.Show("Izabrano vreme je zauzeto", "Upozorenje", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
                return;
            }
        }
Beispiel #4
0
        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);
        }