Exemplo n.º 1
0
        private void Add_button_Click(object sender, EventArgs e)
        {
            ReloadCarriers();
            AddEditCarrierForm AddCarrier = new AddEditCarrierForm(dataSet.Carriers, dataSet.Categories, dataSet.CarriersStatuses,
                                                                   dataSet.Transmissions, null);

            AddCarrier.Text = "Добавление ТС";
            this.Enabled    = false;
            AddCarrier.ShowDialog();
            if (AddCarrier.DialogResult == DialogResult.OK)
            {
                dataSet = BusinessLogic.WriteCarriers(dataSet);
                ReloadCarriers();
            }
            this.Enabled = true;
        }
Exemplo n.º 2
0
        private void Edit_button_Click(object sender, EventArgs e)
        {
            LastSelectionIndex = Carriers_dataGridView.SelectedRows[0].Index;
            ReloadCarriers();
            AddEditCarrierForm EditCarrier = new AddEditCarrierForm(dataSet.Carriers, dataSet.Categories, dataSet.CarriersStatuses,
                                                                    dataSet.Transmissions, dataSet.Carriers.Rows.Find(Carriers_dataGridView.SelectedRows[0].Cells["ID"].Value));

            EditCarrier.Text = "Редактирование ТС";
            this.Enabled     = false;
            EditCarrier.ShowDialog();
            if (EditCarrier.DialogResult == DialogResult.OK)
            {
                dataSet = BusinessLogic.WriteCarriers(dataSet);
                ReloadCarriers();
            }
            this.Enabled = true;
        }