示例#1
0
        public ActionResult AddHouse()
        {
            long?id     = AdminHelper.AdminUserId(HttpContext);
            long?cityId = AdminUserService.GetById(id.Value).CityId;

            if (cityId == null)
            {
                return(View("ERROR", "总部不能进行房源管理"));
            }
            var regions = RegionService.GetCityAll(cityId.Value).ToList();

            regions.Insert(0, new RegionDTO()
            {
                Id = 0, Name = "请选择"
            });
            var roomTypes           = IdNameService.GetAll("户型");
            var statuses            = IdNameService.GetAll("房屋状态");
            var decorateStatuses    = IdNameService.GetAll("装修状态");
            var attachments         = AttachmentService.GetAll();
            var types               = IdNameService.GetAll("房屋类别");
            HouseAddViewModel model = new HouseAddViewModel();

            model.Regions          = regions;
            model.RoomTypes        = roomTypes;
            model.Statuses         = statuses;
            model.DecorateStatuses = decorateStatuses;
            model.Attachments      = attachments;
            model.Types            = types;
            return(View(model));
        }
示例#2
0
        public ActionResult Add()
        {
            long?userId = AdminHelper.GetUserId(HttpContext);
            long?cityId = userSerivce.GetById(userId.Value).CityId;

            if (cityId == null)
            {
                return(View("Error", (object)"总部不能进行房源管理"));
            }
            var regions          = regionService.GetAll(cityId.Value);
            var roomTypes        = idNameService.GetAll("户型");
            var statuses         = idNameService.GetAll("房屋状态");
            var decorateStatuses = idNameService.GetAll("装修状态");
            var attachments      = attService.GetAll();
            var types            = idNameService.GetAll("房屋类别");

            HouseAddViewModel model = new HouseAddViewModel();

            model.regions          = regions;
            model.roomTypes        = roomTypes;
            model.statuses         = statuses;
            model.decorateStatuses = decorateStatuses;
            model.attachments      = attachments;
            model.types            = types;
            return(View(model));
        }
示例#3
0
        public ActionResult Add()
        {
            long adminUserId = (long)Session["LoginUserId"];
            long?cityId      = AdminUserService.GetById(adminUserId).CityId;

            if (cityId == null)
            {
                return(View("Error", (object)"总部人员不能管理房源"));
            }
            var regions            = RegionService.GetAll(cityId.Value);
            var roomTypes          = IdNameService.GetAll("户型");
            var statuses           = IdNameService.GetAll("房屋状态");
            var decorationStatuses = IdNameService.GetAll("装修状态");
            var types               = IdNameService.GetAll("房屋类别");
            var attachments         = AttachmentService.GetAll();
            HouseAddViewModel model = new HouseAddViewModel()
            {
                Regions         = regions,
                RoomTypes       = roomTypes,
                Statuses        = statuses,
                DecorateStatues = decorationStatuses,
                Types           = types,
                Attachments     = attachments
            };

            return(View(model));
        }
示例#4
0
        public ActionResult Add()
        {
            long?cityId = AdminHelper.GetCityId(this.HttpContext);

            if (cityId == null)
            {
                return(View("~/Views/Shared/Error.cshtml", (object)"总部人员无法管理房源!"));
            }

            var regions = RegionService.GetAll(cityId.Value);
            //var communitities = CommunitityService.
            var roomTypes                  = IdNameService.GetByTypeName("户型");
            var status                     = IdNameService.GetByTypeName("房屋状态");
            var decorateStatus             = IdNameService.GetByTypeName("装修状态");
            var types                      = IdNameService.GetByTypeName("房屋类别");
            HouseAddViewModel houseAddView = new HouseAddViewModel();

            houseAddView.Status         = status;
            houseAddView.DecorateStatus = decorateStatus;
            houseAddView.Regions        = regions;
            houseAddView.RoomTypes      = roomTypes;
            houseAddView.Types          = types;
            return(View(houseAddView));
        }