Пример #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");
    }
Пример #2
0
    public void moneyFreeze(string useMoneyLeft, string orderId, string openId)
    {
        //使用了余额
        if (useMoneyLeft != null && useMoneyLeft != "")
        {
            decimal money = decimal.Parse(useMoneyLeft);
            LVWEIBA.Model.MemberMoney modelMoney = new LVWEIBA.Model.MemberMoney();
            LVWEIBA.BLL.MemberMoney   bllMoney   = new LVWEIBA.BLL.MemberMoney();
            modelMoney.MemberID = openId;
            modelMoney.Money    = -money;
            modelMoney.Method   = "3";//微信充值
            modelMoney.Bz       = orderId;
            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(openId))
            {
                model       = bll.GetModel(openId);
                model.Money = model.Money - money;
                isOK        = bll.Update(model);
            }
            else
            {
                model.MemberId = openId;
                model.Money    = money;
                isOK           = bll.Add(model);
            }
        }
    }
Пример #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();
        }
    }