Fixed a few warnings

This commit is contained in:
Rick Falkvinge
2011-11-02 02:22:01 +00:00
parent dea320f960
commit bf0c221536
6 changed files with 20 additions and 21 deletions
+6 -6
View File
@@ -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);
}
+2 -2
View File
@@ -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());
}
}*/
}
}
}
+6 -6
View File
@@ -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<int, int> GetGeographyVoterCounts ()
{
throw new NotImplementedException("Not Migrated to MySQL");
/*
Dictionary<int, int> result = new Dictionary<int, int>();
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)
+5 -5
View File
@@ -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();