/// <summary>
 ///  所有订购用户信息缓存(12小时更新一次)
 /// </summary>
 /// <returns></returns>
 public static IList <TeteShopInfo> GetNickSessionList()
 {
     return(new CacheUtility <IList <TeteShopInfo> >().Get(KEY_ALLNICKSESSIONINFO, delegate()
     {
         TeteShopService nickDal = new TeteShopService();
         return nickDal.GetAllShopInfo();
     }, 60 * 12));
 }
Beispiel #2
0
    protected override void InitializeCulture()
    {
        string msg = "尊敬的用户您好,非常抱歉的告诉您,您尚未订购该功能,如需继续使用请购买该服务:<br><br>9元/月  <a href=' http://fuwu.taobao.com/item/subsc.htm?items=service-0-22762-6:1;' target='_blank'>立即购买</a><br>";

        if (!string.IsNullOrEmpty(Request.QueryString["nick"]) && !string.IsNullOrEmpty(Request.QueryString["nicksession"]) && !string.IsNullOrEmpty(Request.QueryString["mobile"]))
        {
            HttpCookie cookie = new HttpCookie("nick", HttpUtility.UrlEncode(Request.QueryString["nick"]));
            cookie.Expires = DateTime.Now.AddDays(1);
            Response.Cookies.Add(cookie);
            HttpCookie cookieSe = new HttpCookie("nicksession", Request.QueryString["nicksession"]);
            cookieSe.Expires = DateTime.Now.AddDays(1);
            Response.Cookies.Add(cookieSe);

            HttpCookie cookieM = new HttpCookie("mobile", Request.QueryString["nicksession"]);
            cookieM.Expires = DateTime.Now.AddDays(1);
            Response.Cookies.Add(cookieM);

            TeteShopService tss = new TeteShopService();
            if (CacheCollection.GetNickSessionList().Where(o => o.Short == Request.QueryString["nick"]).ToList().Count == 0)
            {
                TeteShopInfo info = new TeteShopInfo();
                info.Nick      = Encrypt(Request.QueryString["nick"]);
                info.Session   = Request.QueryString["nicksession"];
                info.Short     = Request.QueryString["nick"];
                info.Adddate   = DateTime.Now;
                info.Appkey    = "12132145";
                info.Appsecret = "1fdd2aadd5e2ac2909db2967cbb71e7f";
                tss.InsertShop(info);
                CacheCollection.RemoveCacheByKey(CacheCollection.KEY_ALLNICKSESSIONINFO);
            }
        }
        else
        {
            if (Request.Cookies["nick"] == null || Request.Cookies["nicksession"] == null || Request.Cookies["mobile"] == null)
            {
                Response.Redirect("http://www.7fshop.com/top/market/buy.aspx?msg=" + msg);
            }
        }
        //else
        //{
        //    Session["nick"] = Request.Cookies["nick"].Value;
        //    Session["session"] = Request.Cookies["nicksession"].Value;
        //}
    }
Beispiel #3
0
    protected void Btn_AddCa_Click(object sender, EventArgs e)
    {
        string       nick = HttpUtility.UrlDecode(Request.Cookies["nick"].Value);
        TeteShopInfo info = new TeteShopService().GetShopInfo(Encrypt(nick));

        if (info == null)
        {
            Page.RegisterStartupScript("抱歉", "<script>alert('您还未购买!');</script>");
            return;
        }

        if (TaoBaoAPI.AddCID(nick, Request.Cookies["nicksession"].Value, info.Appkey, info.Appsecret, "http://iphone.7fshop.com/apkimg/" + nick + "_s.jpg"))
        {
            Page.RegisterStartupScript("恭喜", "<script>alert('添加成功!');</script>");

            Lbl_Over.Visible = true;
        }
        else
        {
            Page.RegisterStartupScript("抱歉", "<script>alert('添加失败!');</script>");
        }
    }