Example #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                DB_functions fun = new DB_functions();
                DB_functions.Fields_Service fields = new DB_functions.Fields_Service();

                fields.f0 = int.Parse(cmbBus.SelectedValue.ToString());
                fields.f1 = txtDescription.Text;
                fields.f2 = cmbWhells.Checked;
                fields.f3 = cmbControl.Checked;
                fields.f4 = cmbStop.Checked;
                fields.f5 = cmbMotor.Checked;
                fields.f6 = cmbExterier.Checked;
                fields.f7 = cmbInterier.Checked;
                fields.f8 = cmbRust.Checked;
                fields.f9 = int.Parse(txtSpeed.Text);
                DateTime time = DateTime.Parse(dtpCreate.Value.ToString("dd.MM.yyyy"));
                fields.f10 = time;
                fields.f11 = false;

                fun.Save(fields);

                dsTableAdapters.ServiceTableAdapter taS = new dsTableAdapters.ServiceTableAdapter();
                taS.Update(ds.Service);

                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.ServiceTableAdapter ta = new dsTableAdapters.ServiceTableAdapter();
            ta.Fill(ds.Service);
            frm.dgvAdmin.DataSource = ds.Service;
            frm.dgvAdmin.Update();
            frm.ShowDialog();

            ta.Update(ds.Service);
        }