示例#1
0
 private void popunjavanjeTabele()
 {
     foreach (Software p in DataManger.getSoftware())
     {
         string[] row = { p.ID, p.Ime, p.Proizvodjac, p.URL, p.Godina, Convert.ToString(p.Cena), p.Opis };
         dataGridView1.Rows.Add(row);
     }
 }
示例#2
0
        private void buttonSacuvaj_Click(object sender, EventArgs e)
        {
            int    rb     = 1;
            string poruka = "";

            if (software == null)
            {
                foreach (Software s in DataManger.getSoftware())
                {
                    if (s.ID.Equals(textBoxID.Text))
                    {
                        poruka += "#" + rb + ": Sofver sa id-em " + textBoxID.Text + " vec postoji..\n";
                        rb++;
                        break;
                    }
                }
            }
            if (textBoxID.Text.Length == 0)
            {
                poruka += "#" + rb + ": Morate uneti ID softvera.\n";
                rb++;
            }
            if (textBoxIme.Text.Length == 0)
            {
                labelIme.ForeColor = Color.Red;
                poruka            += "#" + rb + ": Morate uneti naziv softvera.\n";
                rb++;
            }
            if (!checkBox1.Checked && !checkBox2.Checked)
            {
                labelOS.ForeColor = Color.Red;
                poruka           += "#" + rb + ": Morate odabrati bar jedan operativni sistem.";
                rb++;
            }

            if (poruka.Length > 0)
            {
                DialogResult = DialogResult.None;
                MessageBox.Show(poruka, "Upozorenje", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
                return;
            }

            GetAction();
        }