Exemple #1
0
        private void Button1_Click(object sender, EventArgs e)
        {
            InsertOrEdit = "Добавить";
            AddingAndEditingAvailabilityOfAutoParts f = new AddingAndEditingAvailabilityOfAutoParts();

            f.Owner = this;
            f.ShowDialog();
        }
Exemple #2
0
 private void Button2_Click(object sender, EventArgs e)
 {
     if (dataGridView1.CurrentRow != null)
     {
         InsertOrEdit    = "Редактировать";
         ID_availability = Convert.ToInt32(dataGridView1[0, dataGridView1.CurrentRow.Index].Value);
         ID_department   = Convert.ToInt32(dataGridView1[1, dataGridView1.CurrentRow.Index].Value);
         Title_auto_part = dataGridView1[2, dataGridView1.CurrentRow.Index].Value.ToString();
         Manufacturer    = dataGridView1[3, dataGridView1.CurrentRow.Index].Value.ToString();
         Article         = dataGridView1[4, dataGridView1.CurrentRow.Index].Value.ToString();
         Sale_price      = dataGridView1[5, dataGridView1.CurrentRow.Index].Value.ToString();
         Amount          = Convert.ToInt32(dataGridView1[6, dataGridView1.CurrentRow.Index].Value);
         AddingAndEditingAvailabilityOfAutoParts f = new AddingAndEditingAvailabilityOfAutoParts();
         f.Owner = this;
         f.ShowDialog();
     }
     else
     {
         MessageBox.Show("Не выбрана автозапчасть в магазине для редактирования.", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }