예제 #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (comboBox1.SelectedIndex == 0)
            {
                MinZatrataMethod.FindSolution();
            }
            else
            {
                SeveroZapad.FindSolution();

                button2.Text = "Следующая итерация";
            }
        }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            //добавляем кнопочки и датагридвью
            button1.Visible  = false;
            button2.Visible  = true;
            button2.Location = new Point(200, dataGridView2.Height + dataGridView2.Location.Y + 15);
            //построим таблицу с опорным планом в datagridview2
            //dataGridView2.ColumnCount = dataGridView1.ColumnCount;
            //for (int i = 0; i < dataGridView2.ColumnCount - 1; i++)
            //{
            //    dataGridView2.Columns[i].Name = "Поставщик " + Convert.ToString(i + 1);
            //    dataGridView2.Columns[i].Width = 75;
            //}
            //dataGridView2.Columns[dataGridView1.ColumnCount - 1].Name = "Потребность";
            //dataGridView2.Columns[dataGridView1.ColumnCount - 1].Width = 73;

            //dataGridView2.RowCount = dataGridView1.RowCount;
            //for (int i = 0; i < dataGridView2.RowCount; i++)
            //{
            //    dataGridView2.Rows[i].HeaderCell.Value = "Потреб. " + Convert.ToString(i + 1);
            //    dataGridView2.Rows[i].Height = 30;
            //    dataGridView2.AutoResizeRowHeadersWidth(0, DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders);
            //}
            //dataGridView2.Rows[dataGridView1.RowCount - 1].HeaderCell.Value = "Наличие";


            if (comboBox1.SelectedIndex == 0)
            {
                MinZatrataMethod mzm = new MinZatrataMethod(dataGridView1, dataGridView2, label5);
                mzm.FormPlan();
            }
            else
            {
                SeveroZapad szm = new SeveroZapad(dataGridView1, dataGridView2, label5);
                szm.FormPlan();
            }
        }