public ActionResult ChangeReserveCoef(int id, ChangeReservCoefModel model)
        {
            if (!User.IsInRole("representative") && !User.IsInRole("buildingmanager")) { return new HttpUnauthorizedResult(); }

            var building = buildingsRepository.GetById(id);
            if(building == null) {
                return HttpNotFound();
            }

            if(ModelState.IsValid) {
                building.ReserveCoefficient = model.ReserveCoefficient;
                return RedirectToAction("building", new {Id = building.Id});
            } else {
                model.Roles = Roles.GetRolesForUser();
                model.CurrentRole = "representative";
                model.Links = new LinksModel() {Id = building.Id, Links = NavLinksGenerator.GetRepresentativeLinks(building)};

                return View(model);
            }
        }
        public ActionResult ChangeReserveCoef(int id)
        {
            if (!User.IsInRole("representative")) { return new HttpUnauthorizedResult(); }

            var building = buildingsRepository.GetById(id);
            if(building == null) {
                return HttpNotFound();
            }

            var model = new ChangeReservCoefModel() {
                ReserveCoefficient = building.ReserveCoefficient,
                Roles = Roles.GetRolesForUser(),
                CurrentRole = "representative",
                Links = new LinksModel() { Id = building.Id, Links = NavLinksGenerator.GetRepresentativeLinks(building)}
            };

            return View(model);
        }