Ejemplo n.º 1
0
    protected void btnMoney_Click(object sender, EventArgs e)
    {
        LVWEIBA.BLL.MemberBankCard bllbank = new LVWEIBA.BLL.MemberBankCard();

        int rbank = int.Parse(Request.Form["rbank"]);

        LVWEIBA.Model.MemberBankCard mdl   = bllbank.GetModel(rbank);
        LVWEIBA.BLL.MemberMoney      bll   = new LVWEIBA.BLL.MemberMoney();
        LVWEIBA.Model.MemberMoney    model = new LVWEIBA.Model.MemberMoney();
        string  money = Request.Form["money"];
        decimal Money = decimal.Parse(money);

        model.MemberID  = openid;
        model.Money     = -Money;
        model.Method    = "4";//提现
        model.Bz        = mdl.Name + "   " + mdl.Bank + "   " + mdl.Card;
        model.Sj        = DateTime.Now;
        model.Type      = "1";//会员
        model.CheckTime = DateTime.Now;
        model.IsCheck   = "0";
        //新增提现记录
        bll.Add(model);

        //修改会员帐号余额
        LVWEIBA.BLL.MemberList   bllMem = new LVWEIBA.BLL.MemberList();
        LVWEIBA.Model.MemberList mmem   = bllMem.GetModel(openid);
        mmem.Money = mmem.Money - Money;
        bllMem.Update(mmem);

        BaseClass.Common.Jscript.AlertAndRedirect("提现成功,将从现金帐户扣减,需要24小时到提现的银行卡,请耐心等待!", "Myindex.aspx");
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["openid"] == null)
        {
            if (string.IsNullOrEmpty(Request.QueryString["code"]))
            {
                Response.Redirect("https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + GetWeiXinInf.appid + "&redirect_uri=http://wx.lvwei8.com/index/withdraw.aspx&response_type=code&scope=snsapi_base&state=123#wechat_redirect");
            }

            else
            {
                string code = Request.QueryString["code"];
                openid = new WEIxinUserApi().GetUserOpenid(code);

                if (openid.Length < 10)
                {
                    Response.Redirect("https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + GetWeiXinInf.appid + "&redirect_uri=http://wx.lvwei8.com/index/withdraw.aspx&response_type=code&scope=snsapi_base&state=123#wechat_redirect");
                }
            }


            Session["openid"] = openid;
        }
        else
        {
            openid = Session["openid"].ToString();
        }
        if (!IsPostBack)
        {
            LVWEIBA.Model.MemberList mmm = new LVWEIBA.Model.MemberList();
            mmm = new LVWEIBA.DAL.MemberList().GetModel(openid);
            if (mmm == null)
            {
                yue = "0.00";
            }
            else
            {
                yue = mmm.Money.ToString();
            }
            LVWEIBA.BLL.MemberBankCard          bll = new LVWEIBA.BLL.MemberBankCard();
            List <LVWEIBA.Model.MemberBankCard> lst = bll.GetModelList(" MemberID ='" + openid + "'");
            string str  = "";
            int    i    = 0;
            string card = "";
            foreach (LVWEIBA.Model.MemberBankCard item in lst)
            {
                card = item.Card.Length > 4 ? item.Card.Substring(item.Card.Length - 4, 4) : item.Card;
                i++;
                str += string.Format(@"   
               <li class='item-content'>
               <div class='item-inner'>
               <div class='item-title'>   <input id='{0}' name='rbank' type='radio' value= '{1}' {3} /><label for='{0}'>{2}</label>
               </div>
               </div>
               </li>
             ", "radio" + i, item.ID, "尾号" + card + "的" + item.Bank + "卡", i == 1 ? "checked" : "");
            }
            this.Literal1.Text = str;
        }
    }
Ejemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string   postStr = "";
        TXT_Help th      = new TXT_Help();

        if (Request.HttpMethod.ToLower() == "post")
        {
            Stream s = System.Web.HttpContext.Current.Request.InputStream;
            byte[] b = new byte[s.Length];
            s.Read(b, 0, (int)s.Length);
            postStr = Encoding.UTF8.GetString(b);
            th.ReFreshTXT(postStr, "D:\\msgweixin\\Post" + DateTime.Now.ToString("mddhhmmssffff") + ".txt");

            XmlHelp xh = new XmlHelp();
            SortedDictionary <string, string> sParams = xh.GetInfoFromXml(postStr);
            if (sParams["return_code"].ToString() == "SUCCESS")
            {
                BaseClass.Dal.ChongzhiLog sl = new BaseClass.Dal.ChongzhiLog();
                if (sl.CZisok(sParams["out_trade_no"].ToString(), sParams["openid"].ToString()))
                {
                    string mid = sParams["openid"].ToString();

                    decimal money = decimal.Parse(sParams["cash_fee"].ToString()) / 100;
                    LVWEIBA.Model.MemberMoney modelMoney = new LVWEIBA.Model.MemberMoney();
                    LVWEIBA.BLL.MemberMoney   bllMoney   = new LVWEIBA.BLL.MemberMoney();
                    modelMoney.MemberID = mid;
                    modelMoney.Money    = money;
                    modelMoney.Method   = "3";//微信充值
                    modelMoney.Bz       = "客户微信充值";
                    modelMoney.Sj       = DateTime.Now;
                    bool isOKM = false;
                    isOKM = bllMoney.Add(modelMoney);

                    bool isOK = false;
                    LVWEIBA.Model.MemberList model = new LVWEIBA.Model.MemberList();
                    LVWEIBA.BLL.MemberList   bll   = new LVWEIBA.BLL.MemberList();

                    if (bll.Exists(mid))
                    {
                        model       = bll.GetModel(mid);
                        model.Money = model.Money + money;
                        isOK        = bll.Update(model);
                    }
                    else
                    {
                        model.MemberId = mid;
                        model.Money    = money;
                        isOK           = bll.Add(model);
                    }
                }
                else
                {
                    th.ReFreshTXT(postStr, "D:\\msg\\zhifuErr\\", "错误CZ" + DateTime.Now.ToString("yyMMddHHmmssff") + ".txt");
                }
            }
            Response.End();
        }
    }
Ejemplo n.º 4
0
    /// <summary>
    /// 余额回滚
    /// </summary>
    /// <param name="orderId"></param>
    /// <param name="openId"></param>
    public void moneyUnFreeze(string orderId, string openId)
    {
        LVWEIBA.DAL.MemberMoney   DalMoney   = new LVWEIBA.DAL.MemberMoney();
        LVWEIBA.Model.MemberMoney moneyModel = DalMoney.GetModel(" Bz='" + orderId + "'");
        //是否使用了余额
        if (moneyModel != null)
        {
            LVWEIBA.Model.MemberList model = new LVWEIBA.Model.MemberList();
            LVWEIBA.BLL.MemberList   bll   = new LVWEIBA.BLL.MemberList();
            bool isOK = false;

            if (bll.Exists(openId))
            {
                model       = bll.GetModel(openId);
                model.Money = model.Money - moneyModel.Money;
                isOK        = bll.Update(model);
                //删除MemberMoney
                DalMoney.Delete(moneyModel.Id);
            }
        }
    }
Ejemplo n.º 5
0
    private void OnQuery()
    {
        LVWEIBA.BLL.MemberList   bll   = new LVWEIBA.BLL.MemberList();
        LVWEIBA.Model.MemberList model = bll.GetModel(userId);
        this.lbl_Points.Text = model.Points.ToString();//积分总数
        var           bllPoints = new LVWEIBA.DAL.MemberPoints();
        DataTable     list      = bllPoints.GetMxList(" memberid='" + userId + "'").Tables[0];
        StringBuilder strMx     = new StringBuilder();

        foreach (DataRow dr in list.Rows)
        {
            strMx.AppendFormat(@"<li class='list'>
                <div class='name'>{0}(订单号:{1})</div>
                <div class='time'>{2}</div>
                <div class='number'>{3}</div>
                </li>",
                               dr["sourcemc"],
                               dr["OrderId"],
                               DateTime.Parse(dr["Sj"].ToString()).ToString("yyyy年MM月dd日 HH时mm分"),
                               int.Parse(dr["Points"].ToString()) > 0 ? "+" + dr["Points"] : dr["Points"]);
        }
        this.Literal1.Text = strMx.ToString();
    }
Ejemplo n.º 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            string tel = Request.Form["tel"];
            string code = Request.Form["code"];
            string pass = Request.Form["pass"];

            object codeCache = HttpContext.Current.Cache.Get("code" + tel);
            if (codeCache == null)
            {
                Jscript.NorefLocation(this.Page, "验证码失效请重新获取!手机号为:" + tel + "验证码为:" + code, "registration.aspx");
            }
            else
            {
                if (code != codeCache.ToString())
                {
                    Jscript.NorefLocation(this.Page, "验证码不正确!", "registration.aspx");
                }
                else
                {
                    try
                    {

                        var bll = new LVWEIBA.BLL.MemberInfo();
                        DataSet ds = bll.GetList(" tel='" + tel + "'");
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            Jscript.NorefLocation(this.Page, "该手机号已注册!", "registration.aspx");
                        }
                        else
                        {
                            openid = BaseClass.Common.Common.getSuijiString(30);

                            DBCLASSFORWEIXIN.Model.LocalWeixinUser SingleUserInf = new DBCLASSFORWEIXIN.Model.LocalWeixinUser();
                            DBCLASSFORWEIXIN.DAL.LocalWeixinUser ld = new DBCLASSFORWEIXIN.DAL.LocalWeixinUser();

                            SingleUserInf.country = "";
                            SingleUserInf.province = "";
                            SingleUserInf.city = "";
                            SingleUserInf.remark = "";
                            SingleUserInf.openid = openid;
                            SingleUserInf.regtime = DateTime.Now;
                            SingleUserInf.Tel = tel;
                            SingleUserInf.Jifen = 0;
                            SingleUserInf.money = 0;
                            SingleUserInf.vips = 0;
                            SingleUserInf.pid = 0;
                            SingleUserInf.refresh_token = "";
                            SingleUserInf.nickname = "";
                            SingleUserInf.headimgurl = "";
                            SingleUserInf.subscribe = 1;
                            SingleUserInf.subscribe_time = "";
                            SingleUserInf.unionid = "";
                            SingleUserInf.groupid = 0;
                            SingleUserInf.sex = 1;

                            LVWEIBA.BLL.MemberList bllMember = new LVWEIBA.BLL.MemberList();
                            LVWEIBA.Model.MemberList model = new LVWEIBA.Model.MemberList();


                            model.MemberId = openid;
                            model.UserPwd = pass;
                            model.Tel = tel;
                            if (bllMember.Add(model) && ld.Add(SingleUserInf) > 0)
                            {
                                Session["openid"] = openid;
                                Response.Redirect("Default.aspx");
                            }
                        }

                    }
                    catch (Exception EX)
                    {

                        throw;
                    }
                }
            }
        }
    }