Esempio n. 1
0
        private void savemachine_Click(object sender, EventArgs e)
        {
            int j = comboBox2.SelectedIndex + 1;

            test();
            if ((textBox3.Text != "") && (textBox1.Text != ""))
            {
                if (x == 1)
                {
                    int    i   = conn.autoinc("machine", "id_machine");
                    string ch1 = "insert into machine values('" + i + "','" + j + "','" + textBox3.Text + "','" + dateTimemachine.Value.ToString("dd/MM/yyyy") + "','" + textBox1.Text + "')";
                    conn.insertTable(ch1);

                    Machine0 a = new Machine0();
                    a.Show();
                    this.Hide();
                }
                else
                {
                    string req = "update machine set Registration_num ='" + textBox3.Text + "', LIBELLE= '" + textBox1.Text + "',ID_MARQUE='" + j + "' where id_machine = '" + id + "'";
                    conn.insertTable(req);
                    Machine a = new Machine();
                    a.Show();
                    this.Hide();
                }
            }
        }
Esempio n. 2
0
        private void button3_Click(object sender, EventArgs e)
        {
            Machine0 a = new Machine0();

            a.Show();
            this.Hide();
        }