Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var reqUserAutoId = Request["sid"];//分享用户的AutoId

            website = bllUser.GetWebsiteInfoModelFromDataBase();
            config  = bllWebsite.GetCompanyWebsiteConfig();

            if (string.IsNullOrWhiteSpace(reqUserAutoId))
            {
                if (bllUser.WebsiteOwner == "youxiu")
                {
                    var myOrderCount = bllDis.GetMyOrderCount();

                    if (myOrderCount == 0)
                    {
                        //跳转到提示购买页
                        Response.Redirect("/Error/MallDistbIsNotMemberError.aspx");
                        Response.End();
                        return;
                    }
                }

                if (!bllUser.IsDistributionMember(CurrentUserInfo))
                {
                    Response.Redirect("/Error/CommonMsg.aspx?msg=您还不是代言人,代言人才能获取我的二维码");
                    Response.End();
                    return;
                }

                currUser = bllDis.GetCurrentUserInfo();

                sid = currUser.AutoID;

                string currUserShowName = bllUser.GetUserDispalyName(currUser);

                shareTitle = currUserShowName + "邀请您加入 " + website.WXMallName;


                qrcondeUrl = bllDis.CreateUserDistributionImage(currUser.WXOpenId, currUser.WebsiteOwner);

                pageTitle = currUserShowName + "的专属二维码";
            }
            else
            {
                isShare   = true;
                sid       = Convert.ToInt32(reqUserAutoId);
                shareUser = bllUser.GetUserInfoByAutoID(sid);

                qrcondeUrl = bllDis.CreateUserDistributionImage(shareUser.WXOpenId, shareUser.WebsiteOwner);

                pageTitle = bllUser.GetUserDispalyName(shareUser) + "邀请您关注 " + website.WXMallName;
            }

            if (!string.IsNullOrWhiteSpace(qrcondeUrl))
            {
                qrcondeUrl = bllJuActivity.DownLoadImageToOss(qrcondeUrl, bllJuActivity.WebsiteOwner, true);//qrcondeUrl.Replace(Common.ConfigHelper.GetConfigString("WebSitePath"),"");
            }
        }