예제 #1
0
 public static bool LoadNobilityBoard()
 {
     using (var sql = new SqlHandler(Program.Config.ReadString("GameConnectionString")))
     {
         using (var cmd = new SqlCommandBuilder(sql, SqlCommandType.SELECT, false))
         {
             cmd.Finish("DB_NobilityBoard");
         }
         while (sql.Read())
         {
             Data.NobilityDonation donation = new ProjectX_V3_Game.Data.NobilityDonation();
             donation.DatabaseID = sql.ReadInt32("PlayerID");
             donation.Name = sql.ReadString("PlayerName");
             donation.Donation = sql.ReadInt64("NobilityDonation");
             donation.Rank = Enums.NobilityRank.Serf;
             donation.OldRank = donation.Rank;
             donation.RecordID = sql.ReadInt32("NobilityID");
             if (!Data.NobilityBoard.AddNobility(donation))
             {
                 return false;
             }
         }
     }
     Data.NobilityBoard.GetTop50();
     return true;
 }