Example #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                DB_functions fun = new DB_functions();
                DB_functions.LinkDrtiverBus driver = new DB_functions.LinkDrtiverBus();

                driver.f1 = int.Parse(cmbDriver.SelectedValue.ToString());
                driver.f2 = int.Parse(cmbBus.SelectedValue.ToString());

                fun.Save(driver);

                dsTableAdapters.B_WTableAdapter taWV = new dsTableAdapters.B_WTableAdapter();
                taWV.Update(ds._B_W);

                this.Close();
            }
            catch (Exception E)
            {
                MessageBox.Show("Невозможно сохранить", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #2
0
        private void работникиАвтобусыToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmAdmin frm = new frmAdmin();
            dsTableAdapters.B_WTableAdapter ta = new dsTableAdapters.B_WTableAdapter();
            ta.Fill(ds._B_W);
            frm.dgvAdmin.DataSource = ds._B_W;
            frm.dgvAdmin.Update();
            frm.ShowDialog();

            ta.Update(ds._B_W);
        }