예제 #1
0
        public UcionicaForm(Ucionica ucionica)
        {
            this.ucionica = ucionica;
            InitializeComponent();
            foreach (UcionicaAssets aset in Enum.GetValues(typeof(UcionicaAssets)))
            {
                checkedListBox1.Items.Add(new ComboValue(aset), false);
            }
            checkedListBox1.ItemCheck += CheckedListBox1_ItemCheck;


            if (ucionica != null)
            {
                popuniPolja();
            }
            popuniSoftvere();
            KeyPreview = true;
            KeyDown   += (object sender, KeyEventArgs e) =>
            {
                if (e.KeyCode == Keys.F1)
                {
                    if (ucionica != null)
                    {
                        DataManger.goToHelp("izmenaUcionica");
                    }
                    else
                    {
                        DataManger.goToHelp("dodavanjeUcionica");
                    }
                }
            };
        }
예제 #2
0
 private void ActionExcuted(object sender, Action e)
 {
     if (e is CreateAction)
     {
         if (currentView == FormView.RACUNARSKI_CENTAR)
         {
             Ucionica u = e.getGUIObject() as Ucionica;
             if (u != null)
             {
                 UcionicaControl c = new UcionicaControl(u, mainPanel);
                 dodajUcionicu(c);
             }
         }
         else if (currentView == FormView.UCIONICA)
         {
             Smer s = e.getGUIObject() as Smer;
             if (s != null)
             {
                 dodajSmerControl(s, aktivnaUcionica);
             }
         }
     }
     else if (e is EditAction)
     {
         if (currentView == FormView.UCIONICA)
         {
             Ucionica u = e.getGUIObject() as Ucionica;
             if (u != null)
             {
                 if (u == aktivnaUcionica)
                 {
                     initUcionicaView(u);
                 }
             }
         }
     }
     foreach (ToolStripButton b in undoButtons)
     {
         b.Enabled = DataControllercs.UndoAvailable();
     }
     foreach (ToolStripButton b in redoButtons)
     {
         b.Enabled = DataControllercs.RedoAvailable();
     }
     foreach (ToolStripLabel l in statusLabels)
     {
         l.Text = e.ToString();
     }
 }
예제 #3
0
 private void buttonObrisi_Click(object sender, EventArgs e)
 {
     try
     {
         int             index       = dataGridView1.CurrentCell.RowIndex;
         DataGridViewRow selectedRow = dataGridView1.Rows[index];
         string          id          = selectedRow.Cells[0].Value.ToString();
         System.Diagnostics.Debug.WriteLine(id);
         Ucionica     ucionica = DataManger.GetUcionicaID(id);
         DeleteAction d        = new DeleteAction(ucionica);
         DataControllercs.addAction(d);
     }
     catch
     {
     }
 }
예제 #4
0
        private void buttonIzmeni_Click(object sender, EventArgs e)
        {
            try
            {
                int             index       = dataGridView1.CurrentCell.RowIndex;
                DataGridViewRow selectedRow = dataGridView1.Rows[index];
                string          id          = selectedRow.Cells[0].Value.ToString();
                System.Diagnostics.Debug.WriteLine(id);

                Ucionica     ucionica = DataManger.GetUcionicaID(id);
                UcionicaForm uf       = new UcionicaForm(ucionica);

                uf.ShowDialog();
                uf.Dispose();
            }
            catch
            {
            }

            //brisanje ovde
        }
예제 #5
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);
        }
예제 #6
0
 static public void removeUcionica(Ucionica ucionica)
 {
     ucionice.Remove(ucionica);
 }
예제 #7
0
 private static void addUcionica(Ucionica ucionica)
 {
     ucionice.Add(ucionica);
 }