예제 #1
0
 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;
 }
예제 #2
0
 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;
 }
예제 #3
0
        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;
        }
예제 #4
0
 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;
 }