Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (eno.Text == "" || etitle.Text == "" || elength.Text == "" || eSeries.Text == "")
            {
                MessageBox.Show("Empty field", "WARNING", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                try
                {
                    DialogResult d;
                    d = MessageBox.Show("Record Entered successfully\nwould you like to Insert one more record?", "Success", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                    if (d == DialogResult.Yes)
                    {
                        Close();
                        Form obj1 = new episode();
                        obj1.Show();
                    }
                    else
                    {
                        Close();
                        Form obj1 = new insertmain();
                        obj1.Show();
                    }
                }

                catch
                {
                    MessageBox.Show("Error", "error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (Sname.Text == "" || Network.Text == "" || Production.Text == "")
            {
                MessageBox.Show("Empty field", "WARNING", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                String connection = "Provider=OraOLEDB.Oracle;Data Source=localhost;User Id=SYSTEM;Password=system;OLEDB.NET=True";

                OleDbConnection obj1 = new OleDbConnection(connection);
                obj1.Open();
                String q1 = "insert into series values ('" + Sname.Text + "','" + Network.Text + "')";
                String q2 = "insert into pcompany values('" + Sname.Text + "','" + Production.Text + "')";

                try
                {
                    OleDbCommand cm1 = new OleDbCommand(q1, obj1);
                    OleDbCommand cm2 = new OleDbCommand(q2, obj1);
                    cm1.ExecuteNonQuery();
                    cm2.ExecuteNonQuery();
                    obj1.Close();
                    DialogResult d;
                    d = MessageBox.Show("Record Entered successfully\nwould you like to Insert episode?", "Success", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                    if (d == DialogResult.Yes)
                    {
                        Close();
                        Form obj = new episode();
                        obj.Show();
                    }
                    if (d == DialogResult.No)
                    {
                        d = d = MessageBox.Show("would you like to Insert one more record?", "Nofification", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                        if (d == DialogResult.Yes)
                        {
                            Close();
                            Form obj = new insertseries();
                            obj.Show();
                        }
                        else
                        {
                            Close();
                            Form obj = new insertmain();
                            obj.Show();
                        }
                    }
                }

                catch
                {
                    MessageBox.Show("Error...", "error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }