public Change(Change origin) { GetProperties(origin); }
public ChangeEventArgs(Change change = null) { this.Change = change; }
/// <summary> /// Funktion zum Verkaufen. /// </summary> /// <param name="Initiator">Verkäufer</param> /// <param name="Customer">Käufer</param> /// <param name="Amount">Anzahl</param> public int Remove(Person Initiator, Person Customer, uint Amount) { Change c = new Change(Initiator, Customer, DateTime.Now, -Convert.ToInt32(Amount), Changes.Count > 0 ? Changes.Last().ID + 1 : 0); Changes.Add(c); UpdateStock(-Convert.ToInt32(Amount)); Log.WriteInformation(Initiator.Name + " sold " + Amount.ToString() + " of " + this.Name + " to " + Customer.Name); if (ItemRemoved != null) ItemRemoved(this, new ChangeEventArgs(c)); return c.ID; }