Example #1
0
 protected void ChooseAction(Drinks template)
 {
     if (delToAdd != null)
     {
         AdditingToList(template, delToAdd);
     }
     else
     {
         ChangingElement(template, delToChange);
     }
 }
Example #2
0
        public override bool Equals(Drinks v1)
        {
            Vine other = v1 as Vine;

            if ((other != null) && (this.Name == other.Name) && (this.PercentOfAlcohol == other.PercentOfAlcohol) && (this.Volume == other.Volume) && (this.vineType == other.vineType))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #3
0
        public override bool Equals(Drinks v1)
        {
            Milk other = v1 as Milk;

            if ((other != null) && (this.Name == other.Name) && (this.Volume == other.Volume) && (this.Fatness == other.Fatness))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #4
0
        public override void ChangingElement(Panel panel, Drinks element, DChange del)
        {
            Milk temp = element as Milk;

            nameBox.Text   = element.Name;
            volume.Value   = Convert.ToDecimal(element.Volume);
            Featness.Value = Convert.ToDecimal(temp.Fatness);

            this.save.Text = "Change Object";

            delToAdd    = null;
            delToChange = del;
        }
Example #5
0
        public override void ChangingElement(Panel panel, Drinks element, DChange del)
        {
            Lemonade temp = element as Lemonade;

            nameBox.Text        = element.Name;
            volume.Value        = Convert.ToDecimal(element.Volume);
            CountOfLemons.Value = Convert.ToDecimal(temp.CountOfLemon);

            this.save.Text = "Change Object";

            delToAdd    = null;
            delToChange = del;
        }
Example #6
0
        public override bool Equals(Drinks v1)
        {
            Kvass other = v1 as Kvass;

            if ((other != null) && (this.Name == other.Name) && (this.Volume == other.Volume) && (this.LeavenType.ToString() == other.LeavenType.ToString()))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #7
0
        public override bool Equals(Drinks v1)
        {
            Lemonade other = v1 as Lemonade;

            if ((other != null) && (this.Name == other.Name) && (this.Volume == other.Volume) && (this.CountOfLemon == other.CountOfLemon))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #8
0
        public override bool Equals(Drinks v1)
        {
            Cognac other = v1 as Cognac;

            if ((other != null) && (this.Name == other.Name) && (this.Volume == other.Volume) && (this.PercentOfAlcohol == other.PercentOfAlcohol) && (this.Age == other.Age))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #9
0
        public override void ChangingElement(Panel panel, Drinks element, DChange del)
        {
            Cognac temp = element as Cognac;

            nameBox.Text    = element.Name;
            volume.Value    = Convert.ToDecimal(element.Volume);
            percentBox.Text = temp.PercentOfAlcohol.ToString();
            ageBox.Text     = temp.Age.ToString();

            this.save.Text = "Change Object";

            delToAdd    = null;
            delToChange = del;
        }
Example #10
0
        public override bool Equals(Drinks v1)
        {
            Beer other = v1 as Beer;

            if ((other != null) && (this.Name == other.Name) && (this.Volume == other.Volume) && (this.PercentOfAlcohol == other.PercentOfAlcohol) &&
                (this.LeavenType.ToString() == other.LeavenType.ToString()))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #11
0
        public override void ChangingElement(Panel panel, Drinks element, DChange del)
        {
            Vine temp = element as Vine;

            nameBox.Text       = element.Name;
            volume.Value       = Convert.ToDecimal(element.Volume);
            percentBox.Text    = temp.PercentOfAlcohol.ToString();
            types.SelectedItem = temp.vineType;

            this.save.Text = "Change Object";

            delToAdd    = null;
            delToChange = del;
        }
Example #12
0
        public override void ChangingElement(Panel panel, Drinks element, DChange del)
        {
            Kvass temp = element as Kvass;

            nameBox.Text = element.Name;
            volume.Value = Convert.ToDecimal(element.Volume);

            ChangingLeavenElement(temp.LeavenType);


            this.save.Text = "Change Object";

            delToAdd    = null;
            delToChange = del;
        }
Example #13
0
 public void AddElementToList(Drinks element)
 {
     if (ListOfDrinks.Contains(element) == false)
     {
         listBoxForDrinks.Items.Add(element.ToString());
         ListOfDrinks.Add(element);
         MessageBox.Show("Drink has been succesfully added");
         buildList[comboBoxDrinks.SelectedIndex].ClearPanel();
         panelForActions.Enabled      = false;
         comboBoxDrinks.SelectedIndex = -1;
     }
     else
     {
         MessageBox.Show("Sorry,but drink has been already added");
     }
 }
Example #14
0
 public virtual void ChangingElement(Panel panel, Drinks element, DChange del)
 {
 }
Example #15
0
 protected void ChangingElement(Drinks template, DChange del)
 {
     del.Invoke(template);
 }
Example #16
0
 protected void AdditingToList(Drinks template, DAdd del)
 {
     del.Invoke(template);
 }