コード例 #1
0
        public void AddResident(Resident resident)
        {
            if (resident != null)
            {
                foreach (var res in _residents)
                {
                    if (res.ToString().Equals(resident.ToString()))
                    {
                        AddNotification("Resident", $"Morador {resident.ToString()} já existe");
                        return;
                    }
                }

                _residents.Add(resident);
                resident.AddApartment(this);
                Updated = DateTime.Now;
            }
        }
コード例 #2
0
 public void RemoveResident(Resident resident)
 {
     _residents.Remove(resident);
     Updated = DateTime.Now;
 }