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; }
public abstract bool Edit(MemberInfo memberInfo);
public override bool Edit(MemberInfo memberInfo) { data.Entry <MemberInfo>(memberInfo).State = Data.Entity.EntityState.Modified; return(data.SaveChanges() > 0); }
public override bool Edit(MemberInfo memberInfo) { data.Entry<MemberInfo>(memberInfo).State = Data.Entity.EntityState.Modified; return data.SaveChanges() > 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; }
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; }