예제 #1
0
    public override void ProcessNotify()
    {
        WxPayData notifyData = GetNotifyData();

        //检查支付结果中transaction_id是否存在
        if (!notifyData.IsSet("transaction_id"))
        {
            //若transaction_id不存在,则立即返回结果给微信支付后台
            WxPayData res = new WxPayData();
            res.SetValue("return_code", "FAIL");
            res.SetValue("return_msg", "支付结果中微信订单号不存在");
            Log.Error(this.GetType().ToString(), "The Pay result is error : " + res.ToXml());
            page.Response.Write(res.ToXml());
            page.Response.End();
        }

        string transaction_id = notifyData.GetValue("transaction_id").ToString();
        string out_trade_no   = notifyData.GetValue("out_trade_no").ToString();

        //查询订单,判断订单真实性
        if (!QueryOrder(transaction_id))
        {
            //若订单查询失败,则立即返回结果给微信支付后台
            WxPayData res = new WxPayData();
            res.SetValue("return_code", "FAIL");
            res.SetValue("return_msg", "订单查询失败");
            Log.Error(this.GetType().ToString(), "Order query failure : " + res.ToXml());
            page.Response.Write(res.ToXml());
            page.Response.End();
        }
        //查询订单成功
        else
        {
            WxPayData res = new WxPayData();
            res.SetValue("return_code", "SUCCESS");
            res.SetValue("return_msg", "OK");
            tbl_canshu canshu = new tbl_canshu();
            canshu.GetModel(1);
            canshu.canshu_gonggao = out_trade_no;
            canshu.sys_name       = transaction_id;
            canshu.Update();
            tbl_orders orders = new tbl_orders();
            orders.GetModel(out_trade_no);
            tbl_huiyuan huiyuan = new tbl_huiyuan();
            huiyuan.GetModel_hui_bianhao(orders.user_bianhao);
            huiyuan.huiyuan_jiebie = 1;
            huiyuan.Update();
            int id = orders.id;
            if (orders.payment_status != 2)
            {
                orders.payment_status = 2;
                orders.Update();
                DbHelperSQL.ExecuteSql("exec sp_zhixing '" + orders.user_id + "'," + orders.order_amount + "");
                DbHelperSQL.ExecuteSql("exec sp_jiangjin_4 '" + orders.user_id + "'");
            }
        }
    }
예제 #2
0
    protected void button_get_Click(object sender, EventArgs e)
    {
        WeixinServer wx = new WeixinServer();
        //string a = wx.JsCode2Session();
        tbl_canshu canshu = new tbl_canshu();

        canshu.GetModel(1);
        canshu.id       = 1;
        canshu.sys_name = wx.access_token;
        canshu.Update();
    }
예제 #3
0
    public static String getPerpetualQR(String account)
    {
        WeixinServer wx    = new WeixinServer();
        string       token = wx.access_token;
        //获取数据的地址(微信提供)
        String url = "https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token={0}";

        url = string.Format(url, token);
        //发送给微信服务器的数据
        String     jsonStr = "{\"action_name\": \"QR_LIMIT_SCENE\", \"action_info\":{\"scene\": {\"scene_id\": " + account + "}}}";
        tbl_canshu casnhu  = new tbl_canshu();

        casnhu.GetModel(1);
        casnhu.canshu_gonggao = jsonStr;
        //casnhu.sys_name = shangid;
        casnhu.Update();
        //post请求得到返回数据(这里是封装过的,就是普通的java post请求)
        String response = wx.GetPage(url, jsonStr);

        return(response);
    }
예제 #4
0
    // 单个删除
    //protected void lbtnDelCa_Click(object sender, EventArgs e)
    //{
    //    // 当前点击的按钮
    //    LinkButton lb = (LinkButton)sender;
    //    int caId = int.Parse(lb.CommandArgument);
    //    tbl_reg_jiebie bll = new tbl_reg_jiebie();
    //    bll.GetModel(caId);
    //    string title = bll.jiebie_name;
    //    tbl_huiyuan bllpp = new tbl_huiyuan();
    //    bllpp.huiyuan_jiebie = caId;
    //    if (!bllpp.ExistsBM())//查找是否存在下级会员级别
    //    {
    //        bll.Delete(caId);

    //        mym.JscriptMsg(this.Page, " 成功删除该会员级别:" + title + "", Utils.CombUrlTxt("Deve_kuangji.aspx", "keywords={0}&page={1}", this.keywords, this.page.ToString()), "Success");
    //    }
    //    else
    //    {
    //        mym.JscriptMsg(this.Page, "有会员拥有该级别,不能删除!", "", "Error");
    //        return;
    //    }

    //}



    ////保存排序
    //protected void btnSave_Click(object sender, EventArgs e)
    //{
    //    tbl_reg_jiebie bll = new tbl_reg_jiebie();
    //    Repeater rptList = new Repeater();
    //    rptList = this.rptList;

    //    for (int i = 0; i < rptList.Items.Count; i++)
    //    {
    //        int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
    //        int sortId;
    //        if (!int.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId))
    //        {
    //            sortId = 99;
    //        }
    //        bll.UpdateField(id, "sort_id=" + sortId.ToString());
    //    }

    //    mym.JscriptMsg(this.Page, " 排序保存成功", Utils.CombUrlTxt("Deve_kuangji.aspx", "keywords={0}&page={1}", this.keywords, this.page.ToString()), "Success");
    //}

    //#region 赋值操作=================================
    //private void ShowInfo(int _id)
    //{
    //    tbl_canshu model = new tbl_canshu();
    //    model.GetModel(_id);

    //    tbl_machine model1 = new tbl_machine();
    //    model1.GetModel(_id);
    //}
    //#endregion

    #region 修改操作=================================
    private bool DoEdit(int _id)
    {
        bool result = false;

        tbl_canshu model = new tbl_canshu();

        model.GetModel(_id);
        //if (cbIsLock.Checked == true)
        //{
        //    model.reg_shoping = 1;
        //}
        //else
        //{
        //    model.reg_shoping = 0;
        //}
        //model.sys_name = sys_name.Text;
        //model.canshu_001 = decimal.Parse(TextBox1.Text);
        //model.canshu_002 = decimal.Parse(TextBox2.Text);
        //model.canshu_003 = decimal.Parse(TextBox3.Text);
        //model.canshu_004 = decimal.Parse(TextBox4.Text);
        //model.canshu_005 = decimal.Parse(TextBox5.Text);
        //model.canshu_006 = decimal.Parse(TextBox6.Text);
        //model.canshu_007 = decimal.Parse(TextBox7.Text);
        //model.canshu_008 = decimal.Parse(TextBox8.SelectedValue.ToString());
        //model.canshu_009 = decimal.Parse(TextBox9.Text);
        //model.canshu_010 = decimal.Parse(TextBox10.Text);
        //model.canshu_011 = decimal.Parse(TextBox11.Text);
        //model.canshu_012 = decimal.Parse(TextBox12.Text);
        //model.canshu_013 = decimal.Parse(TextBox13.Text);
        //model.canshu_014 = decimal.Parse(TextBox14.Text);
        //model.canshu_015 = decimal.Parse(TextBox15.Text);
        //model.canshu_016 = decimal.Parse(TextBox16.Text);
        //model.canshu_017 = decimal.Parse(TextBox17.Text);
        //model.canshu_018 = decimal.Parse(TextBox18.Text);
        //model.canshu_019 = decimal.Parse(TextBox19.Text);
        //model.canshu_020 = decimal.Parse(TextBox20.Text);
        //model.canshu_021 = decimal.Parse(TextBox21.Text);
        //model.canshu_022 = decimal.Parse(TextBox22.Text);
        //model.canshu_023 = decimal.Parse(TextBox23.Text);
        //model.canshu_024 = decimal.Parse(TextBox24.Text);
        //model.canshu_025 = decimal.Parse(TextBox25.Text);
        //model.canshu_026 = decimal.Parse(TextBox26.Text);
        //model.canshu_027 = decimal.Parse(TextBox27.Text);
        //model.canshu_028 = decimal.Parse(TextBox28.Text);
        //model.canshu_029 = decimal.Parse(TextBox29.Text);
        //model.canshu_030 = decimal.Parse(TextBox30.Text);
        //model.canshu_031 = decimal.Parse(TextBox31.Text);
        //model.canshu_032 = decimal.Parse(TextBox32.Text);
        //model.canshu_033 = decimal.Parse(TextBox33.Text);
        //model.canshu_034 = decimal.Parse(TextBox34.Text);
        //model.canshu_035 = decimal.Parse(TextBox35.Text);
        //model.canshu_036 = decimal.Parse(TextBox36.Text);
        //model.canshu_037 = decimal.Parse(TextBox37.Text);
        //model.canshu_038 = decimal.Parse(TextBox38.Text);
        //model.canshu_039 = decimal.Parse(TextBox39.Text);
        //model.canshu_040 = decimal.Parse(TextBox40.Text);
        //model.canshu_041 = decimal.Parse(TextBox41.Text);
        //model.canshu_042 = decimal.Parse(TextBox42.Text);
        //model.canshu_043 = decimal.Parse(TextBox43.Text);
        //model.canshu_044 = decimal.Parse(TextBox44.Text);
        //model.canshu_045 = decimal.Parse(TextBox45.Text);
        //model.canshu_046 = decimal.Parse(TextBox46.Text);
        //model.canshu_047 = decimal.Parse(TextBox47.Text);
        //model.canshu_048 = decimal.Parse(TextBox48.Text);
        //model.canshu_049 = decimal.Parse(TextBox49.Text);
        //model.canshu_050 = decimal.Parse(TextBox50.Text);
        //model.canshu_051 = decimal.Parse(TextBox51.Text);
        //model.canshu_052 = decimal.Parse(TextBox52.Text);
        //model.dispose_time = Convert.ToDateTime(txtstart_time.Value.Trim().ToString());
        if (model.Update())
        {
            result = true;
        }

        return(result);
    }