예제 #1
0
        private void dgvPoruke_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                var poruka = dgvPoruke.SelectedRows[0].DataBoundItem as StudentiPoruke;
                if (e.ColumnIndex == 3)
                {
                    if (MessageBox.Show("Da li ste sigurni da želite obrisati poruku?",
                                        "Upozorenje",
                                        MessageBoxButtons.YesNo,
                                        MessageBoxIcon.Warning) == DialogResult.Yes)
                    {
                        _db.StudentiPoruke.Remove(poruka);
                        _db.SaveChanges();
                    }
                }
                else
                {
                    frmNovaPorukaIB150051 frmNovaPorukaIB150051 = new frmNovaPorukaIB150051(_student, poruka);
                    frmNovaPorukaIB150051.ShowDialog();
                }

                UcitajPoruke();
            }
            catch (Exception ex)
            {
                MessageBox.Show($"{ex.Message}{Environment.NewLine}{ex.InnerException?.Message}");
            }
        }
예제 #2
0
        private void btnNovaPoruka_Click(object sender, EventArgs e)
        {
            frmNovaPorukaIB150051 frmNovaPorukaIB150051 = new frmNovaPorukaIB150051(_student);

            if (frmNovaPorukaIB150051.ShowDialog() == DialogResult.OK)
            {
                UcitajPoruke();
            }
        }