Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            orderUserControl1 o = new orderUserControl1(form);
            facade            concreteFacade = new facade(new manfacture(), form);

            concreteFacade.SendNotification(new meal(), o, notificationUserControl1.N++);
        }
        private void button3_Click(object sender, EventArgs e)
        {
            size     = comboBox3.Text;
            quantity = numericUpDown3.Value;
            orderUserControl1 o = new orderUserControl1(form);

            manfacture.ConstructOrder(new sandwish3(), o, notificationUserControl1.N++, size, quantity);
            form.setFlow.Controls.Add(o);
            form.myOrders.Add(o);
            using (SqlConnection sqlcon = new SqlConnection(connectionstring))
            {
                sqlcon.Open();
                SqlCommand sqlcmd = new SqlCommand("Userorder", sqlcon);
                sqlcmd.CommandType = CommandType.StoredProcedure;
                sqlcmd.Parameters.AddWithValue("@name", o.Name);
                sqlcmd.Parameters.AddWithValue("@type", o.Type);
                sqlcmd.Parameters.AddWithValue("@extras", o.Exters);
                sqlcmd.Parameters.AddWithValue("@size", o.Size1);
                sqlcmd.Parameters.AddWithValue("@price", 17 * numericUpDown3.Value);
                sqlcmd.Parameters.AddWithValue("@quantity", numericUpDown3.Value);

                sqlcmd.ExecuteNonQuery();
                MessageBox.Show("Your order has been confirmed");
            }
        }
Ejemplo n.º 3
0
        private void button8_Click(object sender, EventArgs e)
        {
            size     = comboBox8.Text;
            quantity = numericUpDown8.Value;
            orderUserControl1 o = new orderUserControl1(form);
            facade            concreteFacade = new facade(new manfacture(), form);

            concreteFacade.SendNotification(new beverge2(), o, notificationUserControl1.N++, size, quantity);
        }
Ejemplo n.º 4
0
 public void addOrder(orderUserControl1 o)
 {
     flowLayoutPanel1.Controls.Add(o);
 }