Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Form obj;

            if (radioButton1.Checked == true)
            {
                this.Hide();
                obj = new updateNetwork();
                obj.Show();
            }
            else if (radioButton2.Checked == true)
            {
                this.Hide();
                obj = new updateProduction();
                obj.Show();
            }
            else if (radioButton3.Checked == true)
            {
                this.Hide();
                obj = new updateAgency();
                obj.Show();
            }
            else
            {
                MessageBox.Show("No option selected..", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                this.Hide();
                obj = new updatemain();
                obj.Show();
            }
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Form obj;

            if (sCombo.Text == "" || pCompTB.Text == "")
            {
                MessageBox.Show("Empty field ....", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                try
                {
                }
                catch
                {
                    MessageBox.Show("Error", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                DialogResult d;
                d = MessageBox.Show("Record updated successfuly\nWould you like to insert one more?", "Message", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (d == DialogResult.Yes)
                {
                    Close();
                    obj = new updateProduction();
                    obj.Show();
                }
                else
                {
                    Close();
                    obj = new updatemain();
                    obj.Show();
                }
            }
        }