Ejemplo n.º 1
0
 public override bool Create(string username, string email, string password)
 {
     if (data.MemberInfos.Count(c => c.Username.ToLower() == username.ToLower() || c.Email == email.ToLower()) > 0)
         return false;
     var item = new MemberInfo();
     item.Username = username;
     item.Email = email.ToLower();
     item.Index = Guid.NewGuid();
     item.SetPassword(password);
     data.MemberInfos.Add(item);
     data.SaveChanges();
     return true;
 }
Ejemplo n.º 2
0
 public abstract bool Edit(MemberInfo memberInfo);
Ejemplo n.º 3
0
 public override bool Edit(MemberInfo memberInfo)
 {
     data.Entry <MemberInfo>(memberInfo).State = Data.Entity.EntityState.Modified;
     return(data.SaveChanges() > 0);
 }
Ejemplo n.º 4
0
 public override bool Edit(MemberInfo memberInfo)
 {
     data.Entry<MemberInfo>(memberInfo).State = Data.Entity.EntityState.Modified;
     return data.SaveChanges() > 0;
 }
Ejemplo n.º 5
0
 public static bool SignIn(string username, string password)
 {
     if (!IsEnabled)
         throw new InvalidOperationException("成员管理器没有开启。");
     if (IsSigned)
         return false;
     if (!provider.Verify(username, password))
         return false;
     if (IsRunService)
         Wodsoft.Net.Service.ServiceContext.Current.Session["ComBoost_CurrentMember"] = provider.GetMemberInfo(username);
     else
         _MemberInfo = provider.GetMemberInfo(username);
     return true;
 }
Ejemplo n.º 6
0
 public static bool SignOut()
 {
     if (!IsEnabled)
         throw new InvalidOperationException("成员管理器没有开启。");
     if (!IsSigned)
         return false;
     if (IsRunService)
         Wodsoft.Net.Service.ServiceContext.Current.Session["ComBoost_CurrentMember"] = null;
     else
         _MemberInfo = null;
     return true;
 }