Beispiel #1
0
        private void get_food_to_eat_Load(object sender, EventArgs e)
        {
            //tooltip
            toolTip1.SetToolTip(this.button1, "Add product to list");
            toolTip1.SetToolTip(this.button2, "Remove product from list");
            toolTip1.SetToolTip(this.button3, "Take products to eat...");
            toolTip1.SetToolTip(this.progressBar1, "Click to see the available products...");

            //comboBox1.DropDownHeight = comboBox1.ItemHeight * 5;
            foreach (item item1 in icebox1.stored_food)
            {
                comboBox1.Items.Add(item1.name);
            }
            progressBar1.Value = Convert.ToInt32(icebox1.fridge_capacity());
        }
Beispiel #2
0
 //
 //button1: order button
 //
 private void button1_Click(object sender, EventArgs e)
 {
     if (icebox1.fridge_capacity() + icebox1.get_list_quantity(recipe_list) <= 40)
     {
         DialogResult result = MessageBox.Show("The following product(s) are missing:" + Environment.NewLine + missing_products + "Do you want to order them online now?", "Warning: Products are missing!", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
         if (result == DialogResult.Yes)
         {
             icebox1.recipes_is_waiting = true;
             icebox1.orderState();
             icebox1.selected_recipe = comboBox1.SelectedItem.ToString();
             this.Close();
             //MessageBox.Show(icebox1.temp_list.Count.ToString() + icebox1.recipes_is_waiting); //-->debugging
         }
     }
     else
     {
         MessageBox.Show("There is not enough space in the fridge to order the missing products:" + Environment.NewLine + missing_products + "Free up space and then try placing a new order.", "Oops, no more space in the fridge!", MessageBoxButtons.OK, MessageBoxIcon.Error);
         //this.Close();
     }
 }