Пример #1
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            try
            {
                AddForm add = new AddForm();
                add.ShowDialog();

                if (add.DialogResult == DialogResult.OK && add.Change() == 1)
                {
                    StudentdataGridView.Rows.Add(add.FullName(), add.Group(), add.Gpa(), student.Stat(Convert.ToDouble(add.Gpa())));
                    student.StateColored(StudentdataGridView);
                }

                else if (add.DialogResult == DialogResult.OK && add.Change() == 2)
                {
                    TeacherdataGridView.Rows.Add(add.FullName(), add.Major());
                }

                RefreshCB();
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }


        } // Добавление
Пример #2
0
        void btnAdd_Click(object sender, EventArgs e)
        {
            var createForm = new AddForm();

            createForm.ShowDialog();
            this.LoadAllBook();
        }
Пример #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            var f = new AddForm();

            if (f.ShowDialog() == DialogResult.OK)
            {
                var car = f.car;
                dt.Rows.Add(car.Make, car.Model, car.Type, car.Year.ToString(), car.Plate, car.Speed.ToString());
                setFilter();
            }
        }
Пример #4
0
 private void button3_Click_1(object sender, EventArgs e)
 {
     if (listView1.SelectedItems.Count == 1)
     {
         int     index = listView1.SelectedItems[0].Index;
         DataRow row   = dt.Rows[index];
         Car     c     = new Car(row[0].ToString(), row[1].ToString(), row[2].ToString(), Convert.ToInt32(row[3]), row[4].ToString(), Convert.ToInt32(row[5]));
         var     f     = new AddForm(c);
         if (f.ShowDialog() == DialogResult.OK)
         {
             var car = f.car;
             row[0] = car.Make;
             row[1] = car.Model;
             row[2] = car.Type;
             row[3] = car.Year;
             row[4] = car.Plate;
             row[5] = car.Speed;
             setFilter();
         }
     }
 }