public Member_Action Create(Member member, int memberAction, string description) { Member_Action member_Action = new Member_Action() { MemberID = member.MemberID, ActionType = memberAction, AddTime = DateTime.Now, Description = description, IP = HttpHelper.IP }; DB_Service.Add<Member_Action>(member_Action); DB_Service.Commit(); return member_Action; }
public Member_Action Create(CoreHelper.Enum.MemberActionType MemberActionType, string description) { var MemberID = Convert.ToInt32(CookieHelper.UID); Member_Action member_Action = new Member_Action() { MemberID = MemberID, ActionType = (int)MemberActionType, AddTime = DateTime.Now, Description = description, IP = HttpHelper.IP }; DB_Service.Add<Member_Action>(member_Action); DB_Service.Commit(); return member_Action; }
public bool OpenUserLogin(OpenLoginStatus OpenUser, OpenLoginType openType) { int typeValue = (int)openType; var hasMember = DB_Service.Set<Member>() .Count(x => x.OpenID.Equals(OpenUser.OpenId) && x.OpenType == typeValue) == 1; if (hasMember) { Member LoginUser = FindMemberByOpenUser(OpenUser, openType); DB_Service.Attach<Member>(LoginUser); LoginUser.LastIP = HttpHelper.IP; LoginUser.LastTime = DateTime.Now; LoginUser.LoginCount = LoginUser.LoginCount + 1; Member_Action ma = new Member_Action(); ma.ActionType = (int)MemberActionType.Login; ma.AddTime = DateTime.Now; ma.Description = "登录"; LoginUser.Member_Action.Add(ma); DB_Service.Commit(); SetLoginCookie(LoginUser); } return hasMember; }
public bool Login(string Email, string Md5Password) { bool hasMember = DB_Service.Set<Member>() .Count(x => x.Email.Equals(Email, StringComparison.CurrentCultureIgnoreCase) && x.Password.Equals(Md5Password, StringComparison.CurrentCultureIgnoreCase)) == 1; if (hasMember) { Member LoginUser = FindMemberByEmail(Email); DB_Service.Attach<Member>(LoginUser); LoginUser.LastIP = HttpHelper.IP; LoginUser.LastTime = DateTime.Now; LoginUser.LoginCount = LoginUser.LoginCount + 1; int memberAction = (int)MemberActionType.Login; Member_Action ma = new Member_Action(); ma.ActionType = memberAction; ma.AddTime = DateTime.Now; ma.IP = HttpHelper.IP; ma.Description = "登录"; LoginUser.Member_Action.Add(ma); DB_Service.Commit(); SetLoginCookie(LoginUser); } return hasMember; }