/// <summary> /// 绑定用户 /// </summary> /// <param name="wxuser"></param> private MemberInfo BindUser(WechatUserInfo wxuser) { var memberInfoDal = new MemberInfoDal(); var memberInfo = memberInfoDal.GetModel(string.Format("OpenId='{0}'", wxuser.OpenId)); if (memberInfo == null) { memberInfo = new MemberInfo { OpenId = wxuser.OpenId, NickName = wxuser.Nickname, Role = (int)MemberRole.顾客, CreateOn = DateTime.Now.ToUnixStamp() }; memberInfo.Uid = memberInfoDal.Add(memberInfo); } else { memberInfo.NickName = wxuser.Nickname; memberInfoDal.Update(memberInfo); } SetCookie(memberInfo); return(memberInfo); }
public bool Edit(MemberInfo mi) { return(memInfoDal.Update(mi) > 0); }
public bool Update(MemberInfo memberInfo) { return(MemberInfoDal.Update(memberInfo) > 0); }
public bool Edit(MemberInfo memberInfo) { return(dal.Update(memberInfo) > 0); }