Пример #1
0
        private async Task Delete(int id)
        {
            var apartment = Apartments.FirstOrDefault(p => p.Id.Equals(id));

            var confirmed = await Js.InvokeAsync <bool>("confirm", $"Are you sure you want to delete the apartment with Id: {apartment.Id}?");

            if (confirmed)
            {
                await OnDeleted.InvokeAsync(id);
            }
        }
Пример #2
0
        internal IEnumerable <(int PayerId, int DaysLived, int OccupantCount)> GetApartmentPayerResidenceInfos(DateTime from, DateTime to, int apartmentId)
        {
            var apartment = Apartments.FirstOrDefault(a => a.ApartmentId == apartmentId);

            if (apartment is null)
            {
                throw new ArgumentNullException($"No Apartment With {apartmentId} Id Exists");
            }

            return(apartment.GetPayerResisdenceInfo(from, to));
        }
Пример #3
0
        internal decimal GetApartmentArea(int apartmentId)
        {
            var apartment = Apartments.FirstOrDefault(a => a.ApartmentId == apartmentId);

            if (apartment is null)
            {
                throw new ArgumentNullException($"No Apartment With {apartmentId} Id Exists");
            }

            return(apartment.Area);
        }
Пример #4
0
 public Apartment Get(string apartmentCode) => Apartments != null?Apartments.FirstOrDefault(e => e.LocalCode == apartmentCode) : null;
Пример #5
0
 public bool Contain(string apartmentCode) => Apartments.FirstOrDefault(e => e.LocalCode == apartmentCode) != null;