public void method_0() { Logging.smethod_0("Loading Quests.."); this.Quests.Clear(); DataTable dataTable = null; DataTable dataTable2 = null; using (DatabaseClient @class = GoldTree.GetDatabase().GetClient()) { dataTable = @class.ReadDataTable("SELECT Id,type,action,needofcount,level_num,pixel_reward FROM quests WHERE enabled = '1' ORDER by level_num"); dataTable2 = @class.ReadDataTable("SELECT COUNT(*) as count FROM quests GROUP BY type ORDER BY count DESC;"); } if (dataTable != null) { foreach (DataRow dataRow in dataTable.Rows) { Quest class2 = new Quest((uint)dataRow["Id"], (string)dataRow["type"], (string)dataRow["action"], (int)dataRow["needofcount"], (int)dataRow["level_num"], (int)dataRow["pixel_reward"]); if (class2 != null) { this.Quests.Add(class2); } } //Logging.WriteLine("completed!"); } if (dataTable2 != null) { QuestsCount = dataTable2.Rows.Count; Logging.WriteLine("completed!"); } }