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
    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);
            }
        }
    }
Ejemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            try
            {
                string tel       = Request.Form["tel"];
                string code      = Request.Form["code"];
                object codeCache = HttpContext.Current.Cache.Get("code" + tel);
                if (codeCache == null)
                {
                    Response.Write("<script>alert('验证码失效');window.location='Login.aspx';</script>");
                }
                else
                {
                    if (code != codeCache.ToString())
                    {
                        Response.Write("<script>alert('验证码不正确');window.location='Login.aspx';</script>");
                    }
                    else
                    {
                        string weixinCode = Session["weixincode"].ToString();
                        string openid     = new WEIxinUserApi().GetUserOpenid(code);
                        DBCLASSFORWEIXIN.DAL.LocalWeixinUser   ld            = new DBCLASSFORWEIXIN.DAL.LocalWeixinUser();
                        DBCLASSFORWEIXIN.Model.LocalWeixinUser SingleUserInf = new WeixinApiClass.WEIxinUserApi().GetSingleUserInf(openid);
                        SingleUserInf.Tel = tel;
                        ld.Add(SingleUserInf);
                        LVWEIBA.BLL.MemberList   bllMember  = new LVWEIBA.BLL.MemberList();
                        LVWEIBA.Model.MemberList model      = new LVWEIBA.Model.MemberList();
                        LVWEIBA.Model.MemberList existModel = bllMember.GetModel(openid, tel);
                        if (existModel == null)
                        {
                            model.Tel      = tel;
                            model.MemberId = openid;
                            bllMember.Add(model);
                        }
                        else
                        {
                            existModel.MemberId = openid;
                            bllMember.Update(model);
                        }

                        UserAuthorizationModel userInfoNow = new UserAuthorizationModel();
                        userInfoNow.mobile = tel;
                        userInfoNow.openId = openid;
                        userInfoNow.name   = SingleUserInf.nickname;
                        BaseClass.Common.Common.UserLoginSetCookie(userInfoNow.name, this.Page, DateTime.Now.AddMinutes(30), userInfoNow);
                        log4netHelper.WriteDebugLog(typeof(Login), "bindCode", "用户绑定微信并且登陆成功:" + userInfoNow.mobile + " " + openid);

                        Response.Redirect("Default.aspx");
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
    }
Ejemplo n.º 4
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.º 5
0
    protected void btn_Tj_Click(object sender, EventArgs e)
    {
        openid = Session["openid"].ToString();
        DBCLASSFORWEIXIN.DAL.LocalWeixinUser   ld    = new DBCLASSFORWEIXIN.DAL.LocalWeixinUser();
        DBCLASSFORWEIXIN.Model.LocalWeixinUser wxmdl = ld.GetModel(openid);

        LVWEIBA.BLL.MemberList   mbll = new LVWEIBA.BLL.MemberList();
        LVWEIBA.Model.MemberList mmm  = new LVWEIBA.Model.MemberList();

        System.Collections.Specialized.NameValueCollection nc = new System.Collections.Specialized.NameValueCollection(Request.Form);
        string txt_user = nc.GetValues("txt_user")[0].ToString();
        string txt_tel  = nc.GetValues("txt_tel")[0].ToString();
        string txt_xm   = nc.GetValues("txt_xm")[0].ToString();
        string txt_card = nc.GetValues("txt_card")[0].ToString();
        string txt_mail = nc.GetValues("txt_mail")[0].ToString();
        string txt_pwd  = nc.GetValues("txt_pwd")[0].ToString();
        string txt_pwd2 = nc.GetValues("txt_pwd2")[0].ToString();

        bool isexists = false;

        if (mbll.Exists(openid))
        {
            mmm      = mbll.GetModel(openid);
            isexists = true;
        }
        wxmdl.nickname = txt_user;
        wxmdl.Tel      = txt_tel;
        mmm.MemberName = txt_xm;
        wxmdl.sex      = int.Parse(ddl_sex.SelectedValue);
        mmm.Card       = txt_card;
        mmm.Mail       = txt_mail;
        mmm.UserPwd    = txt_pwd;
        mmm.UserPwd    = txt_pwd2;
        mmm.MemberId   = openid;
        bool isok = false;

        try
        {
            isok = ld.Update(wxmdl);
            if (isexists)
            {
                isok = mbll.Update(mmm);
            }
            else
            {
                isok = mbll.Add(mmm);
            }
            Response.Write(String.Format("<script>alert('个人信息修改成功');window.location='myindex.aspx';</script>"));
        }
        catch (Exception ex)
        {
            log4netHelper.WriteExceptionLog(typeof(aboutme), "aboutme异常", ex);
        }
    }
Ejemplo n.º 6
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.º 7
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();
    }