Beispiel #1
0
        public ActionResult BuildingType()
        {
            var BuildingTypes = _buildingTypeAppService.getAllBuildingtype();
            var buidlingTypes = new BuildingTypeViewModel
            {
                BuildingTypes = BuildingTypes
            };

            return(View("BuildingType", buidlingTypes));
        }
Beispiel #2
0
        public ActionResult ApplicationForm()
        {
            // get list of building unit content
            var buildingUnitContents = _buildingUnitContentsAppService.getAllBuildingUnitContents();
            // get the list of building uses
            var buildingUses = _buildingUsesAppService.getAllBuildingUses();
            //get the list of buildingTypes
            var buildingTypes = _buildingTypeAppService.getAllBuildingtype().ToList();
            // get the list of neighborhoods
            var neighborhoods = _neighborhoodAppService.GetAllNeighborhood().ToList();
            // get all of buildings
            var buildings = _buildingsAppService.getAllBuildings();
            // get all of restoration types
            var restorationTypes = _restorationTypeAppService.getAllResorationTypes();
            // get all of intervention types
            var interventionTypes = _interventionTypeAppService.getAllInterventionTypes();
            // get all applications
            var applications = _applicationsAppService.getAllApplications().ToList();
            // get all property ownerships
            var propertyOwnerships = _propertyOwnershipAppService.getAllPropertyOwnerships();
            // populate yes no drop down list
            var yesOrNo = new List <string>
            {
                "True",
                "False"
            };
            var fullNameList = new List <string>();

            foreach (var application in applications)
            {
                if (!String.IsNullOrWhiteSpace(application.fullName))
                {
                    fullNameList.Add(application.fullName);
                }
            }
            var fullNameArray         = fullNameList.Distinct().ToArray();
            var applicationsViewModel = new ApplicationsViewModel()
            {
                fullNameArray        = fullNameArray,
                buildingOutput       = new GetBuildingsOutput(),
                PropertyOwnerShips   = propertyOwnerships,
                YesOrNo              = new SelectList(yesOrNo),
                InterventionTypes    = interventionTypes,
                RestorationTypes     = restorationTypes,
                Applications         = applications,
                Buildings            = buildings,
                Building             = new CreateBuildingsInput(),
                Neighborhoods        = neighborhoods,
                BuildingTypes        = buildingTypes,
                BuildingUses         = buildingUses,
                BuildingUnitContents = buildingUnitContents
            };

            return(View("ApplicationForm", applicationsViewModel));
        }
        // GET: Building
        public ActionResult Index()
        {
            var getBuildingOutput = _buildingsAppService.getAllBuildings();

            // if neighborhood or buildingtype is deleted
            // initiate the object with default values .
            foreach (var Building  in getBuildingOutput)
            {
                if (Building.BuildingType == null)
                {
                    Building.BuildingType = new TaawonMVC.Models.BuildingType();
                }
                if (Building.NeighboorHood == null)
                {
                    Building.NeighboorHood = new TaawonMVC.Models.Neighborhood();
                }
            }
            //get the list of buildingTypes
            var buildingTypes = _buildingTypeAppService.getAllBuildingtype().ToList();
            // get the list of neighborhoods

            var neighborhoods = _neighborhoodAppService.GetAllNeighborhood().ToList();

            //var BuildingTypeInput = new GetBuidlingTypeInput
            //{
            //    Id = id
            //};
            //var buildingType = _buildingTypeAppService.getBuildingTypeById(BuildingTypeInput);
            var BuildingsViewModel = new BuildingViewModel
            {
                Buildings     = getBuildingOutput,
                BuildingTypes = buildingTypes,
                Neighborhoods = neighborhoods,
                Building      = new GetBuildingsOutput(),
            };

            return(View("Index", BuildingsViewModel));
        }
        //  [ValidateAntiForgeryToken]
        // [DisableAbpAntiForgeryTokenValidation]
        public ActionResult Index()
        {
            var getBuildingOutput = new List <GetBuildingsOutput>();

            getBuildingOutput = _buildingsAppService.getAllBuildings().ToList();


            // if neighborhood or buildingtype is deleted
            // initiate the object with default values .
            foreach (var Building  in getBuildingOutput)
            {
                if (Building.BuildingType == null)
                {
                    Building.BuildingType = new TaawonMVC.Models.BuildingType();
                }
                if (Building.NeighboorHood == null)
                {
                    Building.NeighboorHood = new TaawonMVC.Models.Neighborhood();
                }
            }
            //get the list of buildingTypes
            var buildingTypes = _buildingTypeAppService.getAllBuildingtype().ToList();
            // get the list of neighborhoods
            var neighborhoods = _neighborhoodAppService.GetAllNeighborhood().ToList();
            // get the list of BuildingUses
            var buildingUses = _buildingUsesAppService.getAllBuildingUses().ToList();
            // get list of building units
            var buildingUnitsOutput = _buildingUnitsAppService.getAllBuildingUnits().ToList();

            //var BuildingTypeInput = new GetBuidlingTypeInput
            //{
            //    Id = id
            //};
            //var buildingType = _buildingTypeAppService.getBuildingTypeById(BuildingTypeInput);

            //populate yes-no list
            var yesOrNo = new List <string>
            {
                "True",
                "False"
            };

            //Read HoushName From Database
            //----------------------------
            var HoushNames = new List <string>();

            foreach (var HoushName in getBuildingOutput)
            {
                if (!String.IsNullOrWhiteSpace(HoushName.houshName))
                {
                    HoushNames.Add(HoushName.houshName);
                }
            }
            var HoushNameArray = HoushNames.ToArray();
            //foreach(var str in HoushNameArray)
            //{
            //    str.Trim();
            //    str.ToUpper();
            //}
            //var houshNameArrayClean = new string[HoushNameArray.Length];
            //for(int i=0;i< HoushNameArray.Length;i++)
            //{
            //    HoushNameArray[i].Trim();
            //    HoushNameArray[i].ToUpper();
            //    houshNameArrayClean[i] = HoushNameArray[i];
            //}
            // var HoushNameArrayWithoutDuplicate = new HashSet<string>(HoushNameArray);
            var HoushNameArrayWithoutDuplicate = HoushNameArray.Distinct().ToArray();

            //----------------------------
            //-----------------------------

            var BuildingsViewModel = new BuildingViewModel
            {
                Buildings            = getBuildingOutput,
                BuildingTypes        = buildingTypes,
                Neighborhoods        = neighborhoods,
                Building             = new GetBuildingsOutput(),
                YesOrNo              = new SelectList(yesOrNo),
                HoushNameArray       = HoushNameArrayWithoutDuplicate,
                BuildingUses         = buildingUses,
                BuildingUnitsOutputs = buildingUnitsOutput
            };

            return(View("Index", BuildingsViewModel));
        }