Example #1
0
        private void button4_Click(object sender, EventArgs e)
        {
            DBAccs db = new DBAccs();

            db.OpenConnection();
            if (db.Privilegije() == 1)
            {
                if (String.IsNullOrEmpty(Convert.ToString(textBox12.Text)))
                {
                    MessageBox.Show("Greska, unos je prazan!");
                }
                else
                {
                    db.Delete(Convert.ToInt32(textBox12.Text));

                    MessageBox.Show("Uspesno je obrisano!");

                    DataSet ds = new DataSet();


                    db.Adapter().Fill(ds);
                    dataGridView1.DataSource = ds.Tables[0].DefaultView;
                }
            }
            else
            {
                MessageBox.Show("Nemate dozvolu da menjate podatke!");
            }

            db.CloseConnection();
        }