public static bool Entfernen(ref Regalfach tmp)
 {
     if (_dict.Remove(tmp.RegalfachID))
     {
         RegalfachEntfernt?.Invoke(tmp, EventArgs.Empty);
         tmp = null;
         return(true);
     }
     return(false);
 }
Beispiel #2
0
        public Paket(uint paket_id, ushort regalfach_id, string name, ushort menge, DateTime erstellt_am, DateTime geaendert_am, DateTime haltbarkeit, uint produkt_id, float hoehe, float breite, float laenge, string anschaffungsgrund)
        {
            Contract.Requires(paket_id >= 1);
            Contract.Requires(regalfach_id >= 1);
            Contract.Requires(name.Length <= 15);   // plus minimal Länge laut Data Dictionary später
            Contract.Requires(menge >= 1);
            Contract.Requires(anschaffungsgrund.Length <= 50);
            Contract.Requires(hoehe >= 0);
            Contract.Requires(breite >= 0);
            Contract.Requires(laenge >= 0);
            PaketID           = paket_id;
            RegalfachID       = regalfach_id;
            Menge             = menge;
            Name              = name;
            ErstelltAm        = erstellt_am;
            GeaendertAm       = geaendert_am;
            Haltbarkeit       = haltbarkeit;
            ProduktID         = produkt_id;
            Anschaffungsgrund = anschaffungsgrund;
            Regalfach.PaketHinzufuegen(regalfach_id, this);

            Hinzufuegen(this);
        }
Beispiel #3
0
 public static void RegalfachHinzufuegen(ushort regalID, Regalfach tmp)
 {
     _dict[regalID].Regalfachliste.Add(tmp);
 }
 private void Hinzufuegen(Regalfach tmp)
 {
     _dict.Add(tmp.RegalfachID, tmp);
     RegalfachHinzugefuegt?.Invoke(this, EventArgs.Empty);
 }