Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Debug.Assert(Owner != null, nameof(Owner) + " != null");
            nar main = Owner as nar;

            if (main != null)
            {
                DataRow nRow = main.autoDataSet2.Tables[0].NewRow();

                nRow[0] = tbs.Text;
                nRow[1] = tbnn.Text;
                nRow[2] = tbmin.Text;
                nRow[3] = tbmax.Text;
                nRow[4] = tbspeedmin.Text;
                nRow[5] = tbspeedmax.Text;
                nRow[6] = tbfixcamera;


                main.autoDataSet2.Tables[0].Rows.Add(nRow);
                main.narTableAdapter.Update(main.autoDataSet2.nar);
                main.autoDataSet2.Tables[0].AcceptChanges();
                main.dataGridView1.Refresh();
                tbs.Text         = "";
                tbnn.Text        = "";
                tbmin.Text       = "";
                tbmax.Text       = "";
                tbspeedmin.Text  = "";
                tbspeedmax.Text  = "";
                tbfixcamera.Text = "";
            }
        }
Ejemplo n.º 2
0
        private void нарушенияToolStripMenuItem_Click(object sender, EventArgs e)
        {
            nar newForm = new nar();

            newForm.Owner = this;
            newForm.Show();
        }
Ejemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            nar main = this.Owner as nar;

            if (main != null)
            {
                for (int i = 0; i < main.dataGridView1.RowCount; i++)
                {
                    main.dataGridView1.Rows[1].Selected = false;
                    for (int j = 0; j < main.dataGridView1.ColumnCount; j++)
                    {
                        if (main.dataGridView1.Rows[i].Cells[j].Value != null)
                        {
                            if (main.dataGridView1.Rows[i].Cells[j].Value.ToString().Contains(tbstr.Text))
                            {
                                main.dataGridView1.Rows[i].Selected = true;
                                break;
                            }
                        }
                    }
                }
            }
        }