Esempio n. 1
0
        public List <EPCRating> GenerateDropDownList()
        {
            List <EPCRating> EPCList     = ReturnAllEPCRatings();
            EPCRating        placeHolder = new EPCRating
            {
                Id            = Guid.Empty,
                EPCRatingName = "** Please Select An EPC Rating **"
            };

            EPCList.Add(placeHolder);
            return(EPCList
                   .OrderBy(x => x.EPCRatingName)
                   .ToList());
        }
        public IActionResult Manage(PropertyAttributeViewModel model)
        {
            EPCRating    EPC          = EPCRatingService.ReturnSingleEPCRating(model.PropertyAttribute.EPCRating.Id);
            TenureType   TenureType   = TenureTypeService.ReturnSingleTenureType(model.PropertyAttribute.TenureType.Id);
            PropertyType PropertyType = PropertyTypeService.ReturnSinglePropertyType(model.PropertyAttribute.PropertyType.Id);

            model.PropertyAttribute.EPCRating    = EPC;
            model.PropertyAttribute.TenureType   = TenureType;
            model.PropertyAttribute.PropertyType = PropertyType;

            PropertyAttributeService.UpdatePropertyAttribute(model.PropertyAttribute);
            PropertyAttributeService.SaveChanges();

            return(RedirectToAction("PropertyDetails", "Property", new { PropertyId = model.PropertyId }));
        }