public static PaiPaiShopInfo GetShopInfo(string uid, string token) { OpenApiOauth client = new OpenApiOauth(oauthId, oauthKey, long.Parse(uid), token); Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add("sellerUin", uid); dic.Add("charset", "utf-8"); dic.Add("format", "json"); string result = client.InvokeOpenApi("http://api.paipai.com/shop/getShopInfo.xhtml", dic, null); System.Web.Script.Serialization.JavaScriptSerializer js = new System.Web.Script.Serialization.JavaScriptSerializer(); PaiPaiShopInfo info = null; try { info = js.Deserialize <PaiPaiShopInfo>(result); } catch (Exception ex) { LogInfo.Add("店铺信息序列化出错", "返回json转化为店铺信息出错,用户QQ号:" + uid + result + ex.Message); } return(info); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.Cookies["nick"] != null) { Nick = HttpUtility.UrlDecode(Request.Cookies["nick"].Value); //"nick"; } else { Nick = Session["snick"].ToString(); } if (Nick == "") { Response.Redirect("http://fuwu.paipai.com/appstore/ui/my/app/appdetail.xhtml?appId=234454"); } PaiPaiShopService ppsDal = new PaiPaiShopService(); PaiPaiShopInfo info = ppsDal.GetPaiPaiShopInfo(Nick); CanPoCount = info.MessgeCount.ToString(); HadPoCount = info.HadPost.ToString(); // 1:催单;5:已发货;9:催评 if (info.NotPay) { NoPayImgSrc = "images/on.gif"; NoPayJsHref = "javascript:close_setting(1)"; } else { NoPayImgSrc = "images/off.gif"; NoPayJsHref = "javascript:open_setting(1)"; } if (info.NotPing) { NoPingImgSrc = "images/on.gif"; NoPingJsHref = "javascript:close_setting(9)"; } else { NoPingImgSrc = "images/off.gif"; NoPingJsHref = "javascript:open_setting(9)"; } if (info.PostGoods) { PostImgSrc = "images/on.gif"; PostJsHref = "javascript:close_setting(5)"; } else { PostImgSrc = "images/off.gif"; PostJsHref = "javascript:open_setting(5)"; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (string.IsNullOrEmpty(Request.QueryString["type"])) { Response.Redirect(""); return; } int type = int.Parse(Request.QueryString["type"]); if (Request.Cookies["nick"] != null) { Nick = HttpUtility.UrlDecode(Request.Cookies["nick"].Value); //"nick"; } else { Nick = Session["snick"].ToString(); } if (Nick == "") { Response.Redirect(""); } PaiPaiShopService ppsDal = new PaiPaiShopService(); PaiPaiShopInfo info = ppsDal.GetPaiPaiShopInfo(Nick); if (type == 1) { panel3.Visible = true; template_content1.Value = info.NotPayPostModel; Text1.Value = info.NotPayExpiredMinutes.ToString(); } else if (type == 5) { panel1.Visible = true; template_content5.Value = info.PostGoodsPostModel; } else if (type == 9) { panel2.Visible = true; template_content9.Value = info.NotPingPostModel; pay_hour.Value = info.ExpiredDays.ToString(); } else { Response.Redirect("http://fuwu.paipai.com/appstore/ui/my/app/appdetail.xhtml?appId=234454"); return; } ViewState["PaiPaiInfo"] = info; CanPoCount = info.MessgeCount.ToString(); HadPoCount = info.HadPost.ToString(); ViewState["nick"] = Nick; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.Cookies["nick"] != null) { Nick = HttpUtility.UrlDecode(Request.Cookies["nick"].Value); //"nick"; } else { Nick = Session["snick"].ToString(); } if (Nick == "") { Response.Redirect("http://fuwu.paipai.com/appstore/ui/my/app/appdetail.xhtml?appId=234454"); } int type = 5; if (!string.IsNullOrEmpty(Request.QueryString["type"])) { type = int.Parse(Request.QueryString["type"]); } if (type == 1) { ViewState["PayCss"] = "current"; } if (type == 5) { ViewState["PostCss"] = "current"; } if (type == 9) { ViewState["PingCss"] = "current"; } PaiPaiShopService ppsDal = new PaiPaiShopService(); PaiPaiShopInfo info = ppsDal.GetPaiPaiShopInfo(Nick); CanPoCount = info.MessgeCount.ToString(); HadPoCount = info.HadPost.ToString(); DateTime start; DateTime end; if (string.IsNullOrEmpty(Request.QueryString["start"])) { start = DateTime.Now.AddDays(-15); end = DateTime.Now.AddDays(1); } else { start = DateTime.Parse(Request.QueryString["start"]); end = DateTime.Parse(Request.QueryString["end"]); if (end.Day == DateTime.Now.Day) { end = end.AddDays(1); } } ViewState["type"] = type; Bind(Request.QueryString["uid"], start, end, type); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string nick = ""; if (Request.Cookies["nick"] != null) { nick = HttpUtility.UrlDecode(Request.Cookies["nick"].Value); //"nick"; } else { nick = Session["snick"].ToString(); } if (nick == "") { Response.Redirect("http://fuwu.paipai.com/appstore/ui/my/app/appdetail.xhtml?appId=234454"); } string typ = Request.QueryString["typ"]; PaiPaiShopService ppsDal = new PaiPaiShopService(); PaiPaiShopInfo info = ppsDal.GetPaiPaiShopInfo(nick); if (typ == "1") { if (info.MessgeCount <= 0 && !info.NotPay) { Response.Write("{\"errorType\":\"integral_not_enough\",\"msg\":\"余额不足,请先充值!\",\"success\":false}"); } else { if (info.NotPay) { ppsDal.UpdateNotPay(false, info.NotPayPostModel, info.NotPayExpiredMinutes, nick); Response.Write("{\"success\":true}"); } else { if (info.MessgeCount > 0) { ppsDal.UpdateNotPay(true, info.NotPayPostModel, info.NotPayExpiredMinutes, nick); Response.Write("{\"success\":true}"); } } } } if (typ == "5") { if (info.MessgeCount <= 0 && !info.PostGoods) { Response.Write("{\"errorType\":\"integral_not_enough\",\"msg\":\"余额不足,请先充值!\",\"success\":false}"); } else { if (info.PostGoods) { ppsDal.UpdatePostGoods(false, info.PostGoodsPostModel, nick); Response.Write("{\"success\":true}"); } else { if (info.MessgeCount > 0) { ppsDal.UpdatePostGoods(true, info.PostGoodsPostModel, nick); Response.Write("{\"success\":true}"); } } } } if (typ == "9") { if (info.MessgeCount <= 0 && !info.NotPing) { Response.Write("{\"errorType\":\"integral_not_enough\",\"msg\":\"余额不足,请先充值!\",\"success\":false}"); } else { if (info.NotPing) { ppsDal.UpdateNotPing(false, info.NotPingPostModel, info.ExpiredDays, nick); Response.Write("{\"success\":true}"); } else { if (info.MessgeCount > 0) { ppsDal.UpdateNotPing(true, info.NotPingPostModel, info.ExpiredDays, nick); Response.Write("{\"success\":true}"); } } } } Response.End(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string selluin = Request.QueryString["useruin"]; string accesstoken = Request.QueryString["access_token"]; if (string.IsNullOrEmpty(selluin) || string.IsNullOrEmpty(accesstoken)) { Response.Write("数据不合法"); return; } PaiPaiShopInfo info = PaiPaiTopAPI.GetShopInfo(selluin, accesstoken); if (info == null) { Response.Write("未找到店铺信息"); return; } PaiPaiShopService ppsDal = new PaiPaiShopService(); info.logintimes = 1; info.lastlogin = DateTime.Now; info.BanBen = 0; info.MessgeCount = 10; //暂时购买就送10条 info.HadPost = 0; info.ExpiredDays = 8; //默认过期未评的时间为8天 info.NotPayExpiredMinutes = 60; //默认多久未付款发短信 //发送短信模板 info.NotPay = true; info.NotPayPostModel = "亲,您在【{ShopName}】拍下的宝贝还没付款哦,宝贝我们一直为您留着,快来把宝贝领回家吧。"; info.PostGoods = true; info.PostGoodsPostModel = "【{ShopName}】:亲,您购买的宝贝已发出,{ExpressName}+{ExpressNo},请注意查收!如有问题请及时联系我们。"; info.NotPing = true; info.NotPingPostModel = "【{ShopName}】:亲,您的宝贝已经显示签收,如果对商品满意请帮忙评价下,非常感谢。"; info.AcessToken = accesstoken; if (ppsDal.SelectShopBySellerUin(info.sellerUin)) { ppsDal.UpdateShopInfo(info); } else { ppsDal.InsertShop(info); } //添加购买信息 string sql = "SELECT * FROM [BangT_Buys] WHERE nick = '" + selluin + "'"; DataTable dingdt = DataHelp.DBHelper.ExecuteDataTable(sql); if (dingdt.Rows.Count > 0) { } else { //插入 sql = "INSERT INTO BangT_Buys ([Nick],[FeeId],[BuyTime],[IsExpied],ExpiedTime) VALUES ('" + selluin + "','21D5A8DB-F363-4679-BB64-0EA58D5B9F3D',GETDATE(),0,'" + DateTime.Now.AddMonths(1).ToShortDateString() + "')"; DataHelp.DBHelper.ExecuteNonQuery(sql); } AddCookie(selluin, accesstoken); Response.Redirect("index.html"); } }