Пример #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();
            }
        }
Пример #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();
                }
            }
        }
        private void SynchronizeButton_Click(object sender, EventArgs e)
        {
            // Call the synchronize method to synchronize
            // data between local and remote databases.
            //<snippetOCS_CS_ExtendDesigner_Form_AddHandlers>
            NorthwindCacheSyncAgent syncAgent = new NorthwindCacheSyncAgent();

            NorthwindCacheClientSyncProvider clientSyncProvider =
                (NorthwindCacheClientSyncProvider)syncAgent.LocalProvider;

            clientSyncProvider.AddHandlers();

            Microsoft.Synchronization.Data.SyncStatistics syncStats =
                syncAgent.Synchronize();
            //</snippetOCS_CS_ExtendDesigner_Form_AddHandlers>

            // After synchronizing the data, refill the
            // table in the dataset.
            this.customersTableAdapter.Fill(this.northwindDataSet.Customers);

            //<snippetOCS_CS_ExtendDesigner_Form_MessageBoxShow>
            MessageBox.Show("Changes downloaded: " +
                            syncStats.TotalChangesDownloaded.ToString() +
                            Environment.NewLine +
                            "Changes uploaded: " + syncStats.TotalChangesUploaded.ToString());
            //</snippetOCS_CS_ExtendDesigner_Form_MessageBoxShow>
        }
Пример #4
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);
            }
        }
Пример #5
0
        void sync()
        {
            Cursor.Current = Cursors.WaitCursor;
            Entretien.Client.WebReference.EntretienSyncService     svcProxy  = new Entretien.Client.WebReference.EntretienSyncService();
            Microsoft.Synchronization.Data.ServerSyncProviderProxy syncProxy =
                new Microsoft.Synchronization.Data.ServerSyncProviderProxy(svcProxy);



            // Call SyncAgent.Synchronize() to initiate the synchronization process.
            // Synchronization only updates the local database, not your project's data source.
            EntretienSyncAgent syncAgent = new EntretienSyncAgent();

            syncAgent.RemoteProvider = syncProxy;


            Microsoft.Synchronization.Data.SyncStatistics syncStats = syncAgent.Synchronize();

            // TODO: Reload your project data source from the local database (for example, call the TableAdapter.Fill method).



            clientTableAdapter.Fill(entretienlDataSet.Client);

            // Show synchronization statistics
            MessageBox.Show("Changes downloaded: " + syncStats.TotalChangesDownloaded.ToString()
                            + "\r\nChanges Uploaded: " + syncStats.TotalChangesUploaded.ToString());

            Cursor.Current = Cursors.Default;
        }
Пример #6
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();
        }
Пример #7
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();
        }
Пример #8
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();
        }
Пример #9
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();
        }
Пример #10
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();
        }
Пример #11
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();

            }
        }
Пример #12
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();
     }
 }
Пример #13
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();
            }
        }
Пример #14
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();
            }
        }