protected void ChooseAction(Drinks template) { if (delToAdd != null) { AdditingToList(template, delToAdd); } else { ChangingElement(template, delToChange); } }
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); } }
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); } }
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; }
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; }
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); } }
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); } }
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); } }
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; }
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); } }
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; }
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; }
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"); } }
public virtual void ChangingElement(Panel panel, Drinks element, DChange del) { }
protected void ChangingElement(Drinks template, DChange del) { del.Invoke(template); }
protected void AdditingToList(Drinks template, DAdd del) { del.Invoke(template); }