예제 #1
0
        void GetHtmlPage()
        {
            string text = System.IO.File.ReadAllText(Server.MapPath("../ShopPage/CustomerManager.html"));

            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();
            string strWhere = string.Empty;
            List <OrderCustomer> ordercustomerModel = new List <OrderCustomer>();

            if (shopid != null && shopid != "")
            {
                shopid   = " and d.[SID]='" + shopid + "' ";
                strWhere = shopid;

                MSProductOrderDAL customerDal = new MSProductOrderDAL();
                DataSet           orderds     = customerDal.GetOrderUser(strWhere);
                if (orderds != null && orderds.Tables.Count > 0 && orderds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow row in orderds.Tables[0].Rows)
                    {
                        OrderCustomer customermodel = DataConvert.DataRowToModel <OrderCustomer>(row);
                        ordercustomerModel.Add(customermodel);
                    }
                }
            }

            context.TempData["customerlist"] = ordercustomerModel;
            context.TempData["cuid"]         = cuid;
            context.TempData["errorscript"]  = errorscript;
            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (null == Request.QueryString["id"])
            {
                return;
            }
            strThumbID = Common.Common.NoHtml(Request.QueryString["id"].ToString());

            DAL.Album.UserPhotoDAL dal = new DAL.Album.UserPhotoDAL();
            DataSet ds = dal.GetMyThumb(strThumbID);

            if (null != ds && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                //读取模板内容
                string text = System.IO.File.ReadAllText(Server.MapPath("Themes/PhotoList/PhotoPrint.html"));

                JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();
                context.TempData["title"]   = "照片信息";
                context.TempData["ThumbID"] = strThumbID;
                context.TempData["footer"]  = "奥琦微商易";

                JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
                t.Render(Response.Output);
            }
            else
            {
                Response.Write("<script>alert('所要打印的照片不存在!')</script>");
                Response.Write("<script>document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {	WeixinJSBridge.call('closeWindow');});</script>");
            }
        }
예제 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            List <Model.PublicService.PS_Service> liService = new List <Model.PublicService.PS_Service>();

            DAL.PublicService.PS_Service dal = new DAL.PublicService.PS_Service();

            DataSet ds = dal.GetServiceList();

            foreach (DataRow row in ds.Tables[0].Rows)
            {
                Model.PublicService.PS_Service model = DataConvert.DataRowToModel <Model.PublicService.PS_Service>(row);
                liService.Add(model);
            }

            //读取模板内容
            string text = System.IO.File.ReadAllText(Server.MapPath("../ServicePage/ServiceList.html"));

            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();

            context.TempData["title"]        = "便捷服务列表";
            context.TempData["product_list"] = liService;
            context.TempData["footer"]       = "奥琦微商易";

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
예제 #4
0
        void GetJCQuizList()
        {
            string strSiteID   = string.Empty;
            string strTitle    = string.Empty;
            string strTheme    = string.Empty;
            string strSiteCode = string.Empty;

            List <JC_Quiz> jcmodel  = new List <JC_Quiz>();
            JC_QuizDAL     dal      = new JC_QuizDAL();
            DataSet        jclistds = dal.GetJCQuizDataList("");

            foreach (DataRow row in jclistds.Tables[0].Rows)
            {
                JC_Quiz model = DataConvert.DataRowToModel <JC_Quiz>(row);
                jcmodel.Add(model);
            }

            //读取模板内容
            // string text = System.IO.File.ReadAllText(Server.MapPath("Themes/" + strTheme + "/NewHome.html"));
            string text = System.IO.File.ReadAllText(Server.MapPath("Themes/Quiz/QuizList.html"));

            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();

            context.TempData["title"]   = "2014巴西世界杯比赛日程表一览";
            context.TempData["siteid"]  = Session["siteid"];
            context.TempData["jcmodel"] = jcmodel;
            context.TempData["footer"]  = "奥琦微商易";

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
예제 #5
0
        void GetHtmlPage()
        {
            List <SaleManagerList> OrderModel = new List <SaleManagerList>();
            MSProductOrderDAL      orderDal   = new MSProductOrderDAL();
            string strWhere = string.Empty;

            if (cuid != null && cuid != "")
            {
                cuid = " and a.CustomerID='" + cuid + "' ";
            }
            strWhere = " and a.IsReceive=1 " + cuid;
            DataSet orderds = orderDal.GetSaleManager(strWhere);

            if (orderds != null && orderds.Tables.Count > 0 && orderds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow row in orderds.Tables[0].Rows)
                {
                    SaleManagerList salemodel = DataConvert.DataRowToModel <SaleManagerList>(row);
                    OrderModel.Add(salemodel);
                }
            }

            string text = System.IO.File.ReadAllText(Server.MapPath("../ShopPage/SaleManager.html"));

            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();

            context.TempData["orderlist"]   = OrderModel;
            context.TempData["cuid"]        = cuid;
            context.TempData["errorscript"] = errorscript;

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
예제 #6
0
        void GetHtmlPage()
        {
            string oid = string.Empty; MSOrderLogistics OLDetail = new MSOrderLogistics();

            if (Request["oid"] != null && Request["oid"] != "")
            {
                oid = Common.Common.NoHtml(Request["oid"]);
            }
            if (oid != null && oid != "")
            {
                MSOrderLogisticsDAL OLdetail = new MSOrderLogisticsDAL();
                DataSet             ds       = OLdetail.GetMSODetailByOID(oid);
                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                {
                    OLDetail = DataConvert.DataRowToModel <MSOrderLogistics>(ds.Tables[0].Rows[0]);
                }
            }
            else
            {
                errormsg = JQDialog.alertOKMsgBox(5, "无效的请求方式", "", "error");
            }
            string text = System.IO.File.ReadAllText(Server.MapPath("../ShopPage/CopyOrder.html"));

            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();

            context.TempData["errormsg"] = errormsg;
            context.TempData["oldetail"] = OLDetail;

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
예제 #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string strProductID = string.Empty;
            string strSiteCode  = string.Empty;

            if (null == Request.QueryString["id"])
            {
                return;
            }
            strProductID = Common.Common.NoHtml(Request.QueryString["id"].ToString());
            DAL.Album.PhotoWallDAL dal = new DAL.Album.PhotoWallDAL();
            DataSet ds = dal.GetUserThumb(strProductID);

            Model.Album.UserPhoto model = new Model.Album.UserPhoto();
            if (null != ds && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                model = DataConvert.DataRowToModel <Model.Album.UserPhoto>(ds.Tables[0].Rows[0]);
            }
            strSiteCode = model.SiteCode;

            //读取模板内容
            string text = System.IO.File.ReadAllText(Server.MapPath("Themes/PhotoWall/ThumbDetail.html"));

            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();

            context.TempData["sitecode"] = strSiteCode;
            context.TempData["title"]    = "照片信息";
            context.TempData["pDetail"]  = model;
            context.TempData["footer"]   = "奥琦微商易";

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
예제 #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string strOptionID = string.Empty;

            if (null == Request.QueryString["id"])
            {
                return;
            }
            strOptionID = Common.Common.NoHtml(Request.QueryString["id"].ToString());
            OptionDAL dal = new OptionDAL();
            DataSet   ds  = dal.getOptionDetail(strOptionID);

            VOTE_Option model = new VOTE_Option();

            if (null != ds && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                model = DataConvert.DataRowToModel <VOTE_Option>(ds.Tables[0].Rows[0]);
            }

            //读取模板内容
            string text = System.IO.File.ReadAllText(Server.MapPath("Themes/Vote/OptionDetail.html"));

            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();

            context.TempData["title"]   = "微商易";
            context.TempData["ADetail"] = model;
            context.TempData["footer"]  = "奥琦微商易";

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
예제 #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string strSiteCode   = string.Empty;
            string strCustomerID = string.Empty;

            if (null == Request.QueryString["SiteCode"] || null == Request.QueryString["CustomerID"])
            {
                if (null != Session["SiteCode"])
                {
                    Response.Redirect("Login.aspx?SiteCode=" + Session["SiteCode"].ToString(), false);
                }
                return;
            }
            strSiteCode   = Common.Common.NoHtml(Request.QueryString["SiteCode"].ToString());
            strCustomerID = Common.Common.NoHtml(Request.QueryString["CustomerID"].ToString());

            List <SP_MyCart> liCart = new List <SP_MyCart>();

            CartDAL dal = new CartDAL();
            //DataSet ds = dal.GetProductList("KM_HLF", "31A10FB1-43C2-48A3-A2BA-5B451DE13276");
            //?SiteCode=KM_HLF&CatID=31A10FB1-43C2-48A3-A2BA-5B451DE13276
            //?SiteCode=KM_HLF&CatID=02F25D57-1BA6-438A-B965-428160A0AA68
            DataSet ds = dal.GetMyCartList(strSiteCode, strCustomerID);

            foreach (DataRow row in ds.Tables[0].Rows)
            {
                //SP_ShoppingCart model = DataConvert.DataRowToModel<SP_ShoppingCart>(row);
                SP_MyCart model = DataConvert.DataRowToModel <SP_MyCart>(row);
                liCart.Add(model);
            }


            string strReturn = dal.GetMyCatSum(strSiteCode, strCustomerID);

            //读取模板内容
            string text = System.IO.File.ReadAllText(Server.MapPath("Themes/Default/MyCart.html"));

            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();

            context.TempData["title"] = "我的购物车";
            if (null == Session["strName"])
            {
                context.TempData["username"] = "******";
            }
            else
            {
                context.TempData["username"] = CustomerSession.strName;
            }
            context.TempData["sitecode"]   = strSiteCode;
            context.TempData["customerid"] = strCustomerID;
            context.TempData["cart_list"]  = liCart;
            context.TempData["footer"]     = "奥琦微商易";

            context.TempData["cs"] = strReturn.Split('|')[1].ToString();
            context.TempData["ps"] = strReturn.Split('|')[2].ToString();
            context.TempData["sp"] = strReturn.Split('|')[3].ToString();

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
예제 #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string text = System.IO.File.ReadAllText(Server.MapPath("../ShopPage/PromotionManager.html"));

            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();
            JinianNet.JNTemplate.Template        t       = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
예제 #11
0
        public void TestReflectionPage()
        {
            JinianNet.JNTemplate.TemplateContext ctx = new JinianNet.JNTemplate.TemplateContext();
            ctx.TempData.Push("func", new TemplateMethod());
            SiteInfo site = new SiteInfo();

            site.Copyright      = "&copy;2014 - 2015";
            site.Description    = "";
            site.Host           = "localhost";
            site.KeyWords       = "";
            site.Logo           = "";
            site.Name           = "xxx";
            site.SiteDirectory  = "";
            site.Theme          = "Blue";
            site.ThemeDirectory = "theme";
            site.Title          = "jntemplate测试页";
            site.Url            = string.Concat("http://localhost");

            if (!string.IsNullOrEmpty(site.SiteDirectory) && site.SiteDirectory != "/")
            {
                site.Url += "/" + site.SiteDirectory;
            }
            site.ThemeUrl = string.Concat(site.Url, "/", site.ThemeDirectory, "/", site.Theme);
            //ctx.TempData.Push("Model", );
            ctx.TempData.Push("Site", site);

            string basePath =
#if NET20 || NET40
                System.Environment.CurrentDirectory;
#else
                new DirectoryInfo(Directory.GetCurrentDirectory()).Parent.Parent.Parent.FullName;
#endif
            string path = basePath + "\\templets\\default";

            string html = null;
            var    conf = Configuration.EngineConfig.CreateDefault();
            Engine.Configure(conf);

            Stopwatch s = new Stopwatch();
            s.Start();
            for (var i = 0; i < MAX_RUN_COUNT; i++)
            {
                JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(ctx, System.IO.File.ReadAllText(path + "\\questionlist.html"));
                t.Context.CurrentPath = path;
                if (i == MAX_RUN_COUNT - 1)
                {
                    System.IO.File.WriteAllText(basePath + "\\result\\REFLECTION.html", t.Render());
                }
                else
                {
                    html = t.Render();
                }
            }
            s.Stop();
            string result = "\r\n运行耗时:" + s.ElapsedMilliseconds + "毫秒 反射(" + MAX_RUN_COUNT + "次)";
            System.IO.File.AppendAllText(basePath + "\\result\\ILVsReflection.txt", result);
            Assert.Equal(HTML_RESULT, html.Replace("\r", "").Replace("\t", "").Replace("\n", "").Replace(" ", ""));
        }
예제 #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //读取模板内容
            string text = System.IO.File.ReadAllText(Server.MapPath("Themes/Quiz/WorldCupMoFang.html"));

            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();
            JinianNet.JNTemplate.Template        t       = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
예제 #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string strSiteCode = string.Empty;
                string strOpenID   = string.Empty;

                //MyCoupon.aspx?sitecode=$sitecode&openid=$openid
                if (null == Request.QueryString["sitecode"])
                {
                    return;
                }
                else
                {
                    strSiteCode            = Common.Common.NoHtml(Request.QueryString["sitecode"].ToString());
                    Session["strSiteCode"] = strSiteCode;
                }

                if (null == Request.QueryString["openid"])
                {
                    return;
                }
                else
                {
                    if (Request.QueryString["openid"].ToString().Length > 29 || Request.QueryString["openid"].ToString().Length < 25)
                    {
                        strOpenID = Common.Common.NoHtml(Request.QueryString["openid"].ToString());
                    }
                    else
                    {
                        strOpenID = Request.QueryString["openid"].ToString();
                    }
                    Session["openid"] = strOpenID;
                }

                //取所有参加的活动列表
                List <MyCouponInfo> liCoupon = new List <MyCouponInfo>();
                CouponDAL           dalCoup  = new CouponDAL();
                DataSet             ds       = dalCoup.GetCouponInfoList(strSiteCode, strOpenID);

                if (null != ds && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow row in ds.Tables[0].Rows)
                    {
                        MyCouponInfo model = DataConvert.DataRowToModel <MyCouponInfo>(row);
                        liCoupon.Add(model);
                    }
                }

                string text = System.IO.File.ReadAllText(Server.MapPath("../ShopPage/MyCoupon.html"));
                JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();
                context.TempData["coupon_list"] = liCoupon;
                context.TempData["OpenID"]      = strOpenID;
                JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
                t.Render(Response.Output);
            }
        }
예제 #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (null != Request.QueryString["id"])
            {
                strOrderID = Common.Common.NoHtml(Request.QueryString["id"].ToString());
            }
            else
            {
                if (null != Session["strSiteCode"])
                {
                    Response.Redirect("Login.aspx?SiteCode='" + Session["strSiteCode"].ToString() + "'", false);
                }
                return;
            }

            List <SP_MyOrderDetail> liOrder = new List <SP_MyOrderDetail>();

            CartDAL dal = new CartDAL();

            DataSet ds = dal.GetOrderList(strOrderID);

            if (null != ds && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                iCs = ds.Tables[0].Rows.Count;
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    //SP_ShoppingCart model = DataConvert.DataRowToModel<SP_ShoppingCart>(row);
                    SP_MyOrderDetail model = DataConvert.DataRowToModel <SP_MyOrderDetail>(row);
                    iPs = iPs + model.Quantity;
                    dSp = dSp + model.Quantity * model.UnitCost;
                    liOrder.Add(model);
                }
            }
            //读取模板内容
            string text = System.IO.File.ReadAllText(Server.MapPath("Themes/Default/MyOrderDetail.html"));

            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();

            context.TempData["title"] = "订单详细信息";
            if (null == Session["strName"])
            {
                context.TempData["username"] = "******";
            }
            else
            {
                context.TempData["username"] = CustomerSession.strName;
            }
            context.TempData["order_list"] = liOrder;
            context.TempData["footer"]     = "奥琦微商易";

            context.TempData["cs"] = iCs.ToString();
            context.TempData["ps"] = iPs.ToString();
            context.TempData["sp"] = dSp.ToString();

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
예제 #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string strHouseID  = string.Empty;
                string strSiteCode = string.Empty;
                string siteid      = string.Empty;
                if (null == Request.QueryString["id"])
                {
                    return;
                }
                if (Request["siteid"] != null && Request["siteid"] != "")
                {
                    siteid = Request["siteid"];
                }
                #region 房屋详细
                strHouseID = Common.Common.NoHtml(Request.QueryString["id"].ToString());
                DC_HouseDAL dal   = new DC_HouseDAL();
                DataSet     ds    = dal.GetDCHouseDetail(strHouseID);
                DC_House    model = new DC_House();
                if (null != ds && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                {
                    model       = DataConvert.DataRowToModel <DC_House>(ds.Tables[0].Rows[0]);
                    strSiteCode = model.SiteCode;
                }
                #endregion

                #region 相关房屋列表
                List <DC_House> HouseList       = new List <DC_House>();
                DataSet         RelevantHouseDs = dal.GetRelevantHouseList(3, strHouseID);
                if (null != RelevantHouseDs && RelevantHouseDs.Tables.Count > 0 && RelevantHouseDs.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow row in RelevantHouseDs.Tables[0].Rows)
                    {
                        DC_House RelevantModel = DataConvert.DataRowToModel <DC_House>(row);
                        HouseList.Add(RelevantModel);
                    }
                }
                #endregion

                //读取模板内容
                string text = System.IO.File.ReadAllText(Server.MapPath("Themes/Realty/NewHomeDetail.html"));

                JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();

                context.TempData["sitecode"]      = strSiteCode;
                context.TempData["title"]         = "房产详细信息";
                context.TempData["HouseDetail"]   = model;
                context.TempData["siteid"]        = siteid;
                context.TempData["RelevantHouse"] = HouseList;
                context.TempData["footer"]        = "奥琦微商易";

                JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
                t.Render(Response.Output);
            }
        }
예제 #16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string strSiteCode = string.Empty;
            string strCatID    = string.Empty;

            if (null == Request.QueryString["SiteCode"])
            {
                return;
            }
            strSiteCode            = Common.Common.NoHtml(Request.QueryString["SiteCode"].ToString());
            Session["strSiteCode"] = strSiteCode;
            if (null == Request.QueryString["CatID"])
            {
                strCatID = string.Empty;
            }
            else
            {
                strCatID = Common.Common.NoHtml(Request.QueryString["CatID"].ToString());
            }

            List <SP_Product> liProduct = new List <SP_Product>();

            ProductDAL dal = new ProductDAL();
            //DataSet ds = dal.GetProductList("KM_HLF", "31A10FB1-43C2-48A3-A2BA-5B451DE13276");
            //?SiteCode=KM_HLF&CatID=31A10FB1-43C2-48A3-A2BA-5B451DE13276
            //?SiteCode=KM_HLF&CatID=02F25D57-1BA6-438A-B965-428160A0AA68
            DataSet ds = dal.GetProductList(strSiteCode, strCatID);

            foreach (DataRow row in ds.Tables[0].Rows)
            {
                SP_Product model = DataConvert.DataRowToModel <SP_Product>(row);
                liProduct.Add(model);
            }


            //读取模板内容
            string text = System.IO.File.ReadAllText(Server.MapPath("Themes/Default/ProductList.html"));

            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();

            context.TempData["sitecode"] = strSiteCode;
            context.TempData["title"]    = "商品列表";
            if (null == Session["strName"])
            {
                context.TempData["username"] = "******";
            }
            else
            {
                context.TempData["username"] = CustomerSession.strName;
            }
            context.TempData["product_list"] = liProduct;
            context.TempData["footer"]       = "奥琦微商易";

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
예제 #17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (null == Request.QueryString["sitecode"] && !string.IsNullOrEmpty(Request.QueryString["sitecode"].ToString()))
            {
                return;
            }
            if (null == Request.QueryString["openid"] && !string.IsNullOrEmpty(Request.QueryString["openid"].ToString()))
            {
                return;
            }

            string strSiteCode = Common.Common.NoHtml(Request.QueryString["sitecode"].ToString());
            string strOpenID   = string.Empty;

            if (Request.QueryString["openid"].ToString().Length > 29 || Request.QueryString["openid"].ToString().Length < 25)
            {
                strOpenID = Common.Common.NoHtml(Request.QueryString["openid"].ToString());
            }
            else
            {
                strOpenID = Request.QueryString["openid"].ToString();
            }

            //取最新抢购的优惠活动
            List <Model.JC.MyQuiz> liQuizScroe  = new List <Model.JC.MyQuiz>();
            JC_ScoreDAL            dalQuizScroe = new JC_ScoreDAL();

            DataSet ds = dalQuizScroe.GetJCScoreList(" a.OpenID = '" + strOpenID + "' ");

            if (null != ds && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    Model.JC.MyQuiz model = DataConvert.DataRowToModel <Model.JC.MyQuiz>(row);
                    liQuizScroe.Add(model);
                }
            }
            else
            {
                strInfo = "亲,你还没有参加过竞猜!";
            }
            //读取模板内容
            string text = System.IO.File.ReadAllText(Server.MapPath("Themes/Quiz/MyQuiz.html"));

            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();

            context.TempData["sitecode"]   = strSiteCode;
            context.TempData["openid"]     = strOpenID;
            context.TempData["title"]      = "竞猜列表";
            context.TempData["quizlist"]   = liQuizScroe;
            context.TempData["couponinfo"] = strInfo;
            context.TempData["footer"]     = "奥琦微商易";

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
예제 #18
0
        void getTemplate()
        {
            string text = System.IO.File.ReadAllText(Server.MapPath("HtmlPage/newtrends.html"));

            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();
            JinianNet.JNTemplate.Template        t       = new JinianNet.JNTemplate.Template(context, text);
            context.TempData["errorscript"] = errorscript;
            context.TempData["footer"]      = "奥琦微商易";
            t.Render(Response.Output);
        }
예제 #19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string strSiteCode = string.Empty;
            string strOpenID   = string.Empty;

            //if (null == Request["state"] || Request["state"] == "")
            if (null == Request.QueryString["state"])
            {
                return;
            }
            else
            {
                strSiteCode            = Common.Common.NoHtml(Request.QueryString["state"].ToString());
                Session["strSiteCode"] = strSiteCode;
            }

            string code = Request.QueryString["code"] as string;

            if (!string.IsNullOrEmpty(code))
            {
                WXConfigDAL           dal      = new WXConfigDAL();
                Model.WeiXin.WXConfig wxConfig = dal.GetWXConfigBySiteCode(strSiteCode);
                if (wxConfig != null)
                {
                    WeiXinCore.Models.WeiXinConfig weixinConfig = new WeiXinCore.Models.WeiXinConfig()
                    {
                        ID        = wxConfig.WXID,
                        Name      = wxConfig.WXName,
                        Token     = wxConfig.WXToken,
                        AppId     = wxConfig.WXAppID,
                        AppSecret = wxConfig.WXAppSecret
                    };
                    WeiXinCore.WeiXin weixin            = new WeiXinCore.WeiXin(weixinConfig);
                    Oauth2AccessToken oauth2AccessToken = weixin.GetOauth2AccessToken(code);
                    if (oauth2AccessToken != null)
                    {
                        strOpenID = oauth2AccessToken.OpenID;
                    }
                }
                else
                {
                    strOpenID = code;
                }
            }

            Session["OpenID"] = strOpenID;

            string text = System.IO.File.ReadAllText(Server.MapPath("../ShopPage/ChargeFee.html"));

            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();
            context.TempData["OpenID"] = strOpenID;
            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
예제 #20
0
        void GetInfo()
        {
            string text = System.IO.File.ReadAllText(Server.MapPath("../ShopPage/MyCostList.html"));

            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();

            context.TempData["errormsg"] = errormsg;

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
예제 #21
0
        void getHtmlpage()
        {
            string text = System.IO.File.ReadAllText(Server.MapPath("../ShopPage/ShopIndex.html"));

            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();

            context.TempData["errowmsg"] = errowmsg;

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
예제 #22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string strSiteID      = string.Empty;
            string strSiteCode    = string.Empty;
            string strTitle       = string.Empty;
            string strTheme       = string.Empty;
            string strAlbumTypeID = string.Empty;

            if (null == Request.QueryString["album"])
            {
                return;
            }
            strAlbumTypeID = Common.Common.NoHtml(Request.QueryString["album"].ToString());

            //取站点信息
            DAL.SYS.AccountDAL     dalAccount   = new DAL.SYS.AccountDAL();
            DAL.Album.PhotoWallDAL dalPhotoWall = new DAL.Album.PhotoWallDAL();

            DataSet dsAccount = dalPhotoWall.GetAccountData(strAlbumTypeID);

            if (null != dsAccount && dsAccount.Tables.Count > 0 && dsAccount.Tables[0].Rows.Count > 0)
            {
                strTheme               = dsAccount.Tables[0].Rows[0]["Themes"].ToString();
                strTitle               = dsAccount.Tables[0].Rows[0]["Name"].ToString();
                strSiteCode            = dsAccount.Tables[0].Rows[0]["SiteCode"].ToString();
                strSiteID              = dsAccount.Tables[0].Rows[0]["ID"].ToString();
                Session["strSiteCode"] = dsAccount.Tables[0].Rows[0]["SiteCode"].ToString();
            }

            //取站点相册列表
            DataSet dsThumbList = dalPhotoWall.GetPhotoWall(strAlbumTypeID);
            List <Model.Album.PhotoWall> lstThumb = new List <Model.Album.PhotoWall>();

            foreach (DataRow row in dsThumbList.Tables[0].Rows)
            {
                Model.Album.PhotoWall model = DataConvert.DataRowToModel <Model.Album.PhotoWall>(row);
                lstThumb.Add(model);
            }


            //读取模板内容
            string text = System.IO.File.ReadAllText(Server.MapPath("Themes/PhotoWall/ThumbList.html"));

            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();

            context.TempData["sitecode"] = strSiteCode;
            context.TempData["title"]    = "照片列表";
            context.TempData["lstThumb"] = lstThumb;
            context.TempData["footer"]   = "奥琦微商易";

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
예제 #23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //读取模板内容
            string text = System.IO.File.ReadAllText(Server.MapPath("Views/Index.html"));

            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();

            context.TempData["title"] = "便民服务";

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
예제 #24
0
        /// <summary>
        /// 获取模板
        /// </summary>
        void GetHtmlPage()
        {
            string text = System.IO.File.ReadAllText(Server.MapPath("../ShopPage/PrintImgOrder.html"));

            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();

            //context.TempData["artList"] = liArtList;
            context.TempData["errormsg"] = errormsg;

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
예제 #25
0
        void GetHtmlPage()
        {
            string text = System.IO.File.ReadAllText(Server.MapPath("../ShopPage/FindPassword.html"));

            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();

            context.TempData["errormsg"] = errormsg;
            context.TempData["openid"]   = strOpenID;

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
예제 #26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string strSiteID   = string.Empty;
            string strSiteCode = string.Empty;
            string strTitle    = string.Empty;
            string strTheme    = string.Empty;
            string strOpenID   = string.Empty;

            if (null == Request.QueryString["openid"])
            {
                return;
            }

            if (Request.QueryString["openid"].ToString().Length > 29 || Request.QueryString["openid"].ToString().Length < 25)
            {
                strOpenID = Common.Common.NoHtml(Request.QueryString["openid"].ToString());
            }
            else
            {
                strOpenID = Request.QueryString["openid"].ToString();
            }
            if (null == Request.QueryString["sitecode"])
            {
                return;
            }

            strSiteCode = Common.Common.NoHtml(Request.QueryString["sitecode"].ToString());

            //取站点相册列表
            DAL.Album.UserPhotoDAL dalUserPhoto = new DAL.Album.UserPhotoDAL();
            DataSet dsThumbList = dalUserPhoto.GetMyPhoto(strSiteCode, strOpenID);
            List <Model.Album.UserPhoto> lstThumb = new List <Model.Album.UserPhoto>();

            foreach (DataRow row in dsThumbList.Tables[0].Rows)
            {
                Model.Album.UserPhoto model = DataConvert.DataRowToModel <Model.Album.UserPhoto>(row);
                lstThumb.Add(model);
            }


            //读取模板内容
            string text = System.IO.File.ReadAllText(Server.MapPath("Themes/PhotoWall/MyThumbList.html"));

            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();

            context.TempData["sitecode"] = strSiteCode;
            context.TempData["title"]    = "我的照片";
            context.TempData["lstThumb"] = lstThumb;
            context.TempData["footer"]   = "奥琦微商易";

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
예제 #27
0
        void GetHtmlPage()
        {
            int vcoin = 0; int IsReceive = 0;
            List <MSVAcctDetail> vcoindetaillist         = new List <MSVAcctDetail>();

            if (struid != null && struid != "")
            {
                MSVAcctDAL       VAD = new MSVAcctDAL();
                MSVAcctDetailDAL MVA = new MSVAcctDetailDAL();
                #region -获取V币详细
                //try
                //{
                //    IsReceive = Convert.ToInt32(MVA.GetMSVAcctDetailByUID("IsReceive", struid).ToString());
                //}
                //catch (Exception)
                //{
                //}
                try
                {
                    vcoin = Convert.ToInt32(VAD.GetMSVAcct("V_Amont", struid).ToString());
                }
                catch (Exception)
                {
                }
                //if (IsReceive == 0)
                //{
                //    vcoin = 0;
                //}
                #endregion
                #region -获取用户V币详情列表
                string  vcoinwhere = " Where CustID='" + struid + "' ";
                DataSet detailds   = MVA.GetMSVAcctDetailList(vcoinwhere);
                if (detailds != null && detailds.Tables.Count > 0 && detailds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow item in detailds.Tables[0].Rows)
                    {
                        MSVAcctDetail vcoinmodel = DataConvert.DataRowToModel <MSVAcctDetail>(item);
                        vcoindetaillist.Add(vcoinmodel);
                    }
                }
                #endregion
            }
            string text = System.IO.File.ReadAllText(Server.MapPath("../ShopPage/Vcoin.html"));
            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();

            context.TempData["errormsg"]  = errormsg;
            context.TempData["vcoin"]     = vcoin;
            context.TempData["vcoinlist"] = vcoindetaillist;

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
예제 #28
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string strCouponID = string.Empty;
            string strSiteCode = string.Empty;
            string strAction   = string.Empty;

            if (null == Request.QueryString["id"])
            {
                return;
            }
            if (null != Request.QueryString["action"])
            {
                strCouponID = Common.Common.NoHtml(Request.QueryString["id"].ToString());
                strAction   = Common.Common.NoHtml(Request.QueryString["action"].ToString());
                if (strAction == "checkout")
                {
                    CheckOutCoupon(strCouponID);
                }
            }
            strCouponID = Common.Common.NoHtml(Request.QueryString["id"].ToString());
            CouponDAL dal = new CouponDAL();
            DataSet   ds  = dal.GetCouponInfo(strCouponID);

            MyCouponInfo model = new MyCouponInfo();

            if (null != ds && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                model = DataConvert.DataRowToModel <MyCouponInfo>(ds.Tables[0].Rows[0]);
            }

            string text = System.IO.File.ReadAllText(Server.MapPath("QRNotUse.html"));

            //读取模板内容
            if (model.CouponStatus == "未使用")
            {
                text = System.IO.File.ReadAllText(Server.MapPath("QRNotUse.html"));
            }
            else
            {
                text = System.IO.File.ReadAllText(Server.MapPath("QRIsUse.html"));
            }

            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();
            context.TempData["title"]   = "奥琦微商易优惠券";
            context.TempData["note"]    = model.ActTitle;
            context.TempData["id"]      = strCouponID;
            context.TempData["content"] = model.Remark;
            context.TempData["errinfo"] = strCouponInfo;
            context.TempData["footer"]  = "奥琦微商易";
            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
예제 #29
0
        /// <summary>
        /// 输出到页面
        /// </summary>
        void GetHtmlInfo()
        {
            string text = System.IO.File.ReadAllText(Server.MapPath("../ShopPage/PubProduct.html"));

            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();

            context.TempData["customid"]    = customerid;
            context.TempData["footer"]      = "奥琦微商易";
            context.TempData["errorscript"] = errorscript;

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
예제 #30
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string strProductID = string.Empty;
            string strSiteCode  = string.Empty;
            string strOpenID    = string.Empty;

            if (null == Request.QueryString["id"])
            {
                return;
            }
            if (null == Request.QueryString["sitecode"])
            {
                return;
            }
            if (null == Request.QueryString["openid"])
            {
                return;
            }
            strProductID = Common.Common.NoHtml(Request.QueryString["id"].ToString());
            strSiteCode  = Common.Common.NoHtml(Request.QueryString["sitecode"].ToString());
            if (Request.QueryString["openid"].ToString().Length > 29 || Request.QueryString["openid"].ToString().Length < 25)
            {
                return;
            }
            else
            {
                strOpenID = Request.QueryString["openid"].ToString();
            }
            DAL.MiniShop.MSProductDAL dal = new DAL.MiniShop.MSProductDAL();
            DataSet ds = dal.GetProductByID(strProductID);

            Model.MiniShop.MSVProduct model = new Model.MiniShop.MSVProduct();
            if (null != ds && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                model = DataConvert.DataRowToModel <Model.MiniShop.MSVProduct>(ds.Tables[0].Rows[0]);
            }

            //读取模板内容
            string text = System.IO.File.ReadAllText(Server.MapPath("Themes/Default/VProductDetail.html"));

            JinianNet.JNTemplate.TemplateContext context = new JinianNet.JNTemplate.TemplateContext();

            context.TempData["sitecode"] = strSiteCode;
            context.TempData["openid"]   = strOpenID;
            context.TempData["title"]    = "商品详细信息";
            context.TempData["pDetail"]  = model;
            context.TempData["footer"]   = "奥琦微商易";

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(context, text);
            t.Render(Response.Output);
        }
예제 #31
0
        public void TestILage()
        {
            JinianNet.JNTemplate.TemplateContext ctx = new JinianNet.JNTemplate.TemplateContext();
            ctx.TempData.Push("func", new TemplateMethod());
            SiteInfo site = new SiteInfo();
            site.Copyright = "&copy;2014 - 2015";
            site.Description = "";
            site.Host = "localhost";
            site.KeyWords = "";
            site.Logo = "";
            site.Name = "xxx";
            site.SiteDirectory = "";
            site.Theme = "Blue";
            site.ThemeDirectory = "theme";
            site.Title = "jntemplate测试页";
            site.Url = string.Concat("http://localhost");

            if (!string.IsNullOrEmpty(site.SiteDirectory) && site.SiteDirectory != "/")
            {
                site.Url += "/" + site.SiteDirectory;
            }
            site.ThemeUrl = string.Concat(site.Url, "/", site.ThemeDirectory, "/", site.Theme);
            //ctx.TempData.Push("Model", );
            ctx.TempData.Push("Site", site);

            string basePath = new System.IO.DirectoryInfo(System.Environment.CurrentDirectory).Parent.Parent.FullName;
            string path = basePath + "\\templets\\default";

            var conf = Configuration.EngineConfig.CreateDefault();
            conf.CachingProvider = "JinianNet.JNTemplate.Caching.MemoryCache";
            Engine.Configure(conf);

            for (var i = 0; i < 20000; i++)
            {
                JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(ctx, System.IO.File.ReadAllText(path + "\\questionlist.html"));
                t.Context.CurrentPath = path;
                t.Render();

            }
        }
예제 #32
0
        public void TestPage()
        {
            JinianNet.JNTemplate.TemplateContext ctx = new JinianNet.JNTemplate.TemplateContext();

            ctx.TempData.Push("func", new TemplateMethod());

            SiteInfo site = new SiteInfo();
            site.Copyright = "&copy;2014 - 2015";
            site.Description = "";
            site.Host = "localhost";
            site.KeyWords = "";
            site.Logo = "";
            site.Name = "xxx";
            site.SiteDirectory = "";
            site.Theme = "Blue";
            site.ThemeDirectory = "theme";
            site.Title = "jntemplate测试页";
            site.Url = string.Concat("http://localhost");

            if (!string.IsNullOrEmpty(site.SiteDirectory) && site.SiteDirectory != "/")
            {
                site.Url += "/" + site.SiteDirectory;
            }
            site.ThemeUrl = string.Concat(site.Url, "/", site.ThemeDirectory, "/", site.Theme);
            //ctx.TempData.Push("Model", );
            ctx.TempData.Push("Site", site);

            string basePath = new System.IO.DirectoryInfo(System.Environment.CurrentDirectory).Parent.Parent.FullName;
            string path = basePath + "\\templets\\default";

            JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(ctx, System.IO.File.ReadAllText(path + "\\questionlist.html"));
            t.Context.CurrentPath = path;

            string result = t.Render();

            //可直接查看项目录下的html/jnt.html 文件效果
            System.IO.File.WriteAllText(basePath + "\\html\\jnt.html", result);
        }
예제 #33
0
        public void TestILVsReflectionPage()
        {
            JinianNet.JNTemplate.TemplateContext ctx = new JinianNet.JNTemplate.TemplateContext();
            ctx.TempData.Push("func", new TemplateMethod());
            SiteInfo site = new SiteInfo();
            site.Copyright = "&copy;2014 - 2015";
            site.Description = "";
            site.Host = "localhost";
            site.KeyWords = "";
            site.Logo = "";
            site.Name = "xxx";
            site.SiteDirectory = "";
            site.Theme = "Blue";
            site.ThemeDirectory = "theme";
            site.Title = "jntemplate测试页";
            site.Url = string.Concat("http://localhost");

            if (!string.IsNullOrEmpty(site.SiteDirectory) && site.SiteDirectory != "/")
            {
                site.Url += "/" + site.SiteDirectory;
            }
            site.ThemeUrl = string.Concat(site.Url, "/", site.ThemeDirectory, "/", site.Theme);
            //ctx.TempData.Push("Model", );
            ctx.TempData.Push("Site", site);

            string basePath = new System.IO.DirectoryInfo(System.Environment.CurrentDirectory).Parent.Parent.FullName;
            string path = basePath + "\\templets\\default";
               // JinianNet.JNTemplate.Dynamic.IDynamicHelpers h;
            Configuration.EngineConfig conf;

            string text1 = null, text2 = null;
            string result="";
            Stopwatch s = new Stopwatch();
            s.Start();
            s.Stop();
            ////////////////////////////////////////////////////////////////////////////////////
            //h = new JinianNet.JNTemplate.Dynamic.ILHelpers();
            conf = Configuration.EngineConfig.CreateDefault();
            //conf.CachingProvider = "JinianNet.JNTemplate.Test.UserCache,JinianNet.JNTemplate.Test";
            conf.CachingProvider = "JinianNet.JNTemplate.Caching.MemoryCache";
            Engine.Configure(conf);
            s.Restart();

            for (var i = 0; i < 1000; i++)
            {
                JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(ctx, System.IO.File.ReadAllText(path + "\\questionlist.html"));

                t.Context.CurrentPath = path;
                text1 = t.Render();

            }
            s.Stop();
            result += "IL 1000次运行 耗时 :" + s.ElapsedMilliseconds + "毫秒";
            ////////////////////////////////////////////////////////////////////////////////////

            GC.Collect();

            ////////////////////////////////////////////////////////////////////////////////////
            //h = new JinianNet.JNTemplate.Dynamic.ReflectionHelpers();
            conf = Configuration.EngineConfig.CreateDefault();
            conf.CachingProvider = null;
            Engine.Configure(conf);
            s.Restart();
            for (var i = 0; i < 1000; i++)
            {
                JinianNet.JNTemplate.Template t = new JinianNet.JNTemplate.Template(ctx, System.IO.File.ReadAllText(path + "\\questionlist.html"));

                t.Context.CurrentPath = path;
                text2 = t.Render();
                //h.ExcuteMethod(DateTime.Now, "AddDays", new object[] { 30 });
            }
            s.Stop();
            result += ": Reflection 1000次运行 耗时 :" + s.ElapsedMilliseconds + "毫秒";
            ////////////////////////////////////////////////////////////////////////////////////

            System.IO.File.WriteAllText(basePath + "\\html\\ILVsReflection.txt", result);
            System.IO.File.WriteAllText(basePath + "\\html\\ILVsReflection1.txt", text1);
            System.IO.File.WriteAllText(basePath + "\\html\\ILVsReflection2.txt", text2);
            Assert.AreEqual(text1, text2);
        }