Ejemplo n.º 1
0
        override protected void OnInit(EventArgs e)
        {
            base.OnInit(e);
            if (errInitTemplates != "")
            {
                Response.Write(errInitTemplates);
                return;
            }

            //1获得模版基本信息
            BLL.wx_module_templates tBll = new BLL.wx_module_templates();
            templateFileName = tBll.GetTemplatesFileNameByWid("shop", wid);
            if (templateFileName == null || templateFileName.Trim() == "")
            {
                errInitTemplates = "不存在该帐号或者该帐号尚未设置模版!";
                Response.Write(errInitTemplates);
                Response.End();
                return;
            }

            BLL.wx_userweixin   bll     = new BLL.wx_userweixin();
            Model.wx_userweixin wxModel = bll.GetModel(wid);
            string thisUrl = MyCommFun.getTotalUrl();

            OAuth2BaseProc(wxModel, "cart", thisUrl);

            serverPath = MyCommFun.GetRootPath() + "/shop/templates/" + templateFileName + "/category.html";
            ShopTemplateMgr template = new ShopTemplateMgr("/shop/templates/" + templateFileName, serverPath, wid);

            template.tType  = TemplateType.Index;
            template.openid = MyCommFun.RequestOpenid();
            template.OutPutHtml(wid);
        }
Ejemplo n.º 2
0
        override protected void OnInit(EventArgs e)
        {
            base.OnInit(e);
            if (errInitTemplates != "")
            {
                Response.Write(errInitTemplates);
                return;
            }

            //1获得模版基本信息
            BLL.wx_module_templates tBll = new BLL.wx_module_templates();
            templateFileName = tBll.GetTemplatesFileNameByWid("shop", wid);
            if (templateFileName == null || templateFileName.Trim() == "")
            {
                errInitTemplates = "不存在该帐号或者该帐号尚未设置模版!";
                Response.Write(errInitTemplates);
                Response.End();
                return;
            }
            string _action = MyCommFun.QueryString("myact");

            if (_action == "editAddr")
            {
                EditAddr();
            }
            serverPath = MyCommFun.GetRootPath() + "/shop/templates/" + templateFileName + "/editaddr.html";
            ShopTemplateMgr template = new ShopTemplateMgr("/shop/templates/" + templateFileName, serverPath, wid);

            template.tType  = TemplateType.editaddr;
            template.openid = MyCommFun.RequestOpenid();
            template.OutPutHtml(wid);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 输出最终的html
        /// </summary>
        /// <param name="templateFileName"></param>
        /// <param name="tPath"></param>
        /// <param name="wid"></param>
        public void OutPutHtml(string templateFileName)
        {
            ////注册一个自定义函数
            //this.Document.RegisterGlobalFunction(this.GetNewsUrl);

            //对VT模板里的config变量赋值
            Model.siteconfig config = new BLL.siteconfig().loadConfig();
            string           dd     = Utils.ObjectToStr(config.webkeyword);

            this.Document.Variables.SetValue("config", config);

            this.Document.SetValue("ccright", ccRight);
            this.Document.SetValue("thisurl", MyCommFun.getTotalUrl());
            this.Document.SetValue("yuming", MyCommFun.getWebSite());
            string openid = MyCommFun.RequestOpenid();

            this.Document.SetValue("openid", openid);
            this.Document.Variables.SetValue("this", this);
            if (tType == TemplateType.Class)
            { //如果为列表页面
                ArticleClassPage();
            }
            if (tType == TemplateType.News)
            {
                ArticleDetailPage();
            }
            if (tType == TemplateType.Channel)
            {
                ArticleChannelPage();
            }

            //输出最终呈现的数据
            this.Document.Render(HttpContext.Current.Response.Output);
        }
Ejemplo n.º 4
0
        override protected void OnInit(EventArgs e)
        {
            base.OnInit(e);

            if (errInitTemplates != "")
            {
                Response.Write(errInitTemplates);
                return;
            }
            //1获得模版基本信息
            BLL.wx_templates tBll = new BLL.wx_templates();
            string           templateErJiFileName = tBll.GetErJiTemplatesFileNameByWid(wid);

            if (templateErJiFileName == null || templateErJiFileName.Trim() == "")
            {
                tPath = MyCommFun.GetRootPath() + "/templates/category/albums/category.html";
            }
            else
            {
                tPath = MyCommFun.GetRootPath() + "/templates/category/" + templateErJiFileName + "/category.html";
            }



            TemplateMgr template = new TemplateMgr(tPath, wid);

            template.tType  = TemplateType.Channel;
            template.openid = MyCommFun.RequestOpenid();
            template.OutPutHtml(templateErJiFileName, wid);
        }
Ejemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            openid = MyCommFun.RequestOpenid();
            int otid = MyCommFun.RequestInt("orderid");

            wid          = MyCommFun.RequestInt("wid");
            expireMinute = MyCommFun.RequestInt("expireminute");
            if (expireMinute == 0)
            {
                expireMinute = 30;
            }
            else if (expireMinute == -1)
            {  //如果为-1,则有限期间为1年
                expireMinute = 60 * 12 * 365;
            }
            if (openid == "" || otid == 0 || wid == 0)
            {
                return;
            }
            BLL.orders   otBll       = new BLL.orders();
            Model.orders orderEntity = otBll.GetModel(otid, wid);
            litout_trade_no.Text = orderEntity.order_no;
            litMoney.Text        = orderEntity.order_amount.ToString();
            litDate.Text         = orderEntity.add_time.ToString();
            WxPayData(orderEntity.order_amount, orderEntity.id.ToString(), orderEntity.order_no);
        }
Ejemplo n.º 6
0
        override protected void OnInit(EventArgs e)
        {
            base.OnInit(e);

            if (errInitTemplates != "")
            {
                Response.Write(errInitTemplates);
                return;
            }
            //1获得模版基本信息
            BLL.wx_templates tBll = new BLL.wx_templates();
            templateIndexFileName = tBll.GetTemplatesFileNameByWid(wid);
            if (templateIndexFileName == null || templateIndexFileName.Trim() == "")
            {
                errInitTemplates = "不存在该帐号或者该帐号尚未设置模版!";
                Response.Write(errInitTemplates);
                Response.End();
                return;
            }

            tPath = MyCommFun.GetRootPath() + "/templates/content/type1/content.html";
            TemplateMgr template = new TemplateMgr(tPath, wid);

            template.tType  = TemplateType.News;
            template.openid = MyCommFun.RequestOpenid();
            template.OutPutHtml("type1", wid);
        }
Ejemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            OnlyWeiXinLook();
            if (!IsPostBack)
            {
                wid    = MyCommFun.RequestInt("wid");
                id     = MyCommFun.RequestInt("id");
                openid = MyCommFun.RequestOpenid();
                if (wid == 0 || id == 0)
                {
                    MessageBox.Show(this, "参数不正确!");
                    return;
                }
                BLL.wx_yy_base   yyBll = new BLL.wx_yy_base();
                Model.wx_yy_base yuyue = yyBll.GetModel(id);

                if (yuyue.needPIC)
                {
                    StringBuilder sb = new StringBuilder("");
                    sb.Append(" <li class=\"nob\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"kuang\">\r\n<tr>");
                    sb.Append("  <th>图片 </th> <td> <input id=\"picUpload\" name=\"picUpload\" type=\"file\" accept=\"image/jpeg, image/jpg, image/png\"  onchange=\"my.changeImg(this, event, {base_url:'http://img.uweixin.cn/'});\"/><br />");
                    sb.Append(" <img src='\\images\\noneimg.jpg' id=\"img_show\" style=\"max-width:100px; max-height:80px;\"> </td> </tr> </tbody> </table> </li>");
                    litPic.Text = sb.ToString();
                }

                #region 预约的基本信息
                StringBuilder sbBase = new StringBuilder("");
                if (yuyue.picUrl != null && yuyue.picUrl.Trim() != "")
                {
                    sbBase.Append(" <div class=\"qiandaobanner\"><img src=\"" + yuyue.picUrl + "\"></div>\r\n");
                }

                if (yuyue.content != null && yuyue.content.Trim().Length > 0)
                {
                    sbBase.Append(" <ul class=\"round\"><li><h2>说明</h2><div class=\"text\">" + yuyue.content + "</div></li></ul>\r\n");
                }
                if (yuyue.phone != null && yuyue.phone.Trim() != "" && yuyue.addr != null && yuyue.addr.Trim() != "")
                {
                    //预约电话或者地址
                    sbBase.Append(" <ul class=\"round\">");

                    if (yuyue.addr != null && yuyue.addr.Trim() != "")
                    {
                        sbBase.Append("<li class=\"addr\"><span>" + yuyue.addr.Trim() + "</span></li>\r\n");
                    }
                    if (yuyue.phone != null && yuyue.phone.Trim() != "")
                    {
                        sbBase.Append("<li class=\"tel\"><a href=\"tel:" + yuyue.phone.Trim() + "\"><span>" + yuyue.phone.Trim() + " 电话</span> </a></li>\r\n");
                    }

                    sbBase.Append("</ul>");
                }

                litBaseInfo.Text = sbBase.ToString();
                #endregion

                this.Title = yuyue.title;
                BindControlers(id);
            }
        }
Ejemplo n.º 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            OnlyWeiXinLook();

            if (!IsPostBack)
            {
                wid    = MyCommFun.RequestInt("wid");
                tid    = MyCommFun.RequestInt("tid");
                openid = MyCommFun.RequestOpenid();
                if (wid == 0)
                {
                    MessageBox.Show(this, "参数不正确!");
                    return;
                }
                BLL.wx_albums_type   bll  = new BLL.wx_albums_type();
                Model.wx_albums_type type = bll.GetModel(tid);
                if (type != null && type.bannerPic != null && type.bannerPic.Trim() != "")
                {
                    litBanner.Text = "  <a href=\"javascript:;\"><img src=\"" + type.bannerPic + "\"></a> ";
                }
                BindAlbumsList();

                litCopyRight.Text = getwebcopyright(wid);
            }
        }
Ejemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string  ApiKey  = "4d88048525100566";//请把XXXXXX修改成您在快递100网站申请的APIKey
            string  expno   = Request["data"];
            string  typeCom = Request["com"];
            string  nu      = Request["nu"];
            string  openid  = MyCommFun.RequestOpenid();
            int     wid     = MyCommFun.RequestInt("wid");
            int     id      = MyCommFun.RequestInt("rid");
            DataSet ds      = null;
            express exBll   = new express();

            ds = exBll.GetList(wid, openid, id);
            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                typeCom = ds.Tables[0].Rows[0]["express_code"].ToString();
                nu      = ds.Tables[0].Rows[0]["express_no"].ToString();
            }

            string apiurl = "http://api.kuaidi100.com/api?id=" + ApiKey + "&com=" + typeCom + "&nu=" + nu + "&show=2&muti=1&order=asc";
            //Response.Write (apiurl);
            WebRequest   request  = WebRequest.Create(@apiurl);
            WebResponse  response = request.GetResponse();
            Stream       stream   = response.GetResponseStream();
            Encoding     encode   = Encoding.UTF8;
            StreamReader reader   = new StreamReader(stream, encode);
            string       detail   = reader.ReadToEnd();

            Response.Write(detail + "<br/>");
        }
Ejemplo n.º 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            OnlyWeiXinLook();
            if (!IsPostBack)
            {
                int    xid    = MyCommFun.RequestInt("xid");
                int    wid    = MyCommFun.RequestInt("wid");
                string openid = MyCommFun.RequestOpenid();
                if (wid == 0 || openid == "")
                {
                    MessageBox.Show(this, "参数不正确!");
                    return;
                }

                if (xid > 0 && wid > 0)
                {
                    BLL.wx_xt_base bll = new BLL.wx_xt_base();
                    xitie       = bll.GetModel(xid);
                    xitie.music = MyCommFun.getWebSite() + xitie.music;
                    this.Title  = xitie.wxTitle;
                    BLL.wx_xt_photo           pbll  = new BLL.wx_xt_photo();
                    IList <Model.wx_xt_photo> plist = pbll.GetModelList("bId=" + xid);
                    if (plist == null || plist.Count <= 0)
                    {
                        return;
                    }
                    for (int i = 0; i < plist.Count; i++)
                    {
                        photolistStr += "<li class=\"pb_10\"><img src=\"" + plist[i].pUrl + "\" style=\"width: 100%;\"></li>";
                    }
                }
            }
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 1 授权判断,页面跳转;
        /// 2 获取openid
        /// </summary>
        /// <param name="model"></param>
        /// <param name="state"></param>
        /// <param name="targetUrl">目标地址</param>
        public void OAuth2BaseProc(Model.wx_userweixin model, string state, string targetUrl)
        {
            string isTest = MyCommFun.getAppSettingValue("isOAuthTest");

            if (isTest == "1")
            {
                openid = MyCommFun.RequestOpenid();
                return;
            }

            string code = MyCommFun.QueryString("code");

            if (code == null || code.Trim() == "")
            {
                if (targetUrl == null || targetUrl.Trim() == "")
                {
                    targetUrl = MyCommFun.getTotalUrl();
                }
                //thisUrl = MyCommFun.getWebSite() + "/weixin/huodong/index.aspx";
                string newUrl = OAuthApi.GetAuthorizeUrl(model.AppId, targetUrl, state, OAuthScope.snsapi_base);
                Response.Redirect(newUrl);
            }
            else
            {
                if (MyCommFun.getCookie("cookie_openid") == "")
                {
                    var result = OAuthApi.GetAccessToken(model.AppId, model.AppSecret, code);
                    openid = result.openid;
                    MyCommFun.setCookie("cookie_openid", openid, 100);
                }
                openid = MyCommFun.getCookie("cookie_openid");
            }
        }
Ejemplo n.º 12
0
 /// <summary>
 /// 授权判断,页面跳转
 /// </summary>
 /// <param name="state"></param>
 /// <param name="targetUrl">目标地址</param>
 public void OAuth2BaseProc(Model.wx_userweixin model, string state, string targetUrl)
 {
     BLL.wx_property_info   propertyBll    = new BLL.wx_property_info();
     Model.wx_property_info propertyEntity = propertyBll.GetModelByIName(wid, MXEnums.WXPropertyKeyName.OpenOauth.ToString());
     if (propertyEntity.iContent == "0")
     {
         //关闭了网页授权
         openid = MyCommFun.RequestOpenid();
     }
     else
     {
         string code = MyCommFun.QueryString("code");
         if (code == null || code.Trim() == "")
         {
             if (targetUrl == null || targetUrl.Trim() == "")
             {
                 targetUrl = MyCommFun.getTotalUrl();
             }
             //thisUrl = MyCommFun.getWebSite() + "/weixin/huodong/index.aspx";
             string newUrl = OAuthApi.GetAuthorizeUrl(model.AppId, targetUrl, state, OAuthScope.snsapi_base);
             // WXLogs.AddLog(model.id, "OAuth授权跳转页面", "获得OAuth2BaseProc", newUrl);
             Response.Redirect(newUrl);
         }
         else
         {
             var result = OAuthApi.GetAccessToken(model.AppId, model.AppSecret, code);
             openid = result.openid;
         }
     }
 }
Ejemplo n.º 13
0
        override protected void OnInit(EventArgs e)
        {
            base.OnInit(e);
            if (errInitTemplates != "")
            {
                Response.Write(errInitTemplates);
                return;
            }

            //1获得模版基本信息
            BLL.wx_module_templates tBll = new BLL.wx_module_templates();
            templateFileName = tBll.GetTemplatesFileNameByWid("shop", wid);
            if (templateFileName == null || templateFileName.Trim() == "")
            {
                errInitTemplates = "不存在该帐号或者该帐号尚未设置模版!";
                Response.Write(errInitTemplates);
                Response.End();
                return;
            }
            MyCommFun.RequestOpenid();
            MyCommFun.getTotalUrl();

            serverPath = MyCommFun.GetRootPath() + "/shop/templates/" + templateFileName + "/index.html";
            ShopTemplateMgr template = new ShopTemplateMgr("/shop/templates/" + templateFileName, serverPath, wid);

            template.tType  = TemplateType.Index;
            template.openid = MyCommFun.RequestOpenid();
            template.OutPutHtml(wid);
        }
Ejemplo n.º 14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            openid = MyCommFun.RequestOpenid();
            if (!IsPostBack)
            {
                if (MyCommFun.RequestInt("tid") == 0)
                {
                    return;
                }

                BLL.wx_product_type   sbll = new BLL.wx_product_type();
                Model.wx_product_type type = sbll.GetModel(tid);
                if (type != null)
                {
                    imgBanner.ImageUrl = type.icoPic;
                    this.Title         = type.tName;
                }
                else
                {
                    imgBanner.Style.Add("display", "none");
                }
                BindData();
                BindRepeater(MyCommFun.RequestInt("page", 1));
            }
        }
Ejemplo n.º 15
0
        override protected void OnInit(EventArgs e)
        {
            base.OnInit(e);
            if (errInitTemplates != "")
            {
                Response.Write(errInitTemplates);
                return;
            }

            //1获得模版基本信息
            BLL.wx_book_templates tBll = new BLL.wx_book_templates();
            templateFileName = tBll.GetTemplatesFileNameByWid("book", wid);
            if (templateFileName == null || templateFileName.Trim() == "")
            {
                errInitTemplates = "不存在该帐号或者该帐号尚未设置模版!";
                Response.Write(errInitTemplates);
                Response.End();
                return;
            }


            serverPath = MyCommFun.GetRootPath() + "/book/templates/" + templateFileName + "/category.html";
            bookTemplateMgr template = new bookTemplateMgr("/book/templates/" + templateFileName, serverPath, wid);

            template.tType  = TemplateType.Class;
            template.openid = MyCommFun.RequestOpenid();
            template.OutPutHtml(wid);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            base.OnInit(e);
            if (errInitTemplates != "")
            {
                Response.Write(errInitTemplates);
                return;
            }

            //1获得模版基本信息
            BLL.wx_module_templates tBll = new BLL.wx_module_templates();
            templateFileName = tBll.GetTemplatesFileNameByWid("shop", wid);
            if (templateFileName == null || templateFileName.Trim() == "")
            {
                errInitTemplates = "不存在该帐号或者该帐号尚未设置模版!";
                Response.Write(errInitTemplates);
                Response.End();
                return;
            }

            serverPath = MyCommFun.GetRootPath() + "/shop/templates/" + templateFileName + "/order_success.html";
            ShopTemplateMgr template = new ShopTemplateMgr("/shop/templates/" + templateFileName, serverPath, wid);

            template.tType  = TemplateType.orderSuccess;
            template.openid = MyCommFun.RequestOpenid();
            template.OutPutHtml(wid);
        }
Ejemplo n.º 17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            OnlyWeiXinLook();
            if (!IsPostBack)
            {
                wid = MyCommFun.RequestInt("wid");

                openid = MyCommFun.RequestOpenid();
                if (wid == 0)
                {
                    MessageBox.Show(this, "参数不正确!");
                    return;
                }
                litCopyRight.Text = getwebcopyright(wid);

                BLL.wx_pano_jd           bll    = new  BLL.wx_pano_jd();
                IList <Model.wx_pano_jd> jdlist = bll.GetModelList("wid=" + wid + "  order by seq asc");
                if (jdlist == null || jdlist.Count <= 0)
                {
                    return;
                }
                StringBuilder sb = new StringBuilder("");
                for (int i = 0; i < jdlist.Count; i++)
                {
                    sb.Append("<li><a href=\"pano.aspx?id=" + jdlist[i].id + "\">" + jdlist[i].jdName + "</a></li>");
                }
                litpanoList.Text = sb.ToString();
            }
        }
Ejemplo n.º 18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        openid = MyCommFun.RequestOpenid();
        int otid = Convert.ToInt32(Request["orderid"].ToString());

        expireMinute = MyCommFun.RequestInt("expireminute");
        if (expireMinute == 0)
        {
            expireMinute = 30;
        }
        else if (expireMinute == -1)
        {  //如果为-1,则有限期间为1年
            expireMinute = 60 * 12 * 365;
        }
        //if (openid == "" || otid == 0 || wid == 0)
        //{
        //    return;
        //}
        Cms.BLL.C_order   otBll       = new Cms.BLL.C_order();
        Cms.Model.C_order orderEntity = otBll.GetModel(otid);
        order_num.Text = orderEntity.order_num;
        litMoney.Text  = Convert.ToDecimal(orderEntity.price_sum).ToString("0.00");
        litDate.Text   = orderEntity.updateTime.ToString();
        WxPayData(Convert.ToDecimal(orderEntity.price_sum), orderEntity.id.ToString(), orderEntity.order_num);

        FileHelper.Write(HttpRuntime.AppDomainAppPath + "\\log.txt", packageValue);
    }
Ejemplo n.º 19
0
 protected void Page_Load(object sender, EventArgs e)
 {
     OnlyWeiXinLook();
     if (!IsPostBack)
     {
         wid    = MyCommFun.RequestInt("wid");
         openid = MyCommFun.RequestOpenid();
         aid    = MyCommFun.RequestInt("aid");
         if (wid == 0 || aid == 0)
         {
             MessageBox.Show(this, "参数不正确!");
             return;
         }
         BLL.wx_albums_info aBll = new BLL.wx_albums_info();
         albums = aBll.GetModel(aid);
         if (albums != null)
         {
             if (albums.music != null && albums.music.Trim() != "")
             {
                 bgMusic = "  var audio = new Audio();  audio.src = \"" + MyCommFun.getWebSite() + albums.music.Trim() + "\";  audio.play();";
                 // bgMusic = "  var audio = new Audio();  audio.src = \"http://bcs.duapp.com/baemp3mp3/mp3/138305426164953243.mp3\";  audio.play();";
             }
         }
         BindPhotoList();
     }
 }
Ejemplo n.º 20
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/json";
            string _action = MyCommFun.QueryString("myact");
            int    id      = MyCommFun.RequestInt("id");
            string openid  = MyCommFun.RequestOpenid(); //得到微信用户的openid

            if (_action == "zf")
            {
                //转发
                Dictionary <string, string> jsonDict = new Dictionary <string, string>();

                BLL.wx_cards_gl   countgbll   = new BLL.wx_cards_gl();
                Model.wx_cards_gl cardscountg = new Model.wx_cards_gl();
                BLL.wx_cards      gbll        = new BLL.wx_cards();

                gbll.update(id);
                //转发记录
                cardscountg.cardsid = id;
                cardscountg.openid  = MyCommFun.QueryString("openid");
                countgbll.Add(cardscountg);

                jsonDict.Add("error", "ok");
                jsonDict.Add("content", "ok");
                context.Response.Write(MyCommFun.getJsonStr(jsonDict));
            }
        }
Ejemplo n.º 21
0
        public string getDetailUrl(object id, object tid)
        {
            string openid = MyCommFun.RequestOpenid();

            string ret = "detail.aspx?id=" + id.ToString() + "&openid=" + openid + "&tid=" + tid.ToString() + "&wid=" + wid;

            return(ret);
        }
Ejemplo n.º 22
0
        public string getTypeUrl(object tId)
        {
            string openid = MyCommFun.RequestOpenid();

            string ret = "index.aspx?openid=" + openid + "&tid=" + tId.ToString() + "&wid" + wid;

            return(ret);
        }
Ejemplo n.º 23
0
        private void EditAddr()
        {
            string openid    = MyCommFun.RequestOpenid(); //得到微信用户的openid
            string name      = MyCommFun.QueryString("name");
            int    wid       = MyCommFun.RequestInt("wid");
            string sprovince = MyCommFun.QueryString("pvid");
            string scity     = MyCommFun.QueryString("ctid");
            string regionId  = MyCommFun.QueryString("regionId");
            string address   = MyCommFun.QueryString("address");
            string mobile    = MyCommFun.QueryString("mobile");

            BLL.wx_shop_user_addr addrBll = new BLL.wx_shop_user_addr();
            List <WechatBuilder.Model.wx_shop_user_addr> addrlist = addrBll.GetOpenidAddr(openid, wid);

            WechatBuilder.Model.wx_shop_user_addr addr = new Model.wx_shop_user_addr();
            bool isAdd = true;

            if (addrlist == null || addrlist.Count <= 0)
            {
                //添加
                isAdd = true;
            }
            else
            {
                //修改
                addr  = addrlist[0];
                isAdd = false;
            }

            addr.addrDetail     = address;
            addr.wid            = wid;
            addr.openid         = openid;
            addr.province       = sprovince;
            addr.city           = scity;
            addr.area           = regionId;
            addr.tel            = mobile;
            addr.contractPerson = name;
            addr.createDate     = DateTime.Now;

            if (isAdd)
            {
                addrBll.Add(addr);
            }
            else
            {
                addrBll.Update(addr);
            }
            string frompage = MyCommFun.QueryString("frompage");

            if (frompage != "")
            {
                Response.Redirect(frompage + "?wid=" + wid + "&openid=" + openid);
            }
            else
            {
                Response.Redirect("editaddr.aspx?wid=" + wid + "&openid=" + openid);
            }
        }
Ejemplo n.º 24
0
        /// <summary>
        /// 输出最终的html
        /// </summary>
        /// <param name="templateFileName"></param>
        /// <param name="tPath"></param>
        /// <param name="wid"></param>
        public void OutPutHtml(string templateFileName, int wid)
        {
            //注册一个自定义函数
            this.Document.RegisterGlobalFunction(this.GetNewsUrl);

            //对VT模板里的config变量赋值
            Model.wxcodeconfig wxconfig = tDal.GetModelByWid(wid, "/templates/index/" + templateFileName);

            //if (wxconfig == null || wxconfig.sitename.Trim() == "")
            //{1e2124dd04e11d01b9df2865f85944be
            //    HttpContext.Current.Response.Write("请填写【微网站设置】相关信息");

            //}
            //else
            if (wxconfig.wxstatus == 0)
            {
                HttpContext.Current.Response.Write("帐号已过期!请及时充值!");
            }
            this.Document.Variables.SetValue("config", wxconfig);
            //获得幻灯片列表方法一:缺点无法从模版页面控制记录数量
            this.Document.Variables.SetValue("photo", tDal.GetHDPByWid(wid, -1));

            this.Document.SetValue("wid", wid);

            this.Document.SetValue("bottomtype", wxconfig.bmenuTid);
            this.Document.SetValue("ccright", ccRight);
            this.Document.SetValue("thisurl", MyCommFun.getTotalUrl());
            this.Document.SetValue("yuming", MyCommFun.getWebSite());
            string openid = MyCommFun.RequestOpenid();

            this.Document.SetValue("openid", openid);
            this.Document.Variables.SetValue("this", this);

            if (tType == TemplateType.Index)
            { //如果为首页页面
                this.Document.SetValue("fxTitle", wxconfig.sitename);
                this.Document.SetValue("fxDesc", wxconfig.wbrief);
                this.Document.SetValue("fxPic", MyCommFun.ImgAddHttp(wxconfig.bgpic));
            }

            if (tType == TemplateType.Class)
            { //如果为列表页面
                ArticleClassPage();
            }
            if (tType == TemplateType.News)
            {
                ArticleDetailPage();
            }
            if (tType == TemplateType.Channel)
            {
                CategoryPage();
            }

            //输出最终呈现的数据


            this.Document.Render(HttpContext.Current.Response.Output);
        }
Ejemplo n.º 25
0
 protected void Page_Load(object sender, EventArgs e)
 {
     wid    = MXRequest.GetQueryInt("wid");
     fid    = MXRequest.GetQueryInt("fid");
     openid = MyCommFun.RequestOpenid();
     if (!IsPostBack)
     {
         showInfo();
     }
 }
Ejemplo n.º 26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            wid    = MXRequest.GetQueryInt("wid");
            openid = MyCommFun.RequestOpenid();

            if (!IsPostBack)
            {
                BLL.wx_wsite_setting ws = new BLL.wx_wsite_setting();
                wsModel = ws.GetModelByWid(wid);
            }
        }
Ejemplo n.º 27
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/json";
            string _action = MyCommFun.QueryString("myact");
            string openid  = MyCommFun.RequestOpenid(); //得到微信用户的openid

            if (_action == "update")
            {
                try
                {
                    #region 提交手机
                    /// 提交手机号码
                    string tel     = MyCommFun.QueryString("tel");
                    string pwd     = MyCommFun.QueryString("pwd");
                    string snumber = MyCommFun.QueryString("snumber");
                    int    id      = MyCommFun.RequestInt("id");
                    int    aid     = MyCommFun.RequestInt("aid");
                    if (aid == 0 || id == 0 || snumber == "" || tel == "" || pwd == "")
                    {
                        context.Response.Write("{\"msg\":\"提交出现异常!!\",\"success\":\"0\"}");
                        return;
                    }
                    BLL.wx_sTicket actBll = new BLL.wx_sTicket();
                    if (!actBll.ExistsPwd(aid, pwd))
                    {
                        context.Response.Write("{\"msg\":\"商家兑换密码错误!!\",\"success\":\"0\"}");
                        return;
                    }


                    BLL.wx_sttAwardUser   ubll  = new BLL.wx_sttAwardUser();
                    Model.wx_sttAwardUser model = ubll.GetModel(id);
                    if (model == null)
                    {
                        context.Response.Write("{\"msg\":\"提交出现异常2!!\",\"success\":\"0\"}");
                        return;
                    }
                    model.uTel      = tel;
                    model.hasLingQu = true;
                    ubll.Update(model);

                    context.Response.Write("{\"msg\":\"提交成功!\",\"success\":\"1\"}");
                    return;

                    #endregion
                }
                catch
                {
                    context.Response.Write("{\"msg\":\"提交出现异常!!\",\"success\":\"0\"}");

                    return;
                }
            }
        }
Ejemplo n.º 28
0
        protected void Page_Load(object sender, EventArgs e)
        {
            wid    = MXRequest.GetQueryInt("wid");
            openid = MyCommFun.RequestOpenid();

            if (!IsPostBack)
            {
                BLL.wx_wq_xiaoshou xsBll = new BLL.wx_wq_xiaoshou();
                this.rptList.DataSource = xsBll.GetList(" wid=" + wid + " order by sort_id asc,id asc");
                this.rptList.DataBind();
            }
        }
Ejemplo n.º 29
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string openid = MyCommFun.RequestOpenid();
                int    id     = MyCommFun.RequestInt("aid");
                BLL.wx_purchase_customer customerbll = new BLL.wx_purchase_customer();
                BLL.wx_purchase_base     basebll     = new BLL.wx_purchase_base();
                customermodel = customerbll.GetModelopenid(openid);
                basemodel     = basebll.GetModel(id);

                if (basemodel != null)
                {
                    totalCount             = Convert.ToInt32(basemodel.totalCount);
                    limitCount             = Convert.ToInt32(basemodel.limitCount);
                    count                  = totalCount - customerbll.GetRecordCount(id);//剩余
                    this.totalCount1.Value = totalCount.ToString();
                    this.limitCount1.Value = limitCount.ToString();
                    this.count1.Value      = count.ToString();
                    huodname               = basemodel.activityName;
                    tuangj                 = Convert.ToInt32(basemodel.groupPrice);

                    yg = customerbll.GetRecordyg(openid, id);
                    int aa = limitCount - yg;
                    if (aa < 0)
                    {
                        aa = 0;
                    }
                    this.limit.Value = aa.ToString();
                    //
                }


                if (customermodel != null && customermodel.status == 0)
                {
                    this.sndiv.Visible      = true;
                    this.sn.Visible         = true;
                    this.sn.Value           = customermodel.sn;
                    this.customerName.Value = customermodel.customerName;
                    this.tel.Value          = customermodel.tel;

                    //   this.customerNum.Value = customermodel.customerNum.ToString();
                    customerNum        = customermodel.customerNum.ToString();
                    this.address.Value = customermodel.address;
                    this.Remark.Value  = customermodel.Remark;


                    this.pwddiv.Visible = true;

                    //this.pwd.Value = basemodel.shopsPwd;
                }
            }
        }
Ejemplo n.º 30
0
 protected void Page_Load(object sender, EventArgs e)
 {
     OnlyWeiXinLook();
     openid = MyCommFun.RequestOpenid();
     wid    = MyCommFun.RequestInt("wid");
     if (openid == "" || wid == 0)
     {
         hidStatus.Value  = "-1";
         hidErrInfo.Value = "参数错误";
         return;
     }
     bindData();
 }