示例#1
0
        private void CreateStaticPage(long houseId)
        {
            HouseIndexViewModel houseIndexView = null;

            HouseDTO house = HouseService.GetById(houseId);

            if (house == null)
            {
                return;
            }

            var housePics   = HousePicService.GetPics(houseId);
            var attachments = AttachmentService.GetAttachment(houseId);

            houseIndexView = new HouseIndexViewModel
            {
                House       = house,
                HousePics   = housePics,
                Attachments = attachments
            };
            this.ControllerContext.Controller.ViewData.Model = houseIndexView;
            string html = WebCommonHelper.RendViewToString(
                this.ControllerContext,
                "~/views/House/StaticIndex.cshtml",
                "");

            System.IO.File.AppendAllText(String.Format(@"D:\PersonalWorkSpace\github\ZSZ\ZSZ.FrontWeb\{0}.html", houseId), html);
        }