示例#1
0
        public async Task <IActionResult> Search(string name)
        {
            // Calling this method so list of building stays in quick panel even after post request
            ViewBag.All = await List();

            // Calling all buildings from database
            var allBuildings = await _buildingService.GetAllBuildings();

            // Declare list result so we can save there our wanted results
            List <Building> result = new List <Building>()
            {
            };

            foreach (var item in allBuildings)
            {
                // Search address from database by street name and its house number
                if (!String.IsNullOrEmpty(name) &&
                    (item.Street.Replace(" ", "").ToLower() + item.HouseNumber).Contains(name.Replace(" ", "").Split(",")[0].ToLower()))
                {
                    result.Add(new Building {
                        BuildingName = item.BuildingName, Photo = item.Photo, Street = item.Street, HouseNumber = item.HouseNumber, Place = item.Place
                    });
                }
            }
            // Save our list in ViewBag so we can retreve this in View
            ViewBag.AllBuildings = result;
            return(View("Index"));
        }
        // GET: Properties/Create
        public async Task <IActionResult> Create()
        {
            ViewBag.AllUsers = await appUserService.GetAllAppUsersAsync();

            ViewBag.AllPropTypes = await propertyTypeService.GetAllPropertyTypesAsync();

            ViewBag.AllBuildings = buildingService.GetAllBuildings().Select(x => new { Id = x.Id, Name = $"{x.Id} {x.City} {x.Street} {x.Number}" });

            return(View());
        }
示例#3
0
        // GET: Properties/Create
        public async Task <IActionResult> Create()
        {
            var allBuildings = buildingService.GetAllBuildings();

            ViewBag.AllBuildings = allBuildings.Select(
                b => new IdNameViewModel()
            {
                Id = b.Id, Name = $"{b.City} {b.Street} {b.Number}"
            });

            return(View());
        }
示例#4
0
        public async Task <List <ReadBuildingDTO> > GetAllBuildings()
        {
            //bu yanlı hatayı engellemke için yaptım
            EntityDTO dto       = new EntityDTO();
            var       buildings = await _buildingService.GetAllBuildings(dto);

            return(buildings);
        }
示例#5
0
        void CreateBuildings()
        {
            IBuildingService       buildingService       = ServiceLocator.Instance.GetService <IBuildingService>();
            IBuildingVisualFactory buildingVisualFactory = ServiceLocator.Instance.GetService <IBuildingVisualFactory>();

            foreach (var building in buildingService.GetAllBuildings())
            {
                buildingVisualFactory.CreateVisualForBuilding(building);
            }
        }
示例#6
0
        // GET: Beacon
        public async Task <ActionResult> Index()
        {
            EntityDTO dto = new EntityDTO()
            {
                Id = Guid.Parse(HttpContext.Session.GetString("LocationId"))
            };
            IEnumerable <ReadBuildingDTO> beacons = await _buildingService.GetAllBuildings(dto);

            return(View(beacons));
        }
示例#7
0
        public Task <AlpApiResponse <List <BuildingDto> > > GetAllBuilding()
        {
            var sessionToken = HttpContext.Request.Headers["sessiontoken"];

            if (!_accountService.Authorize(sessionToken, new List <RoleType> {
                RoleType.Admin, RoleType.DepartmentInventoryOperator
            }))
            {
                return(Task.FromResult(new AlpApiResponse <List <BuildingDto> > {
                    Success = false, Message = "Nincs jogosultsága ehhez a művelethez!"
                }));
            }
            return(_buildingService.GetAllBuildings());
        }
        public ActionResult Get()
        {
            List<BuildingVM> model = new List<BuildingVM>();
            _buildingService.GetAllBuildings().ToList().ForEach(u =>
            {
                BuildingVM buildingData = new BuildingVM
                {
                    Id = u.Id,
                    Name = u.Name,
                    Location = u.Location
                };
                model.Add(buildingData);
            });

            return Ok(model);
        }
示例#9
0
        // GET: Building
        public IActionResult Index()
        {
            List <Building> buildings = service.GetAllBuildings();

            return(View(buildings));
        }
示例#10
0
        public IActionResult Index()
        {
            var buildings = bldService.GetAllBuildings();

            return(View(buildings));
        }