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); } } }
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(); } }
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); } }
/// <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); } } }