/// <summary> /// 激活用户通过用户模型 /// </summary> /// <param name="model">用户模型</param> public void RefreshAccountByAccount(ForbiddenAccountDspModel model) { IRepository <ForbiddenAccount> accRep = Factory.Factory <IRepository <ForbiddenAccount> > .GetConcrete <ForbiddenAccount>(); ForbiddenAccount fac = new ForbiddenAccount() { AccountID = model.AccountID, ForbiddenTime = model.ForbiddenTime, ForbiddenType = model.ForbiddenType, IP = model.IP, RefreshTime = model.RefreshTime, State = model.State, UserName = model.UserName }; accRep.Update(fac); accRep.PersistAll(); }
/// <summary> /// 检查是否被禁用 /// </summary> /// <param name="uid">用户编号</param> /// <returns></returns> public bool CheckForbidden(Guid uid) { IRepository <ForbiddenAccount> accRep = Factory.Factory <IRepository <ForbiddenAccount> > .GetConcrete <ForbiddenAccount>(); ForbiddenAccount ak = accRep.Find(new Specification <ForbiddenAccount>(uf => uf.AccountID == uid)); if (ak != null) { return(true); } else { return(false); } }
/// <summary> /// 禁用账户通过用户模型 /// </summary> /// <param name="model">用户模型</param> /// <returns></returns> public bool ForbiddenAccountByAccount(ForbiddenAccountDspModel model) { IRepository <ForbiddenAccount> accRep = Factory.Factory <IRepository <ForbiddenAccount> > .GetConcrete <ForbiddenAccount>(); ForbiddenAccount ak = accRep.Find(new Specification <ForbiddenAccount>(uf => uf.AccountID == model.AccountID)); if (ak == null) { ForbiddenAccount fac = new ForbiddenAccount(model.AccountID, model.UserName, model.IP, model.ForbiddenTime, model.RefreshTime, model.State, model.ForbiddenType); accRep.Add(fac); accRep.PersistAll(); return(true); } return(false); }