Exemplo n.º 1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string str  = this.txtAliAppId.Text.Trim();
            string str2 = this.txtAliFollowTitle.Text.Trim();

            if (str.Length < 14)
            {
                this.ShowMsg("请输入正确的AppId信息!", false);
            }
            else if (str2.Length < 2)
            {
                this.ShowMsg("关注消息,请不要留空,2个字符以上!", false);
            }
            else
            {
                SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
                if (masterSettings.AlipayAppid != str)
                {
                    MemberHelper.ClearAllAlipayopenId();
                    ScanHelp.ClearScanBind("ALIPAY");
                }
                masterSettings.AlipayAppid           = str;
                masterSettings.AliOHFollowRelayTitle = str2;
                SettingsManager.Save(masterSettings);
                AlipayFuwuConfig.CommSetConfig(str, base.Server.MapPath("~/"), "GBK");
                this.ShowMsg("服务窗配置保存成功!", true);
                this.BindData();
            }
        }
Exemplo n.º 2
0
        public override AbstractResponse OnEvent_SubscribeRequest(SubscribeEventRequest subscribeEventRequest)
        {
            string text = "";

            if (subscribeEventRequest.EventKey != null)
            {
                text = subscribeEventRequest.EventKey;
            }
            if (text.Contains("qrscene_"))
            {
                text = text.Replace("qrscene_", "").Trim();
                if (text == "1")
                {
                    if (WeiXinHelper.BindAdminOpenId.Count > 10)
                    {
                        WeiXinHelper.BindAdminOpenId.Clear();
                    }
                    if (WeiXinHelper.BindAdminOpenId.ContainsKey(subscribeEventRequest.Ticket))
                    {
                        WeiXinHelper.BindAdminOpenId[subscribeEventRequest.Ticket] = subscribeEventRequest.FromUserName;
                    }
                    else
                    {
                        WeiXinHelper.BindAdminOpenId.Add(subscribeEventRequest.Ticket, subscribeEventRequest.FromUserName);
                    }
                    return(new TextResponse
                    {
                        CreateTime = System.DateTime.Now,
                        Content = "您正在扫描尝试绑定管理员身份,身份已识别",
                        ToUserName = subscribeEventRequest.FromUserName,
                        FromUserName = subscribeEventRequest.ToUserName
                    });
                }
                ScanInfos scanInfosByTicket = ScanHelp.GetScanInfosByTicket(subscribeEventRequest.Ticket);
                Globals.Debuglog(text + ":" + subscribeEventRequest.Ticket, "_Debuglog.txt");
                if (!MemberProcessor.IsExitOpenId(subscribeEventRequest.FromUserName) && scanInfosByTicket != null && scanInfosByTicket.BindUserId > 0)
                {
                    this.CreatMember(subscribeEventRequest.FromUserName, scanInfosByTicket.BindUserId);
                    ScanHelp.updateScanInfosLastActiveTime(System.DateTime.Now, scanInfosByTicket.Sceneid);
                }
            }
            WeiXinHelper.UpdateRencentOpenID(subscribeEventRequest.FromUserName);
            Hidistro.Entities.VShop.ReplyInfo subscribeReply = ReplyHelper.GetSubscribeReply();
            if (subscribeReply == null)
            {
                return(null);
            }
            subscribeReply.Keys = "登录";
            AbstractResponse response = this.GetResponse(subscribeReply, subscribeEventRequest.FromUserName);

            if (response == null)
            {
                this.GotoManyCustomerService(subscribeEventRequest);
            }
            response.ToUserName   = subscribeEventRequest.FromUserName;
            response.FromUserName = subscribeEventRequest.ToUserName;
            return(response);
        }
Exemplo n.º 3
0
        public override AbstractResponse OnEvent_ScanRequest(ScanEventRequest scanEventRequest)
        {
            string eventKey = scanEventRequest.EventKey;

            if (eventKey == "1")
            {
                if (WeiXinHelper.BindAdminOpenId.Count > 10)
                {
                    WeiXinHelper.BindAdminOpenId.Clear();
                }
                if (WeiXinHelper.BindAdminOpenId.ContainsKey(scanEventRequest.Ticket))
                {
                    WeiXinHelper.BindAdminOpenId[scanEventRequest.Ticket] = scanEventRequest.FromUserName;
                }
                else
                {
                    WeiXinHelper.BindAdminOpenId.Add(scanEventRequest.Ticket, scanEventRequest.FromUserName);
                }
                return(new TextResponse {
                    CreateTime = DateTime.Now, Content = "您正在扫描尝试绑定管理员身份,身份已识别", ToUserName = scanEventRequest.FromUserName, FromUserName = scanEventRequest.ToUserName
                });
            }
            ScanInfos scanInfosByTicket = ScanHelp.GetScanInfosByTicket(scanEventRequest.Ticket);

            Globals.Debuglog(eventKey + ":" + scanEventRequest.Ticket, "_Debuglog.txt");
            bool flag = MemberProcessor.IsExitOpenId(scanEventRequest.FromUserName);

            if ((!flag && (scanInfosByTicket != null)) && (scanInfosByTicket.BindUserId > 0))
            {
                this.CreatMember(scanEventRequest.FromUserName, scanInfosByTicket.BindUserId);
            }
            if (scanInfosByTicket != null)
            {
                ScanHelp.updateScanInfosLastActiveTime(DateTime.Now, scanInfosByTicket.Sceneid);
            }
            if (flag)
            {
                return(new TextResponse {
                    CreateTime = DateTime.Now, Content = "您刚扫描了分销商公众号二维码!", ToUserName = scanEventRequest.FromUserName, FromUserName = scanEventRequest.ToUserName
                });
            }
            Hidistro.Entities.VShop.ReplyInfo subscribeReply = ReplyHelper.GetSubscribeReply();
            if (subscribeReply == null)
            {
                return(null);
            }
            subscribeReply.Keys = "扫描";
            AbstractResponse response = this.GetResponse(subscribeReply, scanEventRequest.FromUserName);

            response.ToUserName   = scanEventRequest.FromUserName;
            response.FromUserName = scanEventRequest.ToUserName;
            return(response);
        }
Exemplo n.º 4
0
        protected void btnSave_Click(object sender, System.EventArgs e)
        {
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);

            if (masterSettings.WeixinAppId != this.txtAppId.Text.Trim())
            {
                WeiXinHelper.ClearWeiXinMediaID();
                MemberHelper.ClearAllOpenId();
                ScanHelp.ClearScanBind("WX");
            }
            masterSettings.WeixinAppId     = this.txtAppId.Text.Trim();
            masterSettings.WeixinAppSecret = this.txtAppSecret.Text.Trim();
            SettingsManager.Save(masterSettings);
            Globals.RefreshWeiXinToken();
            this.ShowMsgAndReUrl("修改成功", true, "WXConfigBindOK.aspx");
        }
Exemplo n.º 5
0
        protected string GetImgUrl()
        {
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);
            string       pattern        = "ReferralId=(?<url>d+)";
            string       input          = base.Request.UrlReferrer.ToString();

            System.Text.RegularExpressions.Match match = System.Text.RegularExpressions.Regex.Match(input, pattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase);
            if (match.Success)
            {
                this.ReferralId = match.Value;
            }
            int       num               = Globals.ToNum(this.ReferralId);
            string    result            = this.webStart + "/Follow.aspx?ReferralId=" + this.ReferralId;
            ScanInfos scanInfosByUserId = ScanHelp.GetScanInfosByUserId(num, 0, "WX");

            if (scanInfosByUserId == null)
            {
                ScanHelp.CreatNewScan(num, "WX", 0);
                scanInfosByUserId = ScanHelp.GetScanInfosByUserId(num, 0, "WX");
            }
            if (scanInfosByUserId != null && !string.IsNullOrEmpty(scanInfosByUserId.CodeUrl))
            {
                result = BarCodeApi.GetQRImageUrlByTicket(scanInfosByUserId.CodeUrl);
            }
            else
            {
                if (string.IsNullOrEmpty(masterSettings.WeixinAppId) || string.IsNullOrEmpty(masterSettings.WeixinAppSecret))
                {
                    return("");
                }
                string token_Message = TokenApi.GetToken_Message(masterSettings.WeixinAppId, masterSettings.WeixinAppSecret);
                if (TokenApi.CheckIsRightToken(token_Message))
                {
                    string text = BarCodeApi.CreateTicket(token_Message, scanInfosByUserId.Sceneid, "QR_LIMIT_SCENE", "2592000");
                    if (!string.IsNullOrEmpty(text))
                    {
                        result = BarCodeApi.GetQRImageUrlByTicket(text);
                        scanInfosByUserId.CodeUrl        = text;
                        scanInfosByUserId.CreateTime     = System.DateTime.Now;
                        scanInfosByUserId.LastActiveTime = System.DateTime.Now;
                        ScanHelp.updateScanInfosCodeUrl(scanInfosByUserId);
                    }
                }
            }
            return(result);
        }
Exemplo n.º 6
0
        protected string GetImgUrl()
        {
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);
            string       pattern        = "ReferralId=(?<url>d+)";
            Match        match          = Regex.Match(base.Request.UrlReferrer.ToString(), pattern, RegexOptions.IgnoreCase);

            if (match.Success)
            {
                this.ReferralId = match.Value;
            }
            int       userid             = Globals.ToNum(this.ReferralId);
            string    qRImageUrlByTicket = this.webStart + "/Follow.aspx?ReferralId=" + this.ReferralId;
            ScanInfos info = ScanHelp.GetScanInfosByUserId(userid, 0, "WX");

            if (info == null)
            {
                ScanHelp.CreatNewScan(userid, "WX", 0);
                info = ScanHelp.GetScanInfosByUserId(userid, 0, "WX");
            }
            if ((info != null) && !string.IsNullOrEmpty(info.CodeUrl))
            {
                return(BarCodeApi.GetQRImageUrlByTicket(info.CodeUrl));
            }
            if (string.IsNullOrEmpty(masterSettings.WeixinAppId) || string.IsNullOrEmpty(masterSettings.WeixinAppSecret))
            {
                return("");
            }
            string token = TokenApi.GetToken_Message(masterSettings.WeixinAppId, masterSettings.WeixinAppSecret);

            if (TokenApi.CheckIsRightToken(token))
            {
                string str5 = BarCodeApi.CreateTicket(token, info.Sceneid, "QR_LIMIT_SCENE", "2592000");
                if (!string.IsNullOrEmpty(str5))
                {
                    qRImageUrlByTicket  = BarCodeApi.GetQRImageUrlByTicket(str5);
                    info.CodeUrl        = str5;
                    info.CreateTime     = DateTime.Now;
                    info.LastActiveTime = DateTime.Now;
                    ScanHelp.updateScanInfosCodeUrl(info);
                }
            }
            return(qRImageUrlByTicket);
        }
Exemplo n.º 7
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("店铺推广");
            int        num           = Globals.RequestQueryNum("ReferralId");
            MemberInfo currentMember = MemberProcessor.GetCurrentMember();

            if (num > 0 && currentMember == null)
            {
                this.Page.Response.Redirect("/default.aspx?ReferralId=" + num);
                this.Page.Response.End();
            }
            if (!int.TryParse(this.Page.Request.QueryString["UserId"], out this.userId))
            {
                base.GotoResourceNotFound("");
            }
            DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(this.userId);

            if (userIdDistributors == null)
            {
                base.GotoResourceNotFound("");
            }
            this.litStroeDesc = (System.Web.UI.WebControls.Literal) this.FindControl("litStroeDesc");
            this.litLinkurl   = (System.Web.UI.WebControls.Literal) this.FindControl("litLinkurl");
            this.litStoreurl  = (System.Web.UI.WebControls.Literal) this.FindControl("litStoreurl");
            string text = Globals.FullPath("/Default.aspx?ReferralId=" + this.userId);

            this.litLinkurl.Text  = text;
            this.litStoreurl.Text = text;
            this.Logoimage        = (System.Web.UI.WebControls.Image) this.FindControl("Logoimage");
            this.storeCode        = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("storeCode");
            this.storeFollowCode  = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("storeFollowCode");
            if (!string.IsNullOrEmpty(userIdDistributors.Logo))
            {
                this.Logoimage.ImageUrl = Globals.HostPath(this.Page.Request.Url) + userIdDistributors.Logo;
            }
            else
            {
                userIdDistributors.Logo = "/Utility/pics/headLogo.jpg";
            }
            this.storeCode.Src       = "/Api/CreatQRCode.ashx?code=" + Globals.UrlEncode(text) + "&Logo=" + userIdDistributors.Logo;
            this.storeFollowCode.Src = "";
            ScanInfos scanInfosByUserId = ScanHelp.GetScanInfosByUserId(this.userId, 0, "WX");

            if (scanInfosByUserId == null)
            {
                ScanHelp.CreatNewScan(this.userId, "WX", 0);
                scanInfosByUserId = ScanHelp.GetScanInfosByUserId(this.userId, 0, "WX");
            }
            string text2 = "";

            if (scanInfosByUserId != null && !string.IsNullOrEmpty(scanInfosByUserId.CodeUrl))
            {
                text2 = BarCodeApi.GetQRImageUrlByTicket(scanInfosByUserId.CodeUrl);
            }
            else
            {
                SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);
                string       token_Message  = TokenApi.GetToken_Message(masterSettings.WeixinAppId, masterSettings.WeixinAppSecret);
                if (TokenApi.CheckIsRightToken(token_Message))
                {
                    string text3 = BarCodeApi.CreateTicket(token_Message, scanInfosByUserId.Sceneid, "QR_LIMIT_SCENE", "2592000");
                    if (!string.IsNullOrEmpty(text3))
                    {
                        text2 = BarCodeApi.GetQRImageUrlByTicket(text3);
                        scanInfosByUserId.CodeUrl        = text3;
                        scanInfosByUserId.CreateTime     = System.DateTime.Now;
                        scanInfosByUserId.LastActiveTime = System.DateTime.Now;
                        ScanHelp.updateScanInfosCodeUrl(scanInfosByUserId);
                    }
                }
            }
            if (!string.IsNullOrEmpty(text2))
            {
                this.storeFollowCode.Src = "/Api/CreatQRCode.ashx?Combin=" + Globals.UrlEncode(text2) + "&Logo=" + userIdDistributors.Logo;
            }
            else
            {
                this.storeFollowCode.Src = "";
            }
            this.litStroeName      = (System.Web.UI.WebControls.Literal) this.FindControl("litStroeName");
            this.litStroeName.Text = userIdDistributors.StoreName;
            this.litStroeDesc.Text = userIdDistributors.StoreDescription;
        }
Exemplo n.º 8
0
        public override AbstractResponse OnEvent_ScanRequest(ScanEventRequest scanEventRequest)
        {
            string eventKey = scanEventRequest.EventKey;

            if (eventKey == "1")
            {
                if (WeiXinHelper.BindAdminOpenId.Count > 10)
                {
                    WeiXinHelper.BindAdminOpenId.Clear();
                }
                if (WeiXinHelper.BindAdminOpenId.ContainsKey(scanEventRequest.Ticket))
                {
                    WeiXinHelper.BindAdminOpenId[scanEventRequest.Ticket] = scanEventRequest.FromUserName;
                }
                else
                {
                    WeiXinHelper.BindAdminOpenId.Add(scanEventRequest.Ticket, scanEventRequest.FromUserName);
                }
                return(new TextResponse
                {
                    CreateTime = System.DateTime.Now,
                    Content = "您正在扫描尝试绑定管理员身份,身份已识别",
                    ToUserName = scanEventRequest.FromUserName,
                    FromUserName = scanEventRequest.ToUserName
                });
            }
            ScanInfos scanInfosByTicket = ScanHelp.GetScanInfosByTicket(scanEventRequest.Ticket);

            Globals.Debuglog(eventKey + ":" + scanEventRequest.Ticket, "_Debuglog.txt");
            bool flag = MemberProcessor.IsExitOpenId(scanEventRequest.FromUserName);

            if (!flag && scanInfosByTicket != null && scanInfosByTicket.BindUserId > 0)
            {
                this.CreatMember(scanEventRequest.FromUserName, scanInfosByTicket.BindUserId, "");
            }
            if (scanInfosByTicket != null)
            {
                ScanHelp.updateScanInfosLastActiveTime(System.DateTime.Now, scanInfosByTicket.Sceneid);
            }
            string text = "";

            System.Data.DataSet dataSet = new System.Data.DataSet();
            string text2 = System.Web.HttpContext.Current.Server.MapPath("/config/WifiConfig.xml");

            if (System.IO.File.Exists(text2))
            {
                dataSet.ReadXml(text2);
                if (dataSet != null && dataSet.Tables.Count > 0)
                {
                    foreach (System.Data.DataRow dataRow in dataSet.Tables[0].Rows)
                    {
                        if (dataRow["id"].ToString() == eventKey)
                        {
                            text = string.Concat(new string[]
                            {
                                dataRow["WifiDescribe"].ToString(),
                                "\r\nWIFI帐号:",
                                dataRow["WifiName"].ToString(),
                                "\r\n WIFI密码:",
                                dataRow["WifiPwd"].ToString()
                            });
                        }
                    }
                }
            }
            if (text != "")
            {
                return(new TextResponse
                {
                    CreateTime = System.DateTime.Now,
                    Content = text,
                    ToUserName = scanEventRequest.FromUserName,
                    FromUserName = scanEventRequest.ToUserName
                });
            }
            if (flag)
            {
                return(new TextResponse
                {
                    CreateTime = System.DateTime.Now,
                    Content = "您刚扫描了分销商公众号二维码!",
                    ToUserName = scanEventRequest.FromUserName,
                    FromUserName = scanEventRequest.ToUserName
                });
            }
            Hidistro.Entities.VShop.ReplyInfo subscribeReply = ReplyHelper.GetSubscribeReply();
            if (subscribeReply == null)
            {
                return(null);
            }
            subscribeReply.Keys = "扫描";
            AbstractResponse response = this.GetResponse(subscribeReply, scanEventRequest.FromUserName);

            response.ToUserName   = scanEventRequest.FromUserName;
            response.FromUserName = scanEventRequest.ToUserName;
            return(response);
        }
Exemplo n.º 9
0
        public override AbstractResponse OnEvent_ClickRequest(ClickEventRequest clickEventRequest)
        {
            string userOpenId = clickEventRequest.FromUserName;

            WeiXinHelper.UpdateRencentOpenID(userOpenId);
            AbstractResponse result;

            try
            {
                int menuId = System.Convert.ToInt32(clickEventRequest.EventKey);
                Hidistro.Entities.VShop.MenuInfo menu = VShopHelper.GetMenu(menuId);
                if (menu == null)
                {
                    result = null;
                }
                else
                {
                    if (menu.BindType == BindType.StoreCard)
                    {
                        try
                        {
                            SiteSettings siteSettings = SettingsManager.GetMasterSettings(false);
                            string       access_token = TokenApi.GetToken(siteSettings.WeixinAppId, siteSettings.WeixinAppSecret);
                            access_token = JsonConvert.DeserializeObject <Token>(access_token).access_token;
                            MemberInfo member = MemberProcessor.GetOpenIdMember(userOpenId, "wx");
                            if (member == null)
                            {
                                this.CreatMember(userOpenId, 0, access_token);
                                member = MemberProcessor.GetOpenIdMember(userOpenId, "wx");
                            }
                            string           userHead        = member.UserHead;
                            string           storeLogo       = siteSettings.DistributorLogoPic;
                            string           webStart        = Globals.GetWebUrlStart();
                            string           imageUrl        = "/Storage/master/DistributorCards/MemberCard" + member.UserId + ".jpg";
                            string           mediaid         = string.Empty;
                            int              ReferralId      = 0;
                            string           storeName       = siteSettings.SiteName;
                            string           NotSuccessMsg   = string.Empty;
                            DistributorsInfo distributorInfo = DistributorsBrower.GetDistributorInfo(member.UserId);
                            if (distributorInfo != null)
                            {
                                ReferralId = member.UserId;
                                if (siteSettings.IsShowDistributorSelfStoreName)
                                {
                                    storeName = distributorInfo.StoreName;
                                    storeLogo = distributorInfo.Logo;
                                }
                                imageUrl = "/Storage/master/DistributorCards/StoreCard" + ReferralId + ".jpg";
                            }
                            else if (!siteSettings.IsShowSiteStoreCard)
                            {
                                string content = "您还不是分销商,不能为您生成推广图片,立即<a href='" + webStart + "/Vshop/DistributorCenter.aspx'>申请分销商</a>";
                                if (!string.IsNullOrEmpty(siteSettings.ToRegistDistributorTips))
                                {
                                    content = System.Text.RegularExpressions.Regex.Replace(siteSettings.ToRegistDistributorTips, "{{申请分销商}}", "<a href='" + webStart + "/Vshop/DistributorCenter.aspx'>申请分销商</a>");
                                }
                                result = new TextResponse
                                {
                                    CreateTime   = System.DateTime.Now,
                                    ToUserName   = userOpenId,
                                    FromUserName = clickEventRequest.ToUserName,
                                    Content      = content
                                };
                                return(result);
                            }
                            string postData = string.Empty;
                            string creatingStoreCardTips = siteSettings.CreatingStoreCardTips;
                            if (!string.IsNullOrEmpty(creatingStoreCardTips))
                            {
                                postData = string.Concat(new string[]
                                {
                                    "{\"touser\":\"",
                                    userOpenId,
                                    "\",\"msgtype\":\"text\",\"text\":{\"content\":\"",
                                    Globals.String2Json(creatingStoreCardTips),
                                    "\"}}"
                                });
                                NewsApi.KFSend(access_token, postData);
                            }
                            string filePath = System.Web.HttpContext.Current.Request.MapPath(imageUrl);
                            Task.Factory.StartNew(delegate
                            {
                                try
                                {
                                    System.IO.File.Exists(filePath);
                                    string setJson = System.IO.File.ReadAllText(System.Web.HttpRuntime.AppDomainAppPath + "/Storage/Utility/StoreCardSet.js");
                                    string codeUrl = webStart + "/Follow.aspx?ReferralId=" + ReferralId.ToString();
                                    ScanInfos scanInfosByUserId = ScanHelp.GetScanInfosByUserId(ReferralId, 0, "WX");
                                    if (scanInfosByUserId == null)
                                    {
                                        ScanHelp.CreatNewScan(ReferralId, "WX", 0);
                                        scanInfosByUserId = ScanHelp.GetScanInfosByUserId(ReferralId, 0, "WX");
                                    }
                                    if (scanInfosByUserId != null && !string.IsNullOrEmpty(scanInfosByUserId.CodeUrl))
                                    {
                                        codeUrl = BarCodeApi.GetQRImageUrlByTicket(scanInfosByUserId.CodeUrl);
                                    }
                                    else
                                    {
                                        string token_Message = TokenApi.GetToken_Message(siteSettings.WeixinAppId, siteSettings.WeixinAppSecret);
                                        if (TokenApi.CheckIsRightToken(token_Message))
                                        {
                                            string text = BarCodeApi.CreateTicket(token_Message, scanInfosByUserId.Sceneid, "QR_LIMIT_SCENE", "2592000");
                                            if (!string.IsNullOrEmpty(text))
                                            {
                                                codeUrl = BarCodeApi.GetQRImageUrlByTicket(text);
                                                scanInfosByUserId.CodeUrl        = text;
                                                scanInfosByUserId.CreateTime     = System.DateTime.Now;
                                                scanInfosByUserId.LastActiveTime = System.DateTime.Now;
                                                ScanHelp.updateScanInfosCodeUrl(scanInfosByUserId);
                                            }
                                        }
                                    }
                                    StoreCardCreater storeCardCreater = new StoreCardCreater(setJson, userHead, storeLogo, codeUrl, member.UserName, storeName, ReferralId, member.UserId);
                                    if (storeCardCreater.ReadJson() && storeCardCreater.CreadCard(out NotSuccessMsg))
                                    {
                                        if (ReferralId > 0)
                                        {
                                            DistributorsBrower.UpdateStoreCard(ReferralId, NotSuccessMsg);
                                        }
                                        string media_IDByPath = NewsApi.GetMedia_IDByPath(access_token, webStart + imageUrl);
                                        mediaid = NewsApi.GetJsonValue(media_IDByPath, "media_id");
                                    }
                                    else
                                    {
                                        Globals.Debuglog(NotSuccessMsg, "_DebugCreateStoreCardlog.txt");
                                    }
                                    postData = string.Concat(new string[]
                                    {
                                        "{\"touser\":\"",
                                        userOpenId,
                                        "\",\"msgtype\":\"image\",\"image\":{\"media_id\":\"",
                                        mediaid,
                                        "\"}}"
                                    });
                                    NewsApi.KFSend(access_token, postData);
                                }
                                catch (System.Exception ex3)
                                {
                                    postData = string.Concat(new string[]
                                    {
                                        "{\"touser\":\"",
                                        userOpenId,
                                        "\",\"msgtype\":\"text\",\"text\":{\"content\":\"生成图片失败,",
                                        Globals.String2Json(ex3.ToString()),
                                        "\"}}"
                                    });
                                    NewsApi.KFSend(access_token, postData);
                                }
                            });
                            result = null;
                            return(result);
                        }
                        catch (System.Exception ex)
                        {
                            result = new TextResponse
                            {
                                CreateTime   = System.DateTime.Now,
                                ToUserName   = userOpenId,
                                FromUserName = clickEventRequest.ToUserName,
                                Content      = "问题:" + ex.ToString()
                            };
                            return(result);
                        }
                    }
                    Hidistro.Entities.VShop.ReplyInfo reply = ReplyHelper.GetReply(menu.ReplyId);
                    if (reply == null)
                    {
                        result = null;
                    }
                    else
                    {
                        if (reply.MessageType != MessageType.Image)
                        {
                            AbstractResponse keyResponse = this.GetKeyResponse(reply.Keys, clickEventRequest);
                            if (keyResponse != null)
                            {
                                result = keyResponse;
                                return(result);
                            }
                        }
                        AbstractResponse response = this.GetResponse(reply, clickEventRequest.FromUserName);
                        if (response == null)
                        {
                            this.GotoManyCustomerService(clickEventRequest);
                        }
                        response.ToUserName   = clickEventRequest.FromUserName;
                        response.FromUserName = clickEventRequest.ToUserName;
                        result = response;
                    }
                }
            }
            catch (System.Exception ex2)
            {
                result = new TextResponse
                {
                    CreateTime   = System.DateTime.Now,
                    ToUserName   = clickEventRequest.FromUserName,
                    FromUserName = clickEventRequest.ToUserName,
                    Content      = "问题:" + ex2.ToString()
                };
            }
            return(result);
        }
Exemplo n.º 10
0
        public override AbstractResponse OnEvent_SubscribeRequest(SubscribeEventRequest subscribeEventRequest)
        {
            string text = "";

            MemberProcessor.UpdateUserFollowStateByOpenId(subscribeEventRequest.FromUserName, 1);
            if (subscribeEventRequest.EventKey != null)
            {
                text = subscribeEventRequest.EventKey;
            }
            if (text.Contains("qrscene_"))
            {
                text = text.Replace("qrscene_", "").Trim();
                if (text == "1")
                {
                    if (WeiXinHelper.BindAdminOpenId.Count > 10)
                    {
                        WeiXinHelper.BindAdminOpenId.Clear();
                    }
                    if (WeiXinHelper.BindAdminOpenId.ContainsKey(subscribeEventRequest.Ticket))
                    {
                        WeiXinHelper.BindAdminOpenId[subscribeEventRequest.Ticket] = subscribeEventRequest.FromUserName;
                    }
                    else
                    {
                        WeiXinHelper.BindAdminOpenId.Add(subscribeEventRequest.Ticket, subscribeEventRequest.FromUserName);
                    }
                    return(new TextResponse
                    {
                        CreateTime = System.DateTime.Now,
                        Content = "您正在扫描尝试绑定管理员身份,身份已识别",
                        ToUserName = subscribeEventRequest.FromUserName,
                        FromUserName = subscribeEventRequest.ToUserName
                    });
                }
                ScanInfos scanInfosByTicket = ScanHelp.GetScanInfosByTicket(subscribeEventRequest.Ticket);
                bool      flag = MemberProcessor.IsExitOpenId(subscribeEventRequest.FromUserName);
                int       num  = scanInfosByTicket.BindUserId;
                if (num < 0)
                {
                    num = 0;
                }
                if (!flag && scanInfosByTicket != null)
                {
                    this.CreatMember(subscribeEventRequest.FromUserName, num, "");
                    ScanHelp.updateScanInfosLastActiveTime(System.DateTime.Now, scanInfosByTicket.Sceneid);
                }
            }
            else
            {
                bool flag2 = MemberProcessor.IsExitOpenId(subscribeEventRequest.FromUserName);
                Globals.Debuglog("关注公众号1", "_DebuglogConcern.txt");
                int num2 = 0;
                if (num2 < 0)
                {
                    num2 = 0;
                }
                if (!flag2)
                {
                    Globals.Debuglog("关注公众号生成用户1", "_DebuglogConcern.txt");
                    this.CreatMember(subscribeEventRequest.FromUserName, num2, "");
                }
            }
            WeiXinHelper.UpdateRencentOpenID(subscribeEventRequest.FromUserName);
            string text2 = "";

            System.Data.DataSet dataSet = new System.Data.DataSet();
            string text3 = System.Web.HttpContext.Current.Server.MapPath("/config/WifiConfig.xml");

            if (System.IO.File.Exists(text3))
            {
                dataSet.ReadXml(text3);
                if (dataSet != null && dataSet.Tables.Count > 0)
                {
                    foreach (System.Data.DataRow dataRow in dataSet.Tables[0].Rows)
                    {
                        if (dataRow["id"].ToString() == text)
                        {
                            text2 = string.Concat(new string[]
                            {
                                dataRow["WifiDescribe"].ToString(),
                                "\r\nWIFI帐号:",
                                dataRow["WifiName"].ToString(),
                                "\r\n WIFI密码:",
                                dataRow["WifiPwd"].ToString()
                            });
                        }
                    }
                }
            }
            if (text2 != "")
            {
                return(new TextResponse
                {
                    CreateTime = System.DateTime.Now,
                    Content = text2,
                    ToUserName = subscribeEventRequest.FromUserName,
                    FromUserName = subscribeEventRequest.ToUserName
                });
            }
            Hidistro.Entities.VShop.ReplyInfo subscribeReply = ReplyHelper.GetSubscribeReply();
            if (subscribeReply == null)
            {
                return(null);
            }
            subscribeReply.Keys = "登录";
            AbstractResponse response = this.GetResponse(subscribeReply, subscribeEventRequest.FromUserName);

            if (response == null)
            {
                this.GotoManyCustomerService(subscribeEventRequest);
            }
            response.ToUserName   = subscribeEventRequest.FromUserName;
            response.FromUserName = subscribeEventRequest.ToUserName;
            return(response);
        }
Exemplo n.º 11
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("店铺推广");
            int userid = Globals.RequestQueryNum("ReferralId");

            if (!int.TryParse(this.Page.Request.QueryString["UserId"], out this.userId))
            {
                this.Page.Response.Redirect("/default.aspx?ReferralId=" + userid);
                this.Page.Response.End();
            }
            DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(this.userId);

            if (userIdDistributors == null)
            {
                this.Page.Response.Redirect("/default.aspx?ReferralId=" + this.userId.ToString());
                this.Page.Response.End();
            }
            else
            {
                SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);
                bool         isShowDistributorSelfStoreName = masterSettings.IsShowDistributorSelfStoreName;
                userid            = userIdDistributors.UserId;
                this.litStroeDesc = (Literal)this.FindControl("litStroeDesc");
                this.litLinkurl   = (Literal)this.FindControl("litLinkurl");
                this.litStoreurl  = (Literal)this.FindControl("litStoreurl");
                string urlToEncode = Globals.FullPath("/Default.aspx?ReferralId=" + userid);
                this.litLinkurl.Text  = urlToEncode;
                this.litStoreurl.Text = urlToEncode;
                this.Logoimage        = (Image)this.FindControl("Logoimage");
                this.storeCode        = (HtmlImage)this.FindControl("storeCode");
                this.storeFollowCode  = (HtmlImage)this.FindControl("storeFollowCode");
                if (!string.IsNullOrEmpty(userIdDistributors.Logo))
                {
                    this.Logoimage.ImageUrl = Globals.HostPath(this.Page.Request.Url) + userIdDistributors.Logo;
                }
                else
                {
                    userIdDistributors.Logo = "/Utility/pics/headLogo.jpg";
                }
                this.storeCode.Src = "/Api/CreatQRCode.ashx?code=" + Globals.UrlEncode(urlToEncode) + "&Logo=" + userIdDistributors.Logo;
                if (masterSettings.IsValidationService)
                {
                    this.storeFollowCode.Src = "";
                    ScanInfos info = ScanHelp.GetScanInfosByUserId(userid, 0, "WX");
                    if (info == null)
                    {
                        ScanHelp.CreatNewScan(userid, "WX", 0);
                        info = ScanHelp.GetScanInfosByUserId(userid, 0, "WX");
                    }
                    string qRImageUrlByTicket = "";
                    if ((info != null) && !string.IsNullOrEmpty(info.CodeUrl))
                    {
                        qRImageUrlByTicket = BarCodeApi.GetQRImageUrlByTicket(info.CodeUrl);
                    }
                    else
                    {
                        string token = TokenApi.GetToken_Message(masterSettings.WeixinAppId, masterSettings.WeixinAppSecret);
                        if (TokenApi.CheckIsRightToken(token))
                        {
                            string str4 = BarCodeApi.CreateTicket(token, info.Sceneid, "QR_LIMIT_SCENE", "2592000");
                            if (!string.IsNullOrEmpty(str4))
                            {
                                qRImageUrlByTicket  = BarCodeApi.GetQRImageUrlByTicket(str4);
                                info.CodeUrl        = str4;
                                info.CreateTime     = DateTime.Now;
                                info.LastActiveTime = DateTime.Now;
                                ScanHelp.updateScanInfosCodeUrl(info);
                            }
                        }
                    }
                    if (!string.IsNullOrEmpty(qRImageUrlByTicket))
                    {
                        this.storeFollowCode.Src = "/Api/CreatQRCode.ashx?Combin=" + Globals.UrlEncode(qRImageUrlByTicket) + "&Logo=" + userIdDistributors.Logo;
                    }
                    else
                    {
                        this.storeFollowCode.Src = "";
                    }
                }
                this.litStroeName      = (Literal)this.FindControl("litStroeName");
                this.litStroeName.Text = userIdDistributors.StoreName;
                this.litStroeDesc.Text = userIdDistributors.StoreDescription;
                if (!isShowDistributorSelfStoreName)
                {
                    this.Logoimage.ImageUrl = masterSettings.DistributorLogoPic;
                    this.litStroeName.Text  = masterSettings.SiteName;
                    this.litStroeDesc.Text  = masterSettings.ShopIntroduction;
                    this.storeCode.Src      = "/Api/CreatQRCode.ashx?code=" + Globals.UrlEncode(urlToEncode) + "&Logo=" + masterSettings.DistributorLogoPic;
                }
            }
        }
Exemplo n.º 12
0
        public override AbstractResponse OnEvent_SubscribeRequest(SubscribeEventRequest subscribeEventRequest)
        {
            string eventKey = "";

            if (subscribeEventRequest.EventKey != null)
            {
                eventKey = subscribeEventRequest.EventKey;
            }
            if (eventKey.Contains("qrscene_"))
            {
                eventKey = eventKey.Replace("qrscene_", "").Trim();
                if (eventKey == "1")
                {
                    if (WeiXinHelper.BindAdminOpenId.Count > 10)
                    {
                        WeiXinHelper.BindAdminOpenId.Clear();
                    }
                    if (WeiXinHelper.BindAdminOpenId.ContainsKey(subscribeEventRequest.Ticket))
                    {
                        WeiXinHelper.BindAdminOpenId[subscribeEventRequest.Ticket] = subscribeEventRequest.FromUserName;
                    }
                    else
                    {
                        WeiXinHelper.BindAdminOpenId.Add(subscribeEventRequest.Ticket, subscribeEventRequest.FromUserName);
                    }
                    return(new TextResponse {
                        CreateTime = DateTime.Now, Content = "您正在扫描尝试绑定管理员身份,身份已识别", ToUserName = subscribeEventRequest.FromUserName, FromUserName = subscribeEventRequest.ToUserName
                    });
                }
                ScanInfos scanInfosByTicket = ScanHelp.GetScanInfosByTicket(subscribeEventRequest.Ticket);
                bool      flag       = MemberProcessor.IsExitOpenId(subscribeEventRequest.FromUserName);
                int       bindUserId = scanInfosByTicket.BindUserId;
                if (bindUserId < 0)
                {
                    bindUserId = 0;
                }
                if (!flag && (scanInfosByTicket != null))
                {
                    this.CreatMember(subscribeEventRequest.FromUserName, bindUserId, "");
                    ScanHelp.updateScanInfosLastActiveTime(DateTime.Now, scanInfosByTicket.Sceneid);
                }
            }
            else
            {
                bool flag2 = MemberProcessor.IsExitOpenId(subscribeEventRequest.FromUserName);
                Globals.Debuglog("关注公众号1", "_DebuglogConcern.txt");
                int referralUserId = 0;
                if (referralUserId < 0)
                {
                    referralUserId = 0;
                }
                if (!flag2)
                {
                    Globals.Debuglog("关注公众号生成用户1", "_DebuglogConcern.txt");
                    this.CreatMember(subscribeEventRequest.FromUserName, referralUserId, "");
                }
            }
            WeiXinHelper.UpdateRencentOpenID(subscribeEventRequest.FromUserName);
            string  str2 = "";
            DataSet set  = new DataSet();
            string  path = HttpContext.Current.Server.MapPath("/config/WifiConfig.xml");

            if (File.Exists(path))
            {
                set.ReadXml(path);
                if ((set != null) && (set.Tables.Count > 0))
                {
                    foreach (DataRow row in set.Tables[0].Rows)
                    {
                        if (row["id"].ToString() == eventKey)
                        {
                            str2 = row["WifiDescribe"].ToString() + "\r\nWIFI帐号:" + row["WifiName"].ToString() + "\r\n WIFI密码:" + row["WifiPwd"].ToString();
                        }
                    }
                }
            }
            if (str2 != "")
            {
                return(new TextResponse {
                    CreateTime = DateTime.Now, Content = str2, ToUserName = subscribeEventRequest.FromUserName, FromUserName = subscribeEventRequest.ToUserName
                });
            }
            Hidistro.Entities.VShop.ReplyInfo subscribeReply = ReplyHelper.GetSubscribeReply();
            if (subscribeReply == null)
            {
                return(null);
            }
            subscribeReply.Keys = "登录";
            AbstractResponse response = this.GetResponse(subscribeReply, subscribeEventRequest.FromUserName);

            if (response == null)
            {
                this.GotoManyCustomerService(subscribeEventRequest);
            }
            response.ToUserName   = subscribeEventRequest.FromUserName;
            response.FromUserName = subscribeEventRequest.ToUserName;
            return(response);
        }
Exemplo n.º 13
0
 protected override void AttachChildControls()
 {
     if (!int.TryParse(this.Page.Request.QueryString["ReferralId"], out this.userId))
     {
         this.Context.Response.Redirect("/");
     }
     else
     {
         DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(this.userId);
         if (userIdDistributors == null)
         {
             this.Context.Response.Redirect("/");
         }
         else
         {
             this.imglogo = (HtmlImage)this.FindControl("QrcodeImg");
             int currentMemberUserId = Globals.GetCurrentMemberUserId(false);
             this.editPanel         = (HtmlControl)this.FindControl("editPanel");
             this.editPanel.Visible = false;
             if (currentMemberUserId == this.userId)
             {
                 this.imglogo.Attributes.Add("Admin", "true");
                 MemberInfo currentMember = MemberProcessor.GetCurrentMember();
                 DateTime   cardCreatTime = userIdDistributors.CardCreatTime;
                 string     str           = File.ReadAllText(HttpRuntime.AppDomainAppPath.ToString() + "Storage/Utility/StoreCardSet.js");
                 JObject    obj2          = JsonConvert.DeserializeObject(str) as JObject;
                 DateTime   time2         = new DateTime();
                 if ((obj2 != null) && (obj2["writeDate"] != null))
                 {
                     time2 = DateTime.Parse(obj2["writeDate"].ToString());
                 }
                 ScanInfos info = ScanHelp.GetScanInfosByUserId(currentMember.UserId, 0, "WX");
                 if (info == null)
                 {
                     ScanHelp.CreatNewScan(currentMember.UserId, "WX", 0);
                     info = ScanHelp.GetScanInfosByUserId(currentMember.UserId, 0, "WX");
                 }
                 string codeUrl = "";
                 if (info == null)
                 {
                     codeUrl = Globals.HostPath(HttpContext.Current.Request.Url) + "/Follow.aspx?ReferralId=" + currentMember.UserId.ToString();
                 }
                 else
                 {
                     codeUrl = info.CodeUrl;
                     if (string.IsNullOrEmpty(codeUrl))
                     {
                         string token = TokenApi.GetToken_Message(this.siteSettings.WeixinAppId, this.siteSettings.WeixinAppSecret);
                         if (TokenApi.CheckIsRightToken(token))
                         {
                             string str4 = BarCodeApi.CreateTicket(token, info.Sceneid, "QR_LIMIT_SCENE", "2592000");
                             if (!string.IsNullOrEmpty(str4))
                             {
                                 codeUrl             = str4;
                                 info.CodeUrl        = str4;
                                 info.CreateTime     = DateTime.Now;
                                 info.LastActiveTime = DateTime.Now;
                                 ScanHelp.updateScanInfosCodeUrl(info);
                             }
                         }
                     }
                     if (string.IsNullOrEmpty(codeUrl))
                     {
                         codeUrl = Globals.HostPath(HttpContext.Current.Request.Url) + "/Follow.aspx?ReferralId=" + currentMember.UserId.ToString();
                     }
                     else
                     {
                         codeUrl = BarCodeApi.GetQRImageUrlByTicket(codeUrl);
                     }
                 }
                 if (string.IsNullOrEmpty(userIdDistributors.StoreCard) || (cardCreatTime < time2))
                 {
                     string storeName = userIdDistributors.StoreName;
                     if (!this.siteSettings.IsShowDistributorSelfStoreName)
                     {
                         storeName = this.siteSettings.SiteName;
                     }
                     StoreCardCreater creater = new StoreCardCreater(str, currentMember.UserHead, userIdDistributors.Logo, codeUrl, currentMember.UserName, storeName, this.userId, this.userId);
                     string           imgUrl  = "";
                     if (creater.ReadJson() && creater.CreadCard(out imgUrl))
                     {
                         DistributorsBrower.UpdateStoreCard(this.userId, imgUrl);
                     }
                 }
             }
             if (string.IsNullOrEmpty(userIdDistributors.StoreCard))
             {
                 userIdDistributors.StoreCard = "/Storage/master/DistributorCards/StoreCard" + this.userId.ToString() + ".jpg";
             }
             this.ShareInfo   = (HtmlInputHidden)this.FindControl("ShareInfo");
             this.imglogo.Src = userIdDistributors.StoreCard;
             PageTitle.AddSiteNameTitle("掌柜名片");
         }
     }
 }
Exemplo n.º 14
0
        protected override void OnInit(EventArgs e)
        {
            string str = HttpContext.Current.Request["action"];

            if (str == "ReCreadt")
            {
                HttpContext.Current.Response.ContentType = "application/json";
                string str2 = HttpContext.Current.Request["imageUrl"];
                string s    = "";
                if (string.IsNullOrEmpty(str2))
                {
                    s = "{\"success\":\"false\",\"message\":\"图片地址为空\"}";
                }
                try
                {
                    MemberInfo       currentMember      = MemberProcessor.GetCurrentMember();
                    DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(currentMember.UserId);
                    string           str4  = str2;
                    string           str5  = str2;
                    ScanInfos        infos = ScanHelp.GetScanInfosByUserId(currentMember.UserId, 0, "WX");
                    if (infos == null)
                    {
                        ScanHelp.CreatNewScan(currentMember.UserId, "WX", 0);
                        infos = ScanHelp.GetScanInfosByUserId(currentMember.UserId, 0, "WX");
                    }
                    string qRImageUrlByTicket = "";
                    if (infos == null)
                    {
                        qRImageUrlByTicket = Globals.HostPath(HttpContext.Current.Request.Url) + "/Follow.aspx?ReferralId=" + currentMember.UserId.ToString();
                    }
                    else
                    {
                        qRImageUrlByTicket = BarCodeApi.GetQRImageUrlByTicket(infos.CodeUrl);
                    }
                    string str7      = File.ReadAllText(HttpRuntime.AppDomainAppPath.ToString() + "Storage/Utility/StoreCardSet.js");
                    string storeName = userIdDistributors.StoreName;
                    if (!this.siteSettings.IsShowDistributorSelfStoreName)
                    {
                        storeName = this.siteSettings.SiteName;
                    }
                    StoreCardCreater creater = new StoreCardCreater(str7, str4, str5, qRImageUrlByTicket, currentMember.UserName, storeName, currentMember.UserId, currentMember.UserId);
                    string           imgUrl  = "";
                    if (creater.ReadJson() && creater.CreadCard(out imgUrl))
                    {
                        s = "{\"success\":\"true\",\"message\":\"生成成功\"}";
                        DistributorsBrower.UpdateStoreCard(currentMember.UserId, imgUrl);
                    }
                    else
                    {
                        s = "{\"success\":\"false\",\"message\":\"" + imgUrl + "\"}";
                    }
                }
                catch (Exception exception)
                {
                    s = "{\"success\":\"false\",\"message\":\"" + exception.Message + "\"}";
                }
                HttpContext.Current.Response.Write(s);
                HttpContext.Current.Response.End();
            }
            if (this.SkinName == null)
            {
                this.SkinName = "skin-VStoreCard.html";
            }
            base.OnInit(e);
        }
Exemplo n.º 15
0
        protected override void OnInit(System.EventArgs e)
        {
            string a = System.Web.HttpContext.Current.Request["action"];

            if (a == "ReCreadt")
            {
                System.Web.HttpContext.Current.Response.ContentType = "application/json";
                string text = System.Web.HttpContext.Current.Request["imageUrl"];
                string s    = "";
                if (string.IsNullOrEmpty(text))
                {
                    s = "{\"success\":\"false\",\"message\":\"图片地址为空\"}";
                }
                try
                {
                    MemberInfo       currentMember      = MemberProcessor.GetCurrentMember();
                    DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(currentMember.UserId);
                    string           userHeadPath       = text;
                    string           storeLogoPath      = text;
                    ScanInfos        scanInfosByUserId  = ScanHelp.GetScanInfosByUserId(currentMember.UserId, 0, "WX");
                    if (scanInfosByUserId == null)
                    {
                        ScanHelp.CreatNewScan(currentMember.UserId, "WX", 0);
                        scanInfosByUserId = ScanHelp.GetScanInfosByUserId(currentMember.UserId, 0, "WX");
                    }
                    string codeUrl;
                    if (scanInfosByUserId == null)
                    {
                        codeUrl = Globals.HostPath(System.Web.HttpContext.Current.Request.Url) + "/Follow.aspx?ReferralId=" + currentMember.UserId.ToString();
                    }
                    else
                    {
                        codeUrl = BarCodeApi.GetQRImageUrlByTicket(scanInfosByUserId.CodeUrl);
                    }
                    string setJson   = System.IO.File.ReadAllText(System.Web.HttpRuntime.AppDomainAppPath.ToString() + "Storage/Utility/StoreCardSet.js");
                    string storeName = userIdDistributors.StoreName;
                    if (!this.siteSettings.IsShowDistributorSelfStoreName)
                    {
                        storeName = this.siteSettings.SiteName;
                    }
                    StoreCardCreater storeCardCreater = new StoreCardCreater(setJson, userHeadPath, storeLogoPath, codeUrl, currentMember.UserName, storeName, currentMember.UserId, currentMember.UserId);
                    string           text2            = "";
                    if (storeCardCreater.ReadJson() && storeCardCreater.CreadCard(out text2))
                    {
                        s = "{\"success\":\"true\",\"message\":\"生成成功\"}";
                        DistributorsBrower.UpdateStoreCard(currentMember.UserId, text2);
                    }
                    else
                    {
                        s = "{\"success\":\"false\",\"message\":\"" + text2 + "\"}";
                    }
                }
                catch (System.Exception ex)
                {
                    s = "{\"success\":\"false\",\"message\":\"" + ex.Message + "\"}";
                }
                System.Web.HttpContext.Current.Response.Write(s);
                System.Web.HttpContext.Current.Response.End();
            }
            if (this.SkinName == null)
            {
                this.SkinName = "skin-VStoreCard.html";
            }
            base.OnInit(e);
        }