Пример #1
0
        private void btSubmit_Click(object sender, EventArgs e)
        {
            // update order database
            if (a.username == null || a.username == "")
            {
                DialogResult dr = MessageBox.Show("You have to login to checkout !!", "Notification", MessageBoxButtons.YesNo);
                if (dr == DialogResult.Yes)
                {
                    LoginGUI lgui = new LoginGUI(this.m, this);
                    lgui.Show();
                    return;
                }
            }
            Order or = new Order(dateTimePicker1.Value, txtFirstName.Text, txtLastName.Text, txtAddress.Text,
                                 txtCity.Text, txtState.Text, txtCountry.Text, txtPhone.Text, txtEmail.Text, total_amount);

            OrderDAO.Insert(or);
            int orderid = OrderDAO.getIDMax();

            if (orderid != -1)
            {
                foreach (DataGridViewRow dr in dataGridView1.Rows)
                {
                    {
                        OrderDetail ord = new OrderDetail(orderid, int.Parse(dr.Cells["albumid"].Value.ToString()), int.Parse(dr.Cells["amount"].Value.ToString()), int.Parse(dr.Cells["price"].Value.ToString()));
                        OrderDetailDAO.Insert(ord);
                    }
                }
                MessageBox.Show("Checkout Successfully !!! Thank you !!!! See You Again !!!", "Notification !!!", MessageBoxButtons.OK);
                this.Close();
            }
            else
            {
                MessageBox.Show("Checkout Error !!! Try Again !!!", "Notification !!!", MessageBoxButtons.OK);
            }
        }
Пример #2
0
 public RegisterForm(LoginGUI m) : this()
 {
     this.lgui = m;
 }
Пример #3
0
        private void LoginToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LoginGUI m = new LoginGUI(this);

            embed(toolStripContainer1.ContentPanel, m);
        }