Example #1
0
 private void noviAvansToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         frmAvans avans = new frmAvans();
         avans.ShowDialog();
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #2
0
        private void btnUrediSifru_Click(object sender, EventArgs e)
        {
            if (dgv.RowCount > 0)
            {
                int avans;
                int godina;

                try
                {
                    avans  = Convert.ToInt16(dgv.CurrentRow.Cells["Broj avansa"].Value.ToString());
                    godina = Convert.ToInt16(dgv.CurrentRow.Cells["Godina"].Value.ToString());
                }
                catch
                {
                    MessageBox.Show("Unesi numeričku vrijednost!");
                    return;
                }

                if (MainForm == null)
                {
                    frmAvans childForm = new frmAvans();
                    childForm.broj_avansa_edit = avans;
                    childForm.godina           = godina;
                    childForm.ShowDialog();
                    this.Close();
                }
                else
                {
                    MainForm.broj_avansa_edit = avans;
                    MainForm.godina           = godina;
                    MainForm.Show();
                    this.Close();
                }
            }
            else
            {
                MessageBox.Show("Niste odabrali niti jednu stavku.", "Greška");
            }
        }