public void Register() { RepositoryServer repositoryServer = new RepositoryServer(); repositoryServer.Save(this); Console.WriteLine("注册成功"); }
//public Repoistory repoistory; //public int Rewardtype; //public User Answer; //public int Summary; #endregion //这两个需要整合一下,不过暂时先搁置 //没设置参数,因为在实现 #region 发布 public override void Publish() { _publishTime = DateTime.Now; RepositoryServer repositoryServer = new RepositoryServer(); repositoryServer.Save(this); }
public void Login() { RepositoryServer repositoryServer = new RepositoryServer(); string dbPassword = repositoryServer.GetPassWord(this); if (dbPassword is null) { Console.WriteLine("用户名不存在"); return; } else { if (_password == dbPassword) { Console.WriteLine("密码正确"); } else { Console.WriteLine("密码错误"); } } }