Ejemplo n.º 1
0
        protected override void Render(HtmlTextWriter writer)
        {
            try
            {
                
                //using (WCFFactory<IHtmlEngine> ChannelFactory = WCFFactory<IHtmlEngine>.GetFactorty())
                //{
                //    IHtmlEngine proxy = ChannelFactory.CreateChannel();

                //    Dictionary<string, object> dictionary = new Dictionary<string, object>();
                //    dictionary.Add("TemplateId", templateid);
                //    PageTemplateBLL templateBll = Factory.BusinessFactory.CreateBll<PageTemplateBLL>();

                //    TemplateBModel template = templateBll.Get(dictionary).ToBModel();
                //    result = proxy.GetHTMLByTemplate(template, true)[0];
                //}


                string result = HtmlServer.GetTemplagePreview(int.Parse(templateid), reDate);

                writer.Write(result);
                writer.Write("<script type=\"text/javascript\" src=\"js/preview.js\"></script>");
            }
            catch (Exception ex)
            {
                Loger.Error(ex, string.Format("模板预览出错,tempalteId={0}", templateid));
                throw ex;
            }
        }