//更新管理员密码(传过来的新密码为密文) public void updateAdminPw(string name, string newPw) { AdminInfo admin = new AdminInfo(name, newPw, false); string sql = "update admins set pw='" + admin.getpw() + "' where name='" + admin.getname() + "'"; SQLiteCommand command = new SQLiteCommand(sql, dbConnection); command.ExecuteNonQuery(); }
//插入管理员数据 public void insertAdminInfo(AdminInfo admin) { string sql = "insert into admins values('" + admin.getname() + "','" + admin.getpw() + "')"; SQLiteCommand command = new SQLiteCommand(sql, dbConnection); command.ExecuteNonQuery(); }