From bf0c221536e6e1d439410148b3949e920fc588f4 Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Wed, 2 Nov 2011 02:22:01 +0000 Subject: [PATCH] Fixed a few warnings --- Activizr.sln | 1 - Database/Database-ConnectionsCommands.cs | 12 ++++++------ Database/Database-Countries.cs | 4 ++-- Database/Database-Geographies.cs | 12 ++++++------ Database/Database-Media.cs | 10 +++++----- Logic/Financial/Payout.cs | 2 +- 6 files changed, 20 insertions(+), 21 deletions(-) diff --git a/Activizr.sln b/Activizr.sln index 4623b450..db5cd255 100644 --- a/Activizr.sln +++ b/Activizr.sln @@ -3,7 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 11.00 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{23B3F006-BEDC-4CA3-8E3E-47C25146FB00}" ProjectSection(SolutionItems) = preProject license-this-code-is-in-public-domain.txt = license-this-code-is-in-public-domain.txt - Todo-Roadmap.txt = Todo-Roadmap.txt EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Logic", "Logic\Logic.csproj", "{13E59551-34AC-43DC-9A03-EF5E4721DC61}" diff --git a/Database/Database-ConnectionsCommands.cs b/Database/Database-ConnectionsCommands.cs index ee048c38..69a5c686 100644 --- a/Database/Database-ConnectionsCommands.cs +++ b/Database/Database-ConnectionsCommands.cs @@ -78,27 +78,27 @@ namespace Activizr.Database if (value is Type) { - if (value == typeof(int)) + if ((Type) value == typeof(int)) { parameterType = SqlDbType.Int; } - else if (value == typeof(DateTime)) + else if ((Type)value == typeof(DateTime)) { parameterType = SqlDbType.DateTime; } - else if (value == typeof(bool)) + else if ((Type)value == typeof(bool)) { parameterType = SqlDbType.Bit; } - else if (value == typeof(double) || value == typeof(float)) + else if ((Type)value == typeof(double) || (Type)value == typeof(float)) { parameterType = SqlDbType.Float; } - else if (value == typeof(decimal)) + else if ((Type)value == typeof(decimal)) { parameterType = SqlDbType.Money; } - else if (!(value == typeof(string))) + else if (!((Type)value == typeof(string))) { throw new Exception("Unhandled parameter type in AddParameterWithName: " + value.GetType().Name); } diff --git a/Database/Database-Countries.cs b/Database/Database-Countries.cs index be611cb9..dcfdb372 100644 --- a/Database/Database-Countries.cs +++ b/Database/Database-Countries.cs @@ -129,7 +129,7 @@ namespace Activizr.Database public int CreateCountry (string name, string code) { throw new NotImplementedException("Creating a country is not implemented at the moment. (It is not a common event.)"); - + /* using (DbConnection connection = GetMySqlDbConnection()) { connection.Open(); @@ -141,7 +141,7 @@ namespace Activizr.Database AddParameterWithName(command, "code", code); return Convert.ToInt32(command.ExecuteScalar()); - } + }*/ } } } \ No newline at end of file diff --git a/Database/Database-Geographies.cs b/Database/Database-Geographies.cs index a2a49aec..233be27c 100644 --- a/Database/Database-Geographies.cs +++ b/Database/Database-Geographies.cs @@ -303,7 +303,7 @@ namespace Activizr.Database public void SetGeographyName (int geographyId, string name) { throw new NotImplementedException("Renaming geographies is not migrated to MySQL"); - + /* using (DbConnection connection = GetMySqlDbConnection()) { connection.Open(); @@ -315,13 +315,13 @@ namespace Activizr.Database AddParameterWithName(command, "name", name); command.ExecuteNonQuery(); - } + }*/ } public Dictionary GetGeographyVoterCounts () { throw new NotImplementedException("Not Migrated to MySQL"); - + /* Dictionary result = new Dictionary(); using (DbConnection connection = GetMySqlDbConnection()) @@ -342,14 +342,14 @@ namespace Activizr.Database return result; } - } + }*/ } public void CreateGeographyOfficialDesignation (int geographyId, GeographyLevel level, int countryId, string designation) { throw new NotImplementedException("Not Migrated to MySQL"); - + /* using (DbConnection connection = GetMySqlDbConnection()) { connection.Open(); @@ -363,7 +363,7 @@ namespace Activizr.Database AddParameterWithName(command, "designation", designation); command.ExecuteNonQuery(); - } + }*/ } public int GetGeographyIdFromOfficialDesignation (int countryId, GeographyLevel level, string designation) diff --git a/Database/Database-Media.cs b/Database/Database-Media.cs index aa0a6553..ead136fb 100644 --- a/Database/Database-Media.cs +++ b/Database/Database-Media.cs @@ -43,22 +43,22 @@ namespace Activizr.Database public BasicMediaEntry[] GetBlogEntriesForKeyword (string keyword, DateTime minAge) // NOT ok { throw new NotImplementedException("Not yet migrated to MySQL: GetBlogEntriesForKeyword"); - + /* return ExecuteMediaDbQuery("SELECT * FROM MediaEntryView WHERE MediaKeyword='" + keyword.Replace("'", "''") + "' AND MediaEntryDateTime > '" + minAge.ToString("yyyy-MM-dd HH:mm:ss") + - "' AND IsBlog %ISTRUE% ORDER BY MediaEntryDateTime DESC"); + "' AND IsBlog %ISTRUE% ORDER BY MediaEntryDateTime DESC");*/ } public BasicMediaEntry[] GetOldMediaEntriesForKeyword (string keyword, DateTime minAge) // NOT ok { throw new NotImplementedException("Not yet migrated to MySQL: GetOldMediaEntriesForKeyword"); - + /* return ExecuteMediaDbQuery("SELECT * FROM MediaEntryView WHERE MediaKeyword='" + keyword.Replace("'", "''") + "' AND MediaEntryDateTime > '" + minAge.ToString("yyyy-MM-dd HH:mm:ss") + - "' AND IsBlog %ISFALSE% ORDER BY MediaEntryDateTime DESC"); + "' AND IsBlog %ISFALSE% ORDER BY MediaEntryDateTime DESC");*/ } private BasicMediaEntry[] ExecuteMediaDbQuery (string commandString) @@ -390,7 +390,7 @@ namespace Activizr.Database string mediaName = reader.GetString(1); PoliticalAffiliation politicalAffiliation = PoliticalAffiliation.Unknown; - result.Add(new BasicMedium(mediaId, mediaName, PoliticalAffiliation.Unknown)); + result.Add(new BasicMedium(mediaId, mediaName, politicalAffiliation)); } return result.ToArray(); diff --git a/Logic/Financial/Payout.cs b/Logic/Financial/Payout.cs index 48d7ffb0..637a835c 100644 --- a/Logic/Financial/Payout.cs +++ b/Logic/Financial/Payout.cs @@ -92,7 +92,7 @@ namespace Activizr.Logic.Financial public Salaries DependentSalariesNet; public Salaries DependentSalariesTax; - public new decimal Amount + public decimal Amount { set {