protected void Page_Load(object sender, EventArgs e) { UserAuthorizationModel userInfo = UserAuthorization.userLogin(this.Page); if (userInfo.openId == null || userInfo.openId == "") { openid = userInfo.mobile; } else { openid = userInfo.openId; } DBCLASSFORWEIXIN.Model.LocalWeixinUser SingleUserInf = new DBCLASSFORWEIXIN.DAL.LocalWeixinUser().GetModel(openid); this.Title = SingleUserInf.nickname + " 现金账户"; 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(); } HUserHostAddress = Page.Request.UserHostAddress; }
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) { 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; } } }
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); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { UserAuthorizationModel userInfo = UserAuthorization.userLogin(this.Page); if (userInfo.openId == null || userInfo.openId == "") { openid = userInfo.mobile; } else { openid = userInfo.openId; } Session["openid"] = openid; DBCLASSFORWEIXIN.Model.LocalWeixinUser wxmdl = new CheckUserAndUpdate().CheckUserAndInsert(openid, ""); LVWEIBA.Model.MemberList mmm = new LVWEIBA.Model.MemberList(); mmm = new LVWEIBA.DAL.MemberList().GetModel(openid); if (mmm == null) { nickname = wxmdl.nickname; Tel = wxmdl.Tel; ddl_sex.SelectedValue = wxmdl.sex.ToString(); } else { nickname = wxmdl.nickname; Tel = wxmdl.Tel; MemberName = mmm.MemberName; ddl_sex.SelectedValue = wxmdl.sex.ToString(); Card = mmm.Card; Mail = mmm.Mail; Pwd = mmm.UserPwd; } } }
protected void Page_Load(object sender, EventArgs e) { UserAuthorizationModel userInfo = UserAuthorization.userLogin(this.Page); if (userInfo.openId == null || userInfo.openId == "") { openid = userInfo.mobile; } else { openid = userInfo.openId; } this.Title = userInfo.name + " 现金账户"; 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(); } }
protected void Page_Load(object sender, EventArgs e) { //if (!IsPostBack) //{ // try // { // UserAuthorizationModel userInfo = UserAuthorization.userLogin(this.Page); // if (userInfo != null) // { // Response.Redirect("Default.aspx"); // } // } // catch (Exception) // { // ////不做处理 // } //} if (IsPostBack) { string tel = Request.Form["tel"]; string pass = Request.Form["pass"]; 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>"); return; } if (code != codeCache.ToString()) { Response.Write("<script>alert('验证码不正确');window.location='Login.aspx';</script>"); return; } var bll = new LVWEIBA.BLL.MemberInfo(); var blllist = new LVWEIBA.BLL.MemberList(); DataSet ds = bll.GetList(" tel='" + tel + "'"); if (ds.Tables[0].Rows.Count > 0) { string openid = ds.Tables[0].Rows[0]["openid"].ToString(); UserAuthorizationModel userInfoNow = new UserAuthorizationModel(); userInfoNow.mobile = tel; userInfoNow.openId = openid; userInfoNow.name = tel; BaseClass.Common.Common.UserLoginSetCookie(userInfoNow.name, this.Page, DateTime.Now.AddDays(30), userInfoNow); log4netHelper.WriteDebugLog(typeof(Login), "login", "用户登录成功:" + userInfoNow.mobile + " " + openid); Response.Redirect("~/Default.aspx"); } else { string 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) { UserAuthorizationModel userInfoNow = new UserAuthorizationModel(); userInfoNow.mobile = tel; userInfoNow.openId = openid; userInfoNow.name = tel; BaseClass.Common.Common.UserLoginSetCookie(userInfoNow.name, this.Page, DateTime.Now.AddDays(30), userInfoNow); log4netHelper.WriteDebugLog(typeof(Login), "login", "用户注册成功:" + userInfoNow.mobile + " " + openid); Response.Redirect("~/Default.aspx"); } } } }
protected void Page_Load(object sender, EventArgs e) { int lineid = (string.IsNullOrEmpty(Request.QueryString["lineid"]) ? 0 : int.Parse(Request.QueryString["lineid"])); UserAuthorizationModel userInfo = UserAuthorization.userLogin(this.Page); if (userInfo.openId == null || userInfo.openId == "") { openid = userInfo.mobile; } else { openid = userInfo.openId; } string oid = Request.QueryString["ddbm"]; log4netHelper.WriteDebugLog(typeof(index_indent_pay), "indent_pay", "进入支付 orderid is:" + oid + "用户Id:" + openid); LVWEIBA.Model.order_list oom = new LVWEIBA.Model.order_list(); oom = new LVWEIBA.DAL.order_list().GetModel(oid); LVWEIBA.Model.order_Mx omm = new LVWEIBA.DAL.order_Mx().GetModel(oid); string typeObject = omm.ProType; if (!String.IsNullOrEmpty(typeObject)) { if (typeObject.Equals("DZP")) { type = "mp"; } else { type = "wd"; } } //BaseClass.Common.LoggerUtil.printLog("type is:" + type); shichangjia = omm.market_price.ToString(); youhuijia = omm.Transaction_price.ToString(); LVWEIBA.Model.MemberList mmm = new LVWEIBA.Model.MemberList(); mmm = new LVWEIBA.DAL.MemberList().GetModel(openid); if (mmm == null) { moneyLeft = "0.00"; } else { moneyLeft = mmm.Money.ToString(); } LVWEIBA.DAL.LvULines dallines = new LVWEIBA.DAL.LvULines(); LVWEIBA.Model.LvULines mlines = dallines.GetModel(omm.productNum); //根据订单明细的线路编号获取线路的类别 if ((mlines != null && mlines.Kindof.Equals("jianhang")) || type.Equals("mp")) //建行分期或门票 { HiddenFieldchctt.Value = omm.Transaction_price.ToString().Replace(".", ""); Label1.Text = omm.Transaction_price.ToString();//优惠价 lbl_scsm.Text = ""; lbl_yhsm.Text = "(支付时直接按优惠价价支付)"; type = "jh"; } else { lbl_scsm.Text = "(支付时按市场价支付)"; lbl_yhsm.Text = "(返还差价之后的实际成交价)"; lbl_zyts.Text = @" 重要提示:该产品按市场价支付,旅行结束后48小时内 驴尾巴网将差价返还至会员现金账户,会员可自由选择提现 或二次消费。"; HiddenFieldchctt.Value = omm.market_price.ToString().Replace(".", ""); Label1.Text = omm.market_price.ToString();//市场价 } if (type == null) { type = "default"; } HUserHostAddress = Page.Request.UserHostAddress; //HiddenFieldchctt.Value = omm.Transaction_price.ToString().Replace(".", ""); //Label1.Text = omm.Transaction_price.ToString(); this.hid_order_id.Value = oid; this.hid_order_type.Value = type; }