Esempio n. 1
0
    /// <summary>
    /// 登录后获取管理员    ID和权限列表
    /// </summary>
    /// <param name="e"></param>
    protected override void OnLoad(EventArgs e)
    {
        tbl_canshu cs = new tbl_canshu();

        cs.GetModel(1);
        if (cs.jiesuan_flag == 1)
        {
            Response.Write("<script language='javascript'>alert('系统正在结算中,请稍后访问!');</script>");
            return;
        }

        tbl_open bll_open = new tbl_open();

        bll_open.GetModel(1);

        if (bll_open.open_flag == 1)
        {
            Response.Write("<script language=javascript>alert('" + bll_open.tishi + "!');top.location.href='/index.aspx';</script>");

            return;
        }
        if (Session["hy_id1"] == null)
        {
            Response.Write("<script language=javascript>alert('您已经退出系统,请通过微信公众号重新登录!');top.location.href='/shop/index.aspx';</script>");
            Response.End();
            //Response.Redirect("~/shop/index.aspx");
        }
        else
        {
            hy_id1      = Session["hy_id1"].ToString();
            hy_bianhao1 = Session["hy_bianhao1"].ToString();
        }

        base.OnLoad(e);
    }
Esempio n. 2
0
    /**
     * 生成直接支付url,支付url有效期为2小时,模式二
     * @param productId 商品ID
     * @return 模式二URL
     */
    public string GetPayUrl(string productId)
    {
        tbl_canshu canshu = new tbl_canshu();

        canshu.GetModel(1);
        Log.Info(this.GetType().ToString(), "Native pay mode 2 url is producing...");
        tbl_orders orders = new tbl_orders();

        orders.GetModel(productId);


        double zong = double.Parse(orders.payable_amount.ToString()) * 100;

        WxPayData data = new WxPayData();

        data.SetValue("body", "1111");                                                        //商品描述
        data.SetValue("attach", "");                                                          //附加数据
        data.SetValue("out_trade_no", productId);                                             //随机字符串
        data.SetValue("total_fee", zong.ToString());                                          //总金额
        data.SetValue("time_start", DateTime.Now.ToString("yyyyMMddHHmmss"));                 //交易起始时间
        data.SetValue("time_expire", DateTime.Now.AddMinutes(10).ToString("yyyyMMddHHmmss")); //交易结束时间
        data.SetValue("goods_tag", "");                                                       //商品标记
        data.SetValue("trade_type", "NATIVE");                                                //交易类型
        data.SetValue("product_id", productId);                                               //商品ID

        WxPayData result = WxPayApi.UnifiedOrder(data);                                       //调用统一下单接口
        string    url    = result.GetValue("code_url").ToString();                            //获得统一下单接口返回的二维码链接

        Log.Info(this.GetType().ToString(), "Get native pay mode 2 url : " + url);
        return(url);
    }
Esempio n. 3
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 + "'");
            }
        }
    }
Esempio n. 4
0
    protected void button1_Click(object sender, EventArgs e)
    {
        tbl_canshu canshu = new tbl_canshu();

        canshu.GetModel(1);
        WeixinServer wx = new WeixinServer();

        wx.GetUserInfo(canshu.sys_name, "oNxcK0j0c2vIH0pgwdeVuhHNzNRs");
        Response.Write("<script language=javascript>alert('" + wx.nickname + "');history.go(-1);</script>");
        //GetUserInfo(canshu.sys_name, "oNxcK0j0c2vIH0pgwdeVuhHNzNRs");
    }
Esempio n. 5
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();
    }
Esempio n. 6
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);
    }
Esempio n. 7
0
    private void Login(string _id)
    {
        tbl_canshu canshu = new tbl_canshu();

        canshu.GetModel(1);
        Session["tikuan"] = canshu.reg_shoping.ToString();
        tbl_huiyuan model1 = new tbl_huiyuan();

        model1.GetModel_hui_id(_id);
        //填写逻辑过程登录会员系统
        Session["hy_id1"]            = model1.huiyuan_id;
        Session["hy_bianhao1"]       = model1.huiyuan_bianhao;
        Session["hy_name1"]          = model1.huiyuan_name;
        Session["hy_zm1"]            = model1.huiyuan_zhuanmai;
        Session["hy_jiebie1"]        = model1.huiyuan_jiebie;
        Session["huiyuan_zhuanmai1"] = model1.huiyuan_zhuanmai;
        Session["flag4"]             = model1.flag_4;
        Session["zhongyao1"]         = 1;
        ShopCart.Clear("0");

        //填写逻辑过程登录会员系统结束

        Response.Redirect("../../shop/member_center.aspx");
    }
Esempio n. 8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     model.GetModel(1);
     title = model.sys_name;
 }
Esempio n. 9
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);
    }