private void addbtn_Click(object sender, EventArgs e)
        {
            SqlConnection conn = new SqlConnection("Data Source=DESKTOP-OLL88JR\\SQLEXPRESS;Initial Catalog=ProjectA;Persist Security Info=True;User ID=sa;Password=12345678");

            conn.Open();
            String     cmd1          = "UPDATE GroupStudent SET Status = @status WHERE GroupStudent.StudentId = @sid";
            SqlCommand UpdateCommand = new SqlCommand(cmd1, conn);

            UpdateCommand.Parameters.Add(new SqlParameter("status", 4));
            UpdateCommand.Parameters.Add(new SqlParameter("sid", sid));
            count = UpdateCommand.ExecuteNonQuery();

            String     AddCMD     = "INSERT INTO GroupStudent (GroupId, StudentId, Status, AssignmentDate) VALUES (@gid, @sid, @status, @asgnDate)";
            SqlCommand AddCommand = new SqlCommand(AddCMD, conn);

            AddCommand.Parameters.Add(new SqlParameter("status", 3));
            AddCommand.Parameters.Add(new SqlParameter("sid", sid));
            AddCommand.Parameters.Add(new SqlParameter("gid", gid));
            AddCommand.Parameters.Add(new SqlParameter("asgnDate", DateTime.Today));

            count = AddCommand.ExecuteNonQuery();
            Form17 form = new Form17(gid);

            form.Show();
            this.Hide();
        }
Exemple #2
0
        private void addstbtn_Click(object sender, EventArgs e)
        {
            Form17 form = new Form17(ID);

            form.Show();
            this.Hide();
        }
Exemple #3
0
        private void button2_Click(object sender, EventArgs e)
        {
            Form17 f = new Form17();

            this.Hide();
            f.ShowDialog();
            Close();
        }
Exemple #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (Form14.d == 1)
            {
                if (radioButton3.Checked == true)
                {
                    Form8 form = new Form8();
                    form.Show();
                    this.Hide();
                }

                else if (radioButton2.Checked == true)
                {
                    Form12 form = new Form12();
                    form.Show();
                    this.Hide();
                }
                else if (radioButton1.Checked == true)
                {
                    Form13 form = new Form13();
                    form.Show();
                    this.Hide();
                }
            }
            else if (Form14.d == 2)
            {
                if (radioButton3.Checked == true)
                {
                    Form15 form = new Form15();
                    form.Show();
                    this.Hide();
                }

                else if (radioButton2.Checked == true)
                {
                    Form16 form = new Form16();
                    form.Show();
                    this.Hide();
                }
                else if (radioButton1.Checked == true)
                {
                    Form17 form = new Form17();
                    form.Show();
                    this.Hide();
                }
            }
        }
        private void button2_Click(object sender, EventArgs e)
        {
            string SqlText = "INSERT INTO [Pasagir] ([ID_Pasagir], [Surname],[Name],[NomerTelefony],[Pasport],[TicketsID],[ReysID]) VALUES (1,1, '01:01:2018','20:40',1,'21:50') ";
            Form17 f       = new Form17(); // створити екземпляр вікна

            if (f.ShowDialog() == DialogResult.OK)
            {
                // сформувати SQL-рядок
                SqlText = "INSERT INTO [Pasagir] ([ID_Pasagir], [Surname],[Name],[NomerTelefony],[Pasport],[TicketsID],[ReysID]) VALUES (";
                SqlText = SqlText + "\'" + f.textBox1.Text + "\', ";
                SqlText = SqlText + "\'" + f.textBox2.Text + "\', ";
                SqlText = SqlText + "\'" + f.textBox3.Text + "\')";
                SqlText = SqlText + "\'" + f.textBox4.Text + "\')";
                SqlText = SqlText + "\'" + f.textBox5.Text + "\')";
                SqlText = SqlText + "\'" + f.textBox6.Text + "\')";


                // виконати SQL-команду
                MyExecuteNonQuery(SqlText);
                // відобразати таблицю Source
                Pasagir();
            }
        }
Exemple #6
0
        private void 居民ToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            Form17 fm = new Form17("390");

            fm.ShowDialog();
        }
Exemple #7
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (sexual.SelectedIndex == 0 && st.SelectedIndex == 0)
     {
         Form2 form2 = new Form2();
         this.Hide();
         form2.Show();
     }
     if (sexual.SelectedIndex == 0 && st.SelectedIndex == 1)
     {
         Form3 form3 = new Form3();
         this.Hide();
         form3.Show();
     }
     if (sexual.SelectedIndex == 0 && st.SelectedIndex == 2)
     {
         Form4 form4 = new Form4();
         this.Hide();
         form4.Show();
     }
     if (sexual.SelectedIndex == 0 && st.SelectedIndex == 3)
     {
         Form5 form5 = new Form5();
         this.Hide();
         form5.Show();
     }
     if (sexual.SelectedIndex == 0 && st.SelectedIndex == 4)
     {
         Form6 form6 = new Form6();
         this.Hide();
         form6.Show();
     }
     if (sexual.SelectedIndex == 0 && st.SelectedIndex == 5)
     {
         Form7 form7 = new Form7();
         this.Hide();
         form7.Show();
     }
     if (sexual.SelectedIndex == 0 && st.SelectedIndex == 6)
     {
         Form8 form8 = new Form8();
         this.Hide();
         form8.Show();
     }
     if (sexual.SelectedIndex == 0 && st.SelectedIndex == 7)
     {
         Form9 form9 = new Form9();
         this.Hide();
         form9.Show();
     }
     if (sexual.SelectedIndex == 0 && st.SelectedIndex == 8)
     {
         Form10 form10 = new Form10();
         this.Hide();
         form10.Show();
     }
     if (sexual.SelectedIndex == 0 && st.SelectedIndex == 9)
     {
         Form11 form11 = new Form11();
         this.Hide();
         form11.Show();
     }
     if (sexual.SelectedIndex == 1 && st.SelectedIndex == 0)
     {
         Form12 form12 = new Form12();
         this.Hide();
         form12.Show();
     }
     if (sexual.SelectedIndex == 1 && st.SelectedIndex == 1)
     {
         Form13 form13 = new Form13();
         this.Hide();
         form13.Show();
     }
     if (sexual.SelectedIndex == 1 && st.SelectedIndex == 2)
     {
         Form14 form14 = new Form14();
         this.Hide();
         form14.Show();
     }
     if (sexual.SelectedIndex == 1 && st.SelectedIndex == 3)
     {
         Form15 form15 = new Form15();
         this.Hide();
         form15.Show();
     }
     if (sexual.SelectedIndex == 1 && st.SelectedIndex == 4)
     {
         Form16 form16 = new Form16();
         this.Hide();
         form16.Show();
     }
     if (sexual.SelectedIndex == 1 && st.SelectedIndex == 5)
     {
         Form17 form17 = new Form17();
         this.Hide();
         form17.Show();
     }
     if (sexual.SelectedIndex == 1 && st.SelectedIndex == 6)
     {
         Form18 form18 = new Form18();
         this.Hide();
         form18.Show();
     }
     if (sexual.SelectedIndex == 1 && st.SelectedIndex == 7)
     {
         Form19 form19 = new Form19();
         this.Hide();
         form19.Show();
     }
     if (sexual.SelectedIndex == 1 && st.SelectedIndex == 8)
     {
         Form20 form20 = new Form20();
         this.Hide();
         form20.Show();
     }
     if (sexual.SelectedIndex == 1 && st.SelectedIndex == 9)
     {
         Form21 form21 = new Form21();
         this.Hide();
         form21.Show();
     }
     if (sexual.SelectedIndex == 1 && st.SelectedIndex == 10)
     {
         Form22 form22 = new Form22();
         this.Hide();
         form22.Show();
     }
 }
Exemple #8
0
        private void button4_Click(object sender, EventArgs e)
        {
            Form17 form17 = new Form17();

            form17.Show();
        }