Example #1
0
        private void but_Menu_Click_1(object sender, EventArgs e)
        {
            this.Hide();            //Hides Form 1/ Login screen
            LogIn f1 = new LogIn(); //Create form2 object

            f1.ShowDialog();
        }
Example #2
0
        private void but_submit_Click(object sender, EventArgs e)
        {
            try
            {
                connection.Open();
                OleDbCommand command = new OleDbCommand();
                command.Connection = connection;

                if (MessageBox.Show("Are you sure you would like to submit this inquiry?", "Submission Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
                {
                    command.CommandText = "insert into ContactUs(CurrentDate, IssueDate, FullName, EmailAddress, Problem) values('" + txt_currentDate.Text + "', '" + txt_issueDate.Text + "','" + txt_fullName.Text + "','" + txt_email.Text + "','" + txt_report.Text + "')";
                    command.ExecuteNonQuery();
                    MessageBox.Show("Submitted Successfully");
                }
                else
                {
                    MessageBox.Show("Inquiry Not Submitted");
                }

                connection.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error " + ex);
            }

            this.Hide();
            LogIn f3 = new LogIn();

            f3.ShowDialog();
        }
        private void button2_Click(object sender, EventArgs e)
        {
            this.Hide();            //Hides Form 1/ Login screen
            LogIn f3 = new LogIn(); //Create form2 object

            f3.ShowDialog();
        }
Example #4
0
        private void but_Menu_Click(object sender, EventArgs e)
        {
            this.Hide();
            LogIn f1 = new LogIn();

            f1.ShowDialog();
        }
        private void but_submit_Click(object sender, EventArgs e)
        {
            try
            {
                connection.Open();
                OleDbCommand command = new OleDbCommand();
                command.Connection = connection;

                if (MessageBox.Show("Are you sure you would like to create a new account?", "Submission Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
                {
                    command.CommandText = "insert into LogIn(FirstName, LastName, UserName, Pass, Privilege) values('" + txt_fname.Text + "', '" + txt_last.Text + "', '" + txt_user.Text + "' , '" + txt_pass.Text + "' , '" + com_type.Text + "')";
                    command.ExecuteNonQuery();
                    MessageBox.Show("New Account Created");

                    if (com_type.Text == "vendor")
                    {
                        vendorAdd();
                    }
                }
                else
                {
                    MessageBox.Show("Account Not Created");
                }

                connection.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error " + ex);
            }

            this.Hide();
            LogIn f1 = new LogIn();

            f1.ShowDialog();
        }