Пример #1
0
        private void btedytujautokary_Click(object sender, EventArgs e)
        {
            frmautokaryedycja edit = new frmautokaryedycja(bsautokar.Current as Autokar);

            edit.ShowDialog();
            db.SaveChanges();
            bsautokar.DataSource = db.Autokar.ToList();
        }
Пример #2
0
        private void btdodajautokary_Click(object sender, EventArgs e)
        {
            frmautokaryedycja add = new frmautokaryedycja(null);

            if (add.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                db.Autokar.Add(add.Bus);
                db.SaveChanges();
                bsautokar.DataSource = db.Autokar.ToList();
            }
        }