private void WhmanForm_Load(object sender, EventArgs e) { ConnectToDB conn = new ConnectToDB(); List<string> warehouseStr = conn.GetWarehouseStrings(); for (int i = 0; i < warehouseStr.Count; i++) comboBox1.Items.Add(warehouseStr[i]); }
private void button2_Click(object sender, EventArgs e) { string item = comboBox1.SelectedItem.ToString(); int quantity = (int)numericUpDown2.Value; ConnectToDB conn = new ConnectToDB(); conn.RemoveItemFromWarehouse(item, quantity); }
private void button1_Click(object sender, EventArgs e) { string item = textBox1.Text; int quantity = (int)numericUpDown1.Value; ConnectToDB conn = new ConnectToDB(); conn.AddItemToWarehouse(item, quantity); }
public static void AddOrder(string name) { ConnectToDB conn = new ConnectToDB(); int price = conn.GetCocktailPrice(name); List<string> content = conn.GetCocktailContent(name); Cocktail cocktail = Build(content[0], content[1], content[2], price); queue.Add(cocktail); }
private void UserForm_Load(object sender, EventArgs e) { ConnectToDB conn = new ConnectToDB(); List<string> menuStr = conn.GetMenuStrings(); List<int> menuPrices = conn.GetMenuPrices(); for (int i = 0; i < menuStr.Count; i++) comboBox1.Items.Add("$" + menuPrices[i].ToString() + " " + menuStr[i]); }
private void button2_Click(object sender, EventArgs e) // adding new recipe { string name = textBox1.Text; string liq = textBox2.Text; string ice = textBox3.Text; string dec = textBox4.Text; int price = (int)numericUpDown1.Value; ConnectToDB conn = new ConnectToDB(); conn.AddRecipe(name, liq, ice, dec, price); textBox1.Clear(); textBox2.Clear(); textBox3.Clear(); textBox4.Clear(); numericUpDown1.Value = 0; }
public bool Make() { ConnectToDB conn = new ConnectToDB(); bool liq = false; if (ingredients[0] != "") liq = conn.RemoveItemFromWarehouse(ingredients[0], 1); bool dec = false; if (ingredients[2] != "") dec = conn.RemoveItemFromWarehouse(ingredients[2], 1); if (liq && dec) return true; else { if (liq) conn.AddItemToWarehouse(ingredients[0], 1); else if (dec) conn.AddItemToWarehouse(ingredients[2], 1); return false; } }
private void button1_Click(object sender, EventArgs e) { string login = textBox1.Text; string password = textBox2.Text; ConnectToDB conn = new ConnectToDB(); int type = conn.SignIn(login, password); if (type == 1) { BarForm barmenf = new BarForm(); barmenf.Show(); } else if (type == 2) { UserForm userf = new UserForm(); userf.Show(); } else if (type == 3) { WhmanForm whmanf = new WhmanForm(); whmanf.Show(); } }