HotelPart.cs 781 B

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using TourAgent.Views;
  7. namespace TourAgent.Models
  8. {
  9. public partial class Hotel
  10. {
  11. UP_SmirnovContext db = new UP_SmirnovContext();
  12. public string CountryName
  13. {
  14. get
  15. {
  16. return db.Countries.Where(x => x.Code == CountryCode).Select(x=>x.Name).FirstOrDefault();
  17. }
  18. }
  19. public int AmountTours
  20. {
  21. get
  22. {
  23. List<HotelOfTour> HotelForAmount = db.HotelOfTours.ToList();
  24. HotelForAmount = HotelForAmount.Where(x => x.HotelId == Id).ToList();
  25. return HotelForAmount.Count;
  26. }
  27. }
  28. }
  29. }