public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string result = ""; try { string y = context.Request.QueryString["y"].ToString(); int orderid = Convert.ToInt32(context.Request.QueryString["oid"].ToString()); if (context.Request.Cookies["banana_shop_yzm" + orderid] == null) { result = "-2"; } else { HttpCookie cookie = Cookie.Get("banana_shop_yzm" + orderid); if (cookie.Values["yzm"].ToString() == y) { //验证成功,更改订单状态 if (orderid <= 0) { result = "0"; } else { if (new Bll.Db.OrderBll().Update("status=1", "", " id=" + orderid).ResultStatus.Success) { result = "1"; if (context.Request.Cookies["AdminInfo"] != null) { var BananaCount = new Bll.Db.OrderBll().GetByPrimaryKey(orderid).Entity.BananaCount; HttpCookie cookieadmin = Cookie.Get("AdminInfo"); var userId = HttpUtility.UrlDecode(cookieadmin.Values["AdminId"]).ToInt(); BananaCount = new Bll.Db.UsersBll().GetByPrimaryKey(userId).Entity.BananaCount - BananaCount; new Bll.Db.UsersBll().Update("BananaCount=" + BananaCount, "", "id=" + userId); } } else { result = "0"; } } } else { result = "0"; } } } catch { result = "-1"; } context.Response.Write(result); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string result = ""; try { string y = context.Request.QueryString["y"].ToString(); int orderid = Convert.ToInt32(context.Request.QueryString["oid"].ToString()); if (context.Request.Cookies["banana_shop_yzm"+orderid] == null) { result = "-2"; } else { HttpCookie cookie = Cookie.Get("banana_shop_yzm" + orderid); if (cookie.Values["yzm"].ToString() == y) { //验证成功,更改订单状态 if (orderid <= 0) result = "0"; else { if (new Bll.Db.OrderBll().Update("status=1", "", " id=" + orderid).ResultStatus.Success) { result = "1"; if (context.Request.Cookies["AdminInfo"] != null) { var BananaCount = new Bll.Db.OrderBll().GetByPrimaryKey(orderid).Entity.BananaCount; HttpCookie cookieadmin = Cookie.Get("AdminInfo"); var userId = HttpUtility.UrlDecode(cookieadmin.Values["AdminId"]).ToInt(); BananaCount= new Bll.Db.UsersBll().GetByPrimaryKey(userId).Entity.BananaCount - BananaCount; new Bll.Db.UsersBll().Update("BananaCount=" + BananaCount, "", "id=" + userId); } } else { result = "0"; } } } else result = "0"; } } catch { result = "-1"; } context.Response.Write(result); }
protected void Page_Load(object sender, EventArgs e) { string number = Request.QueryString["number"].Trim2(); string backUrl = Request.QueryString["backUrl"].Trim2(); //todo 逻辑需要放到notify的请求中,此处只处理跳转 SortedDictionary<string, string> sPara = GetRequestGet(); if (sPara.Count > 0) //判断是否有带返回参数 { var aliNotify = new Notify(); var verifyResult = aliNotify.Verify(sPara, Request.QueryString["notify_id"], Request.QueryString["sign"]); if (verifyResult) //验证成功 { OrderBll oorderbll = new OrderBll(); string where = "orderno='" + number + "'"; oorderbll.Update("status=1", "",where ); if (Request.Cookies["AdminInfo"] != null) { var BananaCount= new Bll.Db.OrderBll().GetAll("BananaCount", where, "", "id").Entity[0].BananaCount; HttpCookie cookieadmin = Cookie.Get("AdminInfo"); var userId = HttpUtility.UrlDecode(cookieadmin.Values["AdminId"]).ToInt(); BananaCount = new Bll.Db.UsersBll().GetByPrimaryKey(userId).Entity.BananaCount - BananaCount; new Bll.Db.UsersBll().Update("BananaCount=" + BananaCount, "", "id=" + userId); } State = 1; Number = number; BackUrl = backUrl; } } else { State = 0; Number = number; BackUrl = backUrl; } }
protected void Page_Load(object sender, EventArgs e) { string number = Request.QueryString["number"].Trim2(); string backUrl = Request.QueryString["backUrl"].Trim2(); //todo 逻辑需要放到notify的请求中,此处只处理跳转 SortedDictionary <string, string> sPara = GetRequestGet(); if (sPara.Count > 0) //判断是否有带返回参数 { var aliNotify = new Notify(); var verifyResult = aliNotify.Verify(sPara, Request.QueryString["notify_id"], Request.QueryString["sign"]); if (verifyResult) //验证成功 { OrderBll oorderbll = new OrderBll(); string where = "orderno='" + number + "'"; oorderbll.Update("status=1", "", where); if (Request.Cookies["AdminInfo"] != null) { var BananaCount = new Bll.Db.OrderBll().GetAll("BananaCount", where, "", "id").Entity[0].BananaCount; HttpCookie cookieadmin = Cookie.Get("AdminInfo"); var userId = HttpUtility.UrlDecode(cookieadmin.Values["AdminId"]).ToInt(); BananaCount = new Bll.Db.UsersBll().GetByPrimaryKey(userId).Entity.BananaCount - BananaCount; new Bll.Db.UsersBll().Update("BananaCount=" + BananaCount, "", "id=" + userId); } State = 1; Number = number; BackUrl = backUrl; } } else { State = 0; Number = number; BackUrl = backUrl; } }