Exemplo n.º 1
0
 public void ChangeStatus(Member member, int Status)
 {
     db.Attach<Member>(member);
     member.Status = Status;
     db.Commit();
     SetLoginCookie(member);
 }
Exemplo n.º 2
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.Add<Member_Action>(member_Action);
     db.Commit();
     return member_Action;
 }
Exemplo n.º 3
0
 public Member Create(ViewModels.RegViewModel model)
 {
     Member entity = new Member();
     entity.Email = model.Email;
     entity.NickName = model.NickName;
     entity.OpenID = model.OpenID;
     entity.MemberType = model.MemberType;
     entity.OpenType = model.OpenType;
     entity.Mobile = model.Mobile;
     entity.Status = (int)MemberStatus.Registered;//注册未激活,0为禁用
     entity.Password = CheckHelper.StrToMd5(model.Password);
     entity.GroupID = 1;
     entity.AddTime = DateTime.Now;
     entity.LastTime = DateTime.Now;
     entity.AddIP = HttpHelper.IP;
     entity.LastIP = HttpHelper.IP;
     entity.LoginCount = 1;
     db.Add<Member>(entity);
     db.Commit();
     return entity;
 }
Exemplo n.º 4
0
 public Member Create(ViewModels.DetailsViewModel model)
 {
     Member member = new Member();
     member.Email = model.Email;
     member.NickName = model.NickName;
     member.AvtarUrl = model.AvtarUrl;
     member.GroupID = model.GroupID;
     member.Password = CheckHelper.StrToMd5(model.Password);
     member.Status = 1;//注册未激活,0为禁用
     member.AddTime = DateTime.Now;
     member.LastTime = DateTime.Now;
     member.AddIP = HttpHelper.IP;
     member.LastIP = HttpHelper.IP;
     member.Member_Profile = new Member_Profile();
     member.Member_Profile.Borthday = model.Borthday;
     var cityCode = 0;
     if (!string.IsNullOrEmpty(model.CityCode))
     {
         cityCode = Convert.ToInt32(model.CityCode.Split(',').Last());
     }
     member.Member_Profile.CityCode = cityCode;
     member.Member_Profile.CityCodeValue = model.CityCode;
     member.Member_Profile.Description = model.Description;
     member.Member_Profile.Sex = model.Sex;
     db.Add<Member>(member);
     db.Commit();
     return member;
 }
Exemplo n.º 5
0
 public void Create(Member model)
 {
     db.Add<Member>(model);
     db.Commit();
 }
Exemplo n.º 6
0
 public void SetLoginCookie(Member member)
 {
     var message = MessageService.GetALL().Count(x => x.RecipientID == member.MemberID && x.IsRead.Equals(false));
     CookieHelper.LoginCookieSave(member.MemberID.ToString(),
       member.Email,
       member.NickName,
       member.AvtarUrl,
       member.GroupID.ToString(),
       member.Status.ToString(),
       member.MemberType.ToString(),
       member.Password,
       "1",
       message.ToString());
 }
Exemplo n.º 7
0
 public void ResetPassword(Member member, string newpassword)
 {
     db.Attach<Member>(member);
     member.Password = CheckHelper.StrToMd5(newpassword);
     db.Commit();
 }
Exemplo n.º 8
0
 public void Delete(Member model)
 {
     var target = Find(model.MemberID);
     db.Remove<Member>(target);
     db.Commit();
 }