Exemplo n.º 1
0
        private void timer3_Tick(object sender, EventArgs e)
        {
            try
            {
                // TODO: данная строка кода позволяет загрузить данные в таблицу "cAVA_DATADataSet.Update". При необходимости она может быть перемещена или удалена.
                CAVATableAdapter.Update(ref this.updateTableAdapter, ref this.cAVADataSet, "Fill");
                if (updateDataGridView.Rows[0].Cells[1].Value.ToString() == "1")
                {
                    timer3.Stop();
                    string name = System.IO.Path.GetFileName(updateDataGridView.Rows[0].Cells[2].Value.ToString());
                    System.IO.File.Copy(updateDataGridView.Rows[0].Cells[2].Value.ToString(), Application.StartupPath + @"\" + name);
                    Properties.Settings.Default.DelUpdate = Application.StartupPath + @"\" + name;
                    Properties.Settings.Default.Save();
                    Process.Start(Application.StartupPath + @"\" + name);
                    Application.Exit();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                timer3.Stop();
            }

            try
            {
                int c = computersDataGridView.CurrentRow.Index;
                // TODO: данная строка кода позволяет загрузить данные в таблицу "cAVADataSet.Computers". При необходимости она может быть перемещена или удалена.
                this.computersTableAdapter.Fill(this.cAVADataSet.Computers);
                if (computersDataGridView.RowCount == 0)
                {
                    FastCloing = true;
                    this.Close();
                }
                computersDataGridView.CurrentCell = computersDataGridView[0, c];
                if (G(computersStart) == "True" && Convert.ToInt32(G(computersTime)) == 0 && Convert.ToInt32(G(computersTest_Id)) != -1)
                {
                    Test.Test T = new Test.Test();
                    T.ComputerId = Convert.ToInt32(G(computersId));
                    T.TestRow    = Convert.ToInt32(G(computersTest_Id));
                    T.Show();
                    R(computersStart, false);
                    computersTableAdapter.Update(cAVADataSet.Computers);
                    this.Hide();
                }
                if (Convert.ToBoolean(G(computersConnected)) == false)
                {
                    timer3.Stop();
                    this.Close();
                }
            }
            catch (Exception ex)
            {
            }
        }
Exemplo n.º 2
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            if (accDataGridView.Rows[a].Cells[6].Value.ToString() == "")
            {
                accDataGridView.Rows[a].Cells[6].Value = 1;
            }
            else
            {
                accDataGridView.Rows[a].Cells[6].Value = Convert.ToInt32(accDataGridView.Rows[a].Cells[6].Value.ToString()) + 1;
            }
            try
            {
                teacherDataGridView.EndEdit();
                subBindingSource.EndEdit();
                clasBindingSource.EndEdit();
                pupilBindingSource.EndEdit();
                accBindingSource.EndEdit();

                CAVATableAdapter.Acc(ref accTableAdapter, ref cAVADataSet, "Update");
                CAVATableAdapter.Pupil(ref pupilTableAdapter, ref cAVADataSet, "Update");
                CAVATableAdapter.Clas(ref clasTableAdapter, ref cAVADataSet, "Update");
                CAVATableAdapter.Sub(ref subTableAdapter, ref cAVADataSet, "Update");
                CAVATableAdapter.Teacher(ref teacherTableAdapter, ref cAVADataSet, "Update");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            CAVA.Test.Test T = new Test.Test();
            T.t       = t;
            T.s       = s;
            T.c       = c;
            T.p       = p;
            T.a       = a;
            T.TestRow = TestRow;
            T.Show();
            a1 = false;
            this.Close();
        }