Exemplo n.º 1
0
        private void BursaSubesi_Click(object sender, EventArgs e)
        {
            Globals.Branch = BursaSubesi.Text;
            DrinkSelection ds = new DrinkSelection();

            ds.ShowDialog();
        }
Exemplo n.º 2
0
        private void YalovaSube_Click(object sender, EventArgs e)
        {
            Globals.Branch = YalovaSube.Text;
            DrinkSelection ds = new DrinkSelection();

            ds.ShowDialog();
        }
Exemplo n.º 3
0
        private void SaveBtn_Click(object sender, EventArgs e)
        {
            string added   = "";
            string deleted = "";

            if (AddBeverageCB.SelectedItem != null)
            {
                added = AddBeverageCB.SelectedItem.ToString();
            }
            if (DeleteBeverageCB.SelectedItem != null)
            {
                deleted = DeleteBeverageCB.SelectedItem.ToString();
            }
            List <Coffee> raisedCoffee = new List <Coffee>();

            if (EsspressoChB.Checked == true)
            {
                raisedCoffee.Add(new Esspresso());
            }
            if (FilteredCoffeeChB.Checked == true)
            {
                raisedCoffee.Add(new FilteredCoffee());
            }
            if (FrappuccinoChB.Checked == true)
            {
                raisedCoffee.Add(new Frappuccino());
            }
            if (Globals.Branch == "Yalova")
            {
                YalovaSube ys = new YalovaSube();
                ys.RegisterRaisedCoffee(raisedCoffee);
                ys.TemplateMethod(added, deleted, (double)RaiseUD.Value);
                this.Close();
                DrinkSelection ds = new DrinkSelection(ys);
                ds.ShowDialog();
            }
            else if (Globals.Branch == "Bursa")
            {
                BursaSube bs = new BursaSube();
                bs.RegisterRaisedCoffee(raisedCoffee);
                bs.TemplateMethod(added, deleted, (double)RaiseUD.Value);
                this.Close();
                DrinkSelection ds = new DrinkSelection(bs);
                ds.ShowDialog();
            }
        }