コード例 #1
0
        public IActionResult SetInitialValues(Guid PropertyAttributeId, Guid PropertyId)
        {
            PropertyAttributeViewModel model = new PropertyAttributeViewModel
            {
                PropertyId        = PropertyId,
                PropertyAttribute = PropertyAttributeService.ReturnSinglePropertyAttribute(PropertyAttributeId)
            };

            ViewBag.EPCRating  = new SelectList(EPCRatingService.GenerateDropDownList(), "Id", "EPCRatingName");
            ViewBag.TenureType = new SelectList(TenureTypeService.GenerateDropDownList(), "Id", "TenureTypeName");

            return(View(model));
        }
コード例 #2
0
        public async Task <IViewComponentResult> InvokeAsync(Guid PropertyAttributeId, Guid PropertyId)
        {
            var model = new PropertyAttributeViewModel();

            model.PropertyAttribute = PropertyAttributeService.ReturnSinglePropertyAttribute(PropertyAttributeId);
            model.PropertyId        = PropertyId;

            ViewBag.EPCRating    = new SelectList(EPCRatingService.GenerateDropDownList(), "Id", "EPCRatingName");
            ViewBag.TenureType   = new SelectList(TenureTypeService.GenerateDropDownList(), "Id", "TenureTypeName");
            ViewBag.PropertyType = new SelectList(PropertyTypeService.GenerateDropDownList(), "Id", "PropertyTypeName");

            return(View(model));
        }
コード例 #3
0
        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 }));
        }