Exemplo n.º 1
0
        /// <summary>
        /// 输出最终的html
        /// </summary>
        /// <param name="templateFileName"></param>
        /// <param name="tPath"></param>
        /// <param name="wid"></param>
        public void OutPutHtml(int wid)
        {
            //注册一个自定义函数
            this.Document.RegisterGlobalFunction(this.ComputeMoney);

            //对VT模板里的config变量赋值
            Model.wxcodeconfig wxconfig = tDal.GetModelByWid(wid, tPath);
            if (wxconfig.wxstatus == 0)
            {
                HttpContext.Current.Response.Write("帐号已过期!请及时充值!");
            }
            this.Document.Variables.SetValue("config", wxconfig);

            BLL.wx_shop_setting setBll = new BLL.wx_shop_setting();
            if (!setBll.ExistsWid(wid))
            {
                HttpContext.Current.Response.Write("请先选择模版!");
                HttpContext.Current.Response.End();
            }
            Model.wx_shop_setting setting = setBll.GetModelList("wid=" + wid)[0];

            this.Document.Variables.SetValue("shopconfig", setting);

            this.Document.SetValue("wid", wid);
            this.Document.SetValue("ccright", ccRight);
            this.Document.SetValue("yuming", MyCommFun.getWebSite());
            this.Document.SetValue("thisurl", MyCommFun.getTotalUrl());
            this.Document.SetValue("indexurl", indexUrl());
            this.Document.SetValue("categoryurl", MyCommFun.urlAddOpenid("/shop/category.aspx?wid=" + wid, openid));
            this.Document.SetValue("carturl", "/shop/cart.aspx?wid=" + wid);
            this.Document.SetValue("userurl", "/shop/userinfo.aspx?wid=" + wid);
            this.Document.SetValue("openid", openid);
            this.Document.Variables.SetValue("this", this);
            if (tType == TemplateType.Class)
            {
                ProductClassPage();
            }
            else if (tType == TemplateType.News)
            {
                ShopDetailPage();
            }
            else if (tType == TemplateType.Cart)
            {
                CartDetailPage();
            }
            else if (tType == TemplateType.confirmOrder)
            {
                confirmOrder();
            }
            else if (tType == TemplateType.editaddr)
            {
                editAddrPage();
            }
            else if (tType == TemplateType.orderSuccess)
            {
                OrderSuccessPage();
            }
            else if (tType == TemplateType.userinfo)
            {
                userinfoPage();
            }
            else if (tType == TemplateType.orderDetail)
            {  //订单详情页面
                orderDetail();
            }

            //输出最终呈现的数据
            this.Document.Render(HttpContext.Current.Response.Output);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 输出最终的html
        /// </summary>
        /// <param name="templateFileName"></param>
        /// <param name="tPath"></param>
        /// <param name="wid"></param>
        public void OutPutHtml(int wid)
        {
            //注册一个自定义函数
            this.Document.RegisterGlobalFunction(this.ComputeMoney);

            //对VT模板里的config变量赋值
            Model.wxcodeconfig wxconfig = tDal.GetModelByWid(wid, tPath);
            if (wxconfig.wxstatus == 0)
            {
                HttpContext.Current.Response.Write("帐号已过期!请及时充值!");
            }
            this.Document.Variables.SetValue("config", wxconfig);

            BLL.wx_shop_setting setBll = new BLL.wx_shop_setting();
            if (!setBll.ExistsWid(wid))
            {
                HttpContext.Current.Response.Write("请先选择模版!");
                HttpContext.Current.Response.End();
            }
            Model.wx_shop_setting setting = setBll.GetModelList("wid="+wid)[0];

            this.Document.Variables.SetValue("shopconfig", setting);

            this.Document.SetValue("wid", wid);
            this.Document.SetValue("ccright", ccRight);
            this.Document.SetValue("yuming", MyCommFun.getWebSite());
            this.Document.SetValue("thisurl", MyCommFun.getTotalUrl());
            this.Document.SetValue("indexurl", indexUrl());
            this.Document.SetValue("categoryurl", MyCommFun.urlAddOpenid("/shop/category.aspx?wid=" + wid, openid));
            this.Document.SetValue("carturl", MyCommFun.urlAddOpenid("/shop/cart.aspx?wid=" + wid, openid));
            this.Document.SetValue("userurl", MyCommFun.urlAddOpenid("/shop/userinfo.aspx?wid=" + wid, openid));
            this.Document.SetValue("openid", openid);
            this.Document.Variables.SetValue("this", this);
            if (tType == TemplateType.Class)
            {
                ProductClassPage();
            }
            else if (tType == TemplateType.News)
            {
                ShopDetailPage();
            }
            else if (tType == TemplateType.Cart)
            {
                CartDetailPage();
            }
            else   if (tType == TemplateType.confirmOrder)
            {
                confirmOrder();
            }
            else  if (tType == TemplateType.editaddr)
            {
                editAddrPage();
            }
            else if (tType == TemplateType.orderSuccess)
            {
                OrderSuccessPage();
            }
            else if (tType == TemplateType.userinfo)
            {
                userinfoPage();
            }
            else if (tType == TemplateType.orderDetail)
            {  //订单详情页面
                orderDetail();
            }

            //输出最终呈现的数据
            this.Document.Render(HttpContext.Current.Response.Output);
        }