Exemplo n.º 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            int nomStr = dataGridView1.CurrentCell.RowIndex;

            if (textBox1.Text == "")
            {
                MessageBox.Show("Ввидите вопрос!");
            }
            else
            {
                Form1         f1 = new Form1();
                SqlConnection sc = new SqlConnection(f1.connect);
                SqlCommand    cmd;
                sc.Open();

                cmd = new SqlCommand("UPDATE Soderzhanie SET dopolnit = " + "'" + textBox1.Text + "'" + " Where kod_ek  = " + Dannie.KodEk + " AND kod_r = " + Convert.ToInt32(dataGridView1.Rows[nomStr].Cells[0].Value.ToString()), sc);

                cmd.ExecuteNonQuery();
                sc.Close();
                //Синхронизация с базой -------------------------------------------------
                LocalDataCache1SyncAgent syncAgent = new LocalDataCache1SyncAgent();
                Microsoft.Synchronization.Data.SyncStatistics syncStats = syncAgent.Synchronize();
                //-----------------------------------------------------------------------
                up();
            }
        }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "" || textBox2.Text == "")
            {
                MessageBox.Show("Заполните поля!");
            }
            else
            {
                int prcV  = Convert.ToInt32(dataGridView1.Rows[0].Cells[0].Value.ToString());
                int prcDV = Convert.ToInt32(dataGridView1.Rows[0].Cells[1].Value.ToString());
                if ((prcV + prcDV) > 100)
                {
                    MessageBox.Show("Сумма процентов должна быть не более 100!");
                }
                else
                {
                    Form1         f1 = new Form1();
                    SqlConnection sc = new SqlConnection(f1.connect);
                    SqlCommand    cmd;
                    sc.Open();

                    cmd = new SqlCommand("UPDATE Nastrojki SET kol_vop = " + Convert.ToInt32(textBox1.Text) + ", kol_dop = " + Convert.ToInt32(textBox2.Text), sc);

                    cmd.ExecuteNonQuery();
                    sc.Close();
                    //Синхронизация с базой -------------------------------------------------
                    LocalDataCache1SyncAgent syncAgent = new LocalDataCache1SyncAgent();
                    Microsoft.Synchronization.Data.SyncStatistics syncStats = syncAgent.Synchronize();
                    //-----------------------------------------------------------------------
                    this.Close();
                }
            }
        }
Exemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox2.BackColor == SystemColors.Window)
            {
                int nomStr = dataGridView1.CurrentCell.RowIndex;
                if (textBox2.Text == "")
                {
                    MessageBox.Show("Ввидите вопрос!");
                }
                else
                {
                    Form1         f1 = new Form1();
                    SqlConnection sc = new SqlConnection(f1.connect);
                    SqlCommand    cmd;
                    sc.Open();

                    cmd = new SqlCommand("UPDATE Soderzhanie SET ocenka = " + "'" + textBox2.Text + "'" + " Where kod_ek  = " + Dannie.KodEk + " AND kod_r = " + Convert.ToInt32(dataGridView1.Rows[nomStr].Cells[0].Value.ToString()), sc);

                    cmd.ExecuteNonQuery();
                    sc.Close();
                    //Синхронизация с базой -------------------------------------------------
                    LocalDataCache1SyncAgent syncAgent = new LocalDataCache1SyncAgent();
                    Microsoft.Synchronization.Data.SyncStatistics syncStats = syncAgent.Synchronize();
                    //-----------------------------------------------------------------------
                    up();
                }
            }
            else
            {
                MessageBox.Show("Некорректный ввод оценки", "Ошибка ввода", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 4
0
        private void dobEk()
        {
            Form1         formGlavn = new Form1();
            SqlConnection sc        = new SqlConnection(formGlavn.connect);
            SqlCommand    cmd;

            sc.Open();
            cmd = new SqlCommand("INSERT INTO Ekzamen(data) VALUES ('" + dateTimePicker1.Value.Date + "'" + " )", sc);
            cmd.ExecuteNonQuery();
            sc.Close();
            //Синхронизация с базой -------------------------------------------------
            LocalDataCache1SyncAgent syncAgent = new LocalDataCache1SyncAgent();

            Microsoft.Synchronization.Data.SyncStatistics syncStats = syncAgent.Synchronize();
            //-----------------------------------------------------------------------
            this.Close();
        }
Exemplo n.º 5
0
        private void dobKomis()
        {
            int           nomStr    = dataGridView1.CurrentCell.RowIndex;
            Form1         formGlavn = new Form1();
            SqlConnection sc        = new SqlConnection(formGlavn.connect);
            SqlCommand    cmd;

            sc.Open();
            cmd = new SqlCommand("INSERT INTO Komissiya(kod_ek, kod_k) VALUES (" + Dannie.KodEk + ", " + Convert.ToInt32(dataGridView1.Rows[nomStr].Cells[0].Value.ToString()) + " )", sc);
            cmd.ExecuteNonQuery();
            sc.Close();
            //Синхронизация с базой -------------------------------------------------
            LocalDataCache1SyncAgent syncAgent = new LocalDataCache1SyncAgent();

            Microsoft.Synchronization.Data.SyncStatistics syncStats = syncAgent.Synchronize();
            //-----------------------------------------------------------------------
            ChliniEk();
        }
Exemplo n.º 6
0
        private void button8_Click(object sender, EventArgs e)
        {
            Form1         f1 = new Form1();
            SqlConnection sc = new SqlConnection(f1.connect);
            SqlCommand    cmd;

            sc.Open();

            cmd = new SqlCommand("UPDATE Soderzhanie SET balli = " + itog + " Where kod_r=" + Dannie.KodRabot + " AND kod_ek = " + Dannie.KodEk, sc);

            cmd.ExecuteNonQuery();
            sc.Close();
            //Синхронизация с базой -------------------------------------------------
            LocalDataCache1SyncAgent syncAgent = new LocalDataCache1SyncAgent();

            Microsoft.Synchronization.Data.SyncStatistics syncStats = syncAgent.Synchronize();
            //-----------------------------------------------------------------------
            this.Close();
        }
Exemplo n.º 7
0
        private void button2_Click(object sender, EventArgs e)
        {
            int           nomStr = dataGridView1.CurrentCell.RowIndex;
            Form1         f1     = new Form1();
            SqlConnection sc     = new SqlConnection(f1.connect);
            SqlCommand    cmd;

            sc.Open();

            cmd = new SqlCommand("UPDATE Voprosi SET ek = 'False' Where kod_vop  = " + Convert.ToInt32(dataGridView2.Rows[nomStr].Cells[0].Value.ToString()), sc);

            cmd.ExecuteNonQuery();
            sc.Close();
            //Синхронизация с базой -------------------------------------------------
            LocalDataCache1SyncAgent syncAgent = new LocalDataCache1SyncAgent();

            Microsoft.Synchronization.Data.SyncStatistics syncStats = syncAgent.Synchronize();
            //-----------------------------------------------------------------------
            EkzVop();
        }
Exemplo n.º 8
0
        private void button2_Click(object sender, EventArgs e)
        {
            int    s = dataGridView1.CurrentCell.RowIndex;
            string d = dataGridView1.Rows[s].Cells[0].Value.ToString();

            Form1         f1 = new Form1();
            SqlConnection sc = new SqlConnection(f1.connect);
            SqlCommand    cmd;

            sc.Open();
            cmd = new SqlCommand("UPDATE Rabotni SET otmetka='false' Where kod_r=" + d, sc);
            cmd.ExecuteNonQuery();
            sc.Close();
            //Синхронизация с базой -------------------------------------------------
            LocalDataCache1SyncAgent syncAgent = new LocalDataCache1SyncAgent();

            Microsoft.Synchronization.Data.SyncStatistics syncStats = syncAgent.Synchronize();
            //-----------------------------------------------------------------------
            up();
        }
Exemplo n.º 9
0
        private void dobVop()
        {

            if (textBox1.Text == "") MessageBox.Show("Заполните поле!");
            else
            {
                Form1 formGlavn = new Form1();
                SqlConnection sc = new SqlConnection(formGlavn.connect);
                SqlCommand cmd;
                sc.Open();
                cmd = new SqlCommand("INSERT INTO Voprosi(vopros, kod_p) VALUES ('" + textBox1.Text + "', " + Dannie.KodV + " )", sc);
                cmd.ExecuteNonQuery();
                sc.Close();
                //Синхронизация с базой -------------------------------------------------
                LocalDataCache1SyncAgent syncAgent = new LocalDataCache1SyncAgent();
                Microsoft.Synchronization.Data.SyncStatistics syncStats = syncAgent.Synchronize();
                //-----------------------------------------------------------------------
                this.Close();

            }
        }
Exemplo n.º 10
0
 public void dobRabotni()
 {
     if (textBox1.Text == "" || textBox2.Text == "" || comboBox1.Text == "" || comboBox2.Text == "" || comboBox3.Text == "" || textBox4.Text == "" || textBox5.Text == "")
     {
         MessageBox.Show("Заполните все поле!");
     }
     else
     {
         Form1         formGlavn = new Form1();
         SqlConnection sc        = new SqlConnection(formGlavn.connect);
         SqlCommand    cmd;
         sc.Open();
         cmd = new SqlCommand("INSERT INTO Rabotni(fio, nom_ud, otm_o_sdch, kod_dolzh, kod_kv, kod_vd, email, otmetka, Password1) VALUES ('" + textBox1.Text + "', '" + textBox2.Text + "', '" + textBox3.Text + "', '" + comboBox3.SelectedValue + "', '" + comboBox1.SelectedValue + "', '" + comboBox2.SelectedValue + "', '" + textBox4.Text + "', 'False', '" + textBox5.Text + "' )", sc);
         cmd.ExecuteNonQuery();
         sc.Close();
         //Синхронизация с базой -------------------------------------------------
         LocalDataCache1SyncAgent syncAgent = new LocalDataCache1SyncAgent();
         Microsoft.Synchronization.Data.SyncStatistics syncStats = syncAgent.Synchronize();
         //-----------------------------------------------------------------------
         this.Close();
     }
 }
Exemplo n.º 11
0
        private void redPril()
        {
            if (textBox1.Text == "")
            {
                MessageBox.Show("Заполните поле!");
            }
            else
            {
                Form1         f1 = new Form1();
                SqlConnection sc = new SqlConnection(f1.connect);
                SqlCommand    cmd;
                sc.Open();

                cmd = new SqlCommand("UPDATE Prilozheniya SET prilozh = " + "'" + textBox1.Text + "'" + " Where kod_pr=" + "'" + Dannie.KodPrilog + "'", sc);

                cmd.ExecuteNonQuery();
                sc.Close();
                //Синхронизация с базой -------------------------------------------------
                LocalDataCache1SyncAgent syncAgent = new LocalDataCache1SyncAgent();
                Microsoft.Synchronization.Data.SyncStatistics syncStats = syncAgent.Synchronize();
                //-----------------------------------------------------------------------
                this.Close();
            }
        }
Exemplo n.º 12
0
        private void redDolzh()
        {
            if (textBox1.Text == "")
            {
                MessageBox.Show("Заполните поле!");
            }
            else
            {
                Form1         f1 = new Form1();
                SqlConnection sc = new SqlConnection(f1.connect);
                SqlCommand    cmd;
                sc.Open();

                cmd = new SqlCommand("UPDATE Rabotni SET fio=" + "'" + textBox1.Text + "', nom_ud='" + textBox2.Text + "', kod_dolzh ='" + comboBox3.SelectedValue + "', kod_kv ='" + comboBox1.SelectedValue + "', kod_vd ='" + comboBox2.SelectedValue + "', email ='" + textBox4.Text + "', Password1 ='" + textBox5.Text + "' Where kod_r=" + "'" + Dannie.KodR + "'", sc);

                cmd.ExecuteNonQuery();
                sc.Close();
                //Синхронизация с базой -------------------------------------------------
                LocalDataCache1SyncAgent syncAgent = new LocalDataCache1SyncAgent();
                Microsoft.Synchronization.Data.SyncStatistics syncStats = syncAgent.Synchronize();
                //-----------------------------------------------------------------------
                this.Close();
            }
        }