예제 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                DB_functions fun = new DB_functions();
                DB_functions.Fields_Worker fields = new DB_functions.Fields_Worker();

                fields.f1 = txtFIO.Text;
                DateTime time = DateTime.Parse(dtpYearsold.Value.ToString("dd.MM.yyyy"));
                fields.f2 = time;
                fields.f3 = int.Parse(txtWorkYears.Text);
                fields.f4 = txtTel.Text;
                fields.f5 = cmbFamily.Text;
                fields.f6 = txtHobbies.Text;
                fields.f7 = chbVeter.Checked;
                fields.f8 = chbOne.Checked;
                fields.f9 = chbDisability.Checked;
                fields.f10 = chbManychildren.Checked;
                fields.f11 = chbCar.Checked;
                fields.f12 = txtOthers.Text;

                fun.Save(fields);

                dsTableAdapters.V_WTableAdapter taWV = new dsTableAdapters.V_WTableAdapter();
                taWV.Update(ds._V_W);

                this.Close();
            }
            catch (Exception E)
            {
                MessageBox.Show("Невозможно сохранить", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #2
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);
            }
        }
예제 #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                DB_functions fun = new DB_functions();
                DB_functions.Fields_Track fields = new DB_functions.Fields_Track();

                fields.f1 = txtDescription.Text;
                fields.f2 = txtStops.Text;
                fields.f3 = int.Parse(txtTime.Text);
                fields.f4 = chbCity.Checked;
                DateTime time = DateTime.Parse(dtpCreate.Value.ToString("dd.MM.yyyy"));
                fields.f5 = time;
                fields.f6 = false;

                fun.Save(fields);

                dsTableAdapters.TrackTableAdapter taT = new dsTableAdapters.TrackTableAdapter();
                taT.Update(ds.Track);

                this.Close();
            }
            catch (Exception E)
            {
                MessageBox.Show("Невозможно сохранить", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                DB_functions fun = new DB_functions();
                DB_functions.Fields_Vacation fields = new DB_functions.Fields_Vacation();

                fields.f1 = txtName.Text;
                fields.f2 = txtDescription.Text;
                fields.f3 = txtDescriptionFull.Text;
                fields.f4 = txtRequriments.Text;
                fields.f5 = int.Parse(txtMoney.Text);
                fields.f6 = chbOffice.Checked;

                fun.Save(fields);

                dsTableAdapters.VacationTableAdapter taV = new dsTableAdapters.VacationTableAdapter();
                taV.Update(ds.Vacation);

                this.Close();
            }
            catch (Exception E)
            {
                MessageBox.Show("Невозможно сохранить", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #5
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                DB_functions fun = new DB_functions();
                DB_functions.Fields_Bus fields = new DB_functions.Fields_Bus();
                DB_functions.Link_BusTrack bt = new DB_functions.Link_BusTrack();

                fields.f1 = txtNumber.Text;
                fields.f2 = cmbMark.Text;
                fields.f3 = cbTour.Checked;
                fields.f4 = cbNew.Checked;
                fields.f5 = int.Parse(txtSits.Text);

                fun.Save(fields);

                bt.f1 = int.Parse(ds.Bus.Rows[ds.Bus.Rows.Count - 1][0].ToString());
                bt.f2 = int.Parse(cmbTrack.SelectedValue.ToString());

                fun.Save(bt);

                dsTableAdapters.BusTableAdapter taB = new dsTableAdapters.BusTableAdapter();
                dsTableAdapters.B_TTableAdapter taBT = new dsTableAdapters.B_TTableAdapter();
                taB.Update(ds.Bus);
                taBT.Update(ds._B_T);

                this.Close();
            }
            catch (Exception E)
            {
                MessageBox.Show("Невозможно сохранить", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #6
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                DB_functions fun = new DB_functions();
                DB_functions.LinkVacantion lv = new DB_functions.LinkVacantion();

                lv.f1 = int.Parse(cmbWorker.SelectedValue.ToString());
                lv.f2 = int.Parse(cmbVacantions.SelectedValue.ToString());

                fun.Save(lv);

                dsTableAdapters.V_WTableAdapter taWV = new dsTableAdapters.V_WTableAdapter();
                taWV.Update(ds._V_W);

                this.Close();
            }
            catch (Exception E)
            {
                MessageBox.Show("Невозможно сохранить", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #7
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);
            }
        }