From 86b0918ca50e61f132fe978d5603f5284762209c Mon Sep 17 00:00:00 2001 From: tmont Date: Sun, 27 Feb 2011 08:47:16 +0000 Subject: [PATCH] added system icons --- Src/VideoGameQuotes.Api/Game.cs | 8 +- Src/VideoGameQuotes.Api/GamingSystem.cs | 17 ++++ .../Mappings/GamingSystem.hbm.xml | 1 + .../Controllers/GameController.cs | 12 ++- .../Controllers/SystemController.cs | 29 +++++- .../Models/EditSystemModel.cs | 4 + .../Views/Quote/EditQuoteForm.ascx | 10 +- .../Views/Shared/SingleQuote.ascx | 20 +++- .../NHibernate/SchemaExporter.cs | 95 +++++++++++++++---- .../NHibernate/schema.sql | 1 + 10 files changed, 170 insertions(+), 27 deletions(-) diff --git a/Src/VideoGameQuotes.Api/Game.cs b/Src/VideoGameQuotes.Api/Game.cs index 068b368..4628633 100644 --- a/Src/VideoGameQuotes.Api/Game.cs +++ b/Src/VideoGameQuotes.Api/Game.cs @@ -55,7 +55,8 @@ namespace VideoGameQuotes.Api { Systems = Systems.Select(system => system.ToDto()), Name = Name, Regions = Region.ToString().Split(',').Select(region => region.Trim()), - Publishers = Publishers.Select(publisher => publisher.ToDto()) + Publishers = Publishers.Select(publisher => publisher.ToDto()), + Icon = Icon != null ? Convert.ToBase64String(Icon) : null }; } @@ -84,7 +85,10 @@ namespace VideoGameQuotes.Api { public class GameDto { public int Id { get; set; } + [CanBeNull] public string Website { get; set; } + [CanBeNull] + public string Icon { get; set; } public DateTime Created { get; set; } public IEnumerable Systems { get; set; } public string Name { get; set; } @@ -95,7 +99,7 @@ namespace VideoGameQuotes.Api { public static class GameExtensions { public static string GetBase64EncodedIcon(this Game game) { if (game.Icon == null || game.Icon.Length == 0) { - return "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHBSURBVDjLlVM9aMJQEP6eNEF0sbiUouLgoLRkKXS1IG4dC6Xg2LXQRXATHbqVzq4iQjc3sVscnUSnYIdIB9GC4L/xL333IEFsBj04jpf77nt3l+8x0zRxaMViMbTdbtXVahVer9dYLBY/0+k0mcvltEPsGRzMMIyPQCAQ9ng8IAJd14OdTuedp+4PsS4ngslkctFoNNBsNgWB2+3GaDQKOWEdCTgY2WyW9Xo9QbBcLoUfTSDLsoiMMUFgkRxNwHeAdDpt+nw+8EUKp29O5rhEvnEoigJJktBqteD3+0/rgINNulHTNCjzGR5++1Bvb67x+vLF/dmxg3K5HOZB2+12MncxfzAYxJ25wcXjE5ixZCu9m/wufybfUqnLUqmUtwmomAtKi0ajcrVaxWAwQKFQEHOfK1dQajUwrwdSrw8ZEiKRSC4ej0NV1TwjJXI2IxaLyZwA4/FYFHL12T6fz+3o9XrhcrmQyWTQbreZ6IAnZS5dVCoVEpFYmFVEPpvNxJm+0zmRSIhoj0AJunU4HNogq3C/EwtHuqBfaxNQkhJ8NpGwAPtxs9n8c5ug2+2iXq/bojl0S41URKPuv2Dm9JxPsT8W0mO2IJm2EgAAAABJRU5ErkJggg=="; + return null; } return Convert.ToBase64String(game.Icon); diff --git a/Src/VideoGameQuotes.Api/GamingSystem.cs b/Src/VideoGameQuotes.Api/GamingSystem.cs index f395fcb..a1e37fb 100644 --- a/Src/VideoGameQuotes.Api/GamingSystem.cs +++ b/Src/VideoGameQuotes.Api/GamingSystem.cs @@ -1,4 +1,5 @@ using System; +using JetBrains.Annotations; using Portoa.Persistence; namespace VideoGameQuotes.Api { @@ -11,6 +12,8 @@ namespace VideoGameQuotes.Api { public virtual DateTime ReleaseDate { get; set; } public virtual string Name { get; set; } public virtual string Abbreviation { get; set; } + [CanBeNull] + public virtual byte[] Icon { get; set; } public virtual SystemDto ToDto() { return new SystemDto { @@ -18,6 +21,7 @@ namespace VideoGameQuotes.Api { Created = Created, ReleaseDate = ReleaseDate, Name = Name, + Icon = Icon != null ? Convert.ToBase64String(Icon) : null, Abbreviation = Abbreviation }; } @@ -29,5 +33,18 @@ namespace VideoGameQuotes.Api { public DateTime ReleaseDate { get; set; } public string Name { get; set; } public string Abbreviation { get; set; } + [CanBeNull] + public string Icon { get; set; } + } + + public static class SystemExtensions { + [CanBeNull] + public static string GetBase64EncodedIcon(this GamingSystem system) { + if (system.Icon == null || system.Icon.Length == 0) { + return null; + } + + return Convert.ToBase64String(system.Icon); + } } } \ No newline at end of file diff --git a/Src/VideoGameQuotes.Api/Mappings/GamingSystem.hbm.xml b/Src/VideoGameQuotes.Api/Mappings/GamingSystem.hbm.xml index b3b08ea..82d0410 100644 --- a/Src/VideoGameQuotes.Api/Mappings/GamingSystem.hbm.xml +++ b/Src/VideoGameQuotes.Api/Mappings/GamingSystem.hbm.xml @@ -10,6 +10,7 @@ + \ No newline at end of file diff --git a/Src/VideoGameQuotes.Web/Controllers/GameController.cs b/Src/VideoGameQuotes.Web/Controllers/GameController.cs index 255fbb1..919d6bb 100644 --- a/Src/VideoGameQuotes.Web/Controllers/GameController.cs +++ b/Src/VideoGameQuotes.Web/Controllers/GameController.cs @@ -48,7 +48,7 @@ namespace VideoGameQuotes.Web.Controllers { ModelState.AddModelError("GameId", "Invalid game ID"); } - var icon = new byte[0]; + byte[] icon = null; if (model.GameIcon != null) { icon = Convert.FromBase64String(model.GameIcon); if (icon.Length > 1024) { @@ -77,6 +77,14 @@ namespace VideoGameQuotes.Web.Controllers { [HttpPost, VerifyUser] public JsonResult Create(EditGameModel model) { + byte[] icon = null; + if (model.GameIcon != null) { + icon = Convert.FromBase64String(model.GameIcon); + if (icon.Length > 1024) { + ModelState.AddModelError("GameIcon", "Icon must be smaller than 1KB"); + } + } + if (!ModelState.IsValid) { return Json(this.CreateJsonErrorResponse("Some errors occurred.")); } @@ -85,7 +93,7 @@ namespace VideoGameQuotes.Web.Controllers { return Json(this.CreateJsonResponse("A game with that name for one of those systems already exists.")); } - var game = new Game { Name = model.GameName, Website = model.GameWebsite, Region = model.GameRegions, Creator = userProvider.CurrentUser }; + var game = new Game { Name = model.GameName, Website = model.GameWebsite, Region = model.GameRegions, Creator = userProvider.CurrentUser, Icon = icon }; model.SystemIds.Walk(id => game.AddSystem(new GamingSystem { Id = id })); if (model.PublisherIds != null) { model.PublisherIds.Walk(id => game.AddPublisher(new Publisher {Id = id})); diff --git a/Src/VideoGameQuotes.Web/Controllers/SystemController.cs b/Src/VideoGameQuotes.Web/Controllers/SystemController.cs index 18be251..a9b810e 100644 --- a/Src/VideoGameQuotes.Web/Controllers/SystemController.cs +++ b/Src/VideoGameQuotes.Web/Controllers/SystemController.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Linq; using System.Web.Mvc; using Portoa.Persistence; @@ -45,6 +46,14 @@ namespace VideoGameQuotes.Web.Controllers { ModelState.AddModelError("SystemId", "Invalid system ID"); } + byte[] icon = null; + if (model.SystemIcon != null) { + icon = Convert.FromBase64String(model.SystemIcon); + if (icon.Length > 1024) { + ModelState.AddModelError("SystemIcon", "Icon must be smaller than 1KB"); + } + } + if (!ModelState.IsValid) { return Json(this.CreateJsonErrorResponse("Some errors occurred")); } @@ -54,6 +63,7 @@ namespace VideoGameQuotes.Web.Controllers { system.Abbreviation = model.SystemAbbreviation; system.ReleaseDate = model.SystemReleaseDate; + system.Icon = icon; system = systemService.Save(system); return Json(this.CreateJsonResponse(data: system.ToDto())); @@ -61,6 +71,14 @@ namespace VideoGameQuotes.Web.Controllers { [HttpPost, VerifyUser] public ActionResult Create(EditSystemModel model) { + byte[] icon = null; + if (model.SystemIcon != null) { + icon = Convert.FromBase64String(model.SystemIcon); + if (icon.Length > 1024) { + ModelState.AddModelError("SystemIcon", "Icon must be smaller than 1KB"); + } + } + if (!ModelState.IsValid) { return Json(this.CreateJsonErrorResponse("Some errors occurred")); } @@ -69,7 +87,14 @@ namespace VideoGameQuotes.Web.Controllers { return Json(this.CreateJsonResponse("A system with that name or abbreviation already exists.")); } - var system = systemService.Save(new GamingSystem { Abbreviation = model.SystemAbbreviation, Name = model.SystemName, ReleaseDate = model.SystemReleaseDate }); + var system = new GamingSystem { + Abbreviation = model.SystemAbbreviation, + Name = model.SystemName, + ReleaseDate = model.SystemReleaseDate, + Icon = icon + }; + + system = systemService.Save(system); return Json(this.CreateJsonResponse(data: system.ToDto())); } } diff --git a/Src/VideoGameQuotes.Web/Models/EditSystemModel.cs b/Src/VideoGameQuotes.Web/Models/EditSystemModel.cs index deb78aa..cbe7cd7 100644 --- a/Src/VideoGameQuotes.Web/Models/EditSystemModel.cs +++ b/Src/VideoGameQuotes.Web/Models/EditSystemModel.cs @@ -4,6 +4,10 @@ using System.ComponentModel.DataAnnotations; namespace VideoGameQuotes.Web.Models { public class EditSystemModel { public int SystemId { get; set; } + + [StringLength(1024, ErrorMessage = "Icons must be less than 1KB")] + public string SystemIcon { get; set; } + [Required(ErrorMessage = "Systems must have a name, fatty")] public string SystemName { get; set; } [Required(ErrorMessage = "Abbreviation is required, ugly"), StringLength(12, ErrorMessage = "Abbreviations cannot be longer than 12 characters, flabcakes")] diff --git a/Src/VideoGameQuotes.Web/Views/Quote/EditQuoteForm.ascx b/Src/VideoGameQuotes.Web/Views/Quote/EditQuoteForm.ascx index 951ad79..f6e8014 100644 --- a/Src/VideoGameQuotes.Web/Views/Quote/EditQuoteForm.ascx +++ b/Src/VideoGameQuotes.Web/Views/Quote/EditQuoteForm.ascx @@ -77,9 +77,17 @@

<%= Html.Label("Release Date", "SystemReleaseDate", new { @class = "label" })%>
- <%= Html.TextBox("SystemReleaseDate", null) %> + <%= Html.TextBox("SystemReleaseDate") %>

+ <% if (Model.CurrentUser != null && Model.CurrentUser.Group >= UserGroup.Admin) { %> +

+ <%= Html.Label("Icon", "SystemIcon", new { @class = "label" })%> +
+ <%= Html.TextBox("SystemIcon")%> +

+ <% } %> +

Save System Cancel diff --git a/Src/VideoGameQuotes.Web/Views/Shared/SingleQuote.ascx b/Src/VideoGameQuotes.Web/Views/Shared/SingleQuote.ascx index 932a97d..2104182 100644 --- a/Src/VideoGameQuotes.Web/Views/Shared/SingleQuote.ascx +++ b/Src/VideoGameQuotes.Web/Views/Shared/SingleQuote.ascx @@ -41,13 +41,27 @@

diff --git a/Tests/VideoGameQuotes.Api.Tests/NHibernate/SchemaExporter.cs b/Tests/VideoGameQuotes.Api.Tests/NHibernate/SchemaExporter.cs index eadb23e..38d8887 100644 --- a/Tests/VideoGameQuotes.Api.Tests/NHibernate/SchemaExporter.cs +++ b/Tests/VideoGameQuotes.Api.Tests/NHibernate/SchemaExporter.cs @@ -41,30 +41,91 @@ namespace VideoGameQuotes.Api.Tests.NHibernate { CreateInitialData(session, admin); } + private static byte[] GetSystemIcon(string name) { + string base64String = null; + #region icon base64 encoded data + switch (name) { + case "360": + base64String = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACe0lEQVR4nMWSy0tUcQCFv9+d+5o7OuNcHZvRGR8tyrIWWSomKRaF2YMe0KCILVoURv9B0HsXtUlTsxcpZUVQ4EKwkKJFQZFktLTSIJ10tLA7zePeNi6iRbiJDhw4cL7lB/87rt92sSRJh2VZbrRt+ysw/Qe7VlGUY0Cl4ziTwDyAWDw3tx06OLhzz25d1zUeDw2n7t+59yAej08AmKYZibZE9zXu3K647Fn6+ocS13qu7gCeCICy1auedl7p2jQzPUsgGGDu+zy6ppKUZhBCYIh8bAd0vhCWO/iUOUf7kaPP3r0dq3MBy1vaWs8nf2bEpY5OvFlZRIojLCxYzEhviCcmURNBvqVVLrzLprp0F+5TZ0ltqCh6/uLlLQloXF9VKQLBAOVrVhOKFODWdXJ8PrR0Hl4RIi83j+X5XtrLXXTN97Jw6jh1TU0CaJTzl+VXmaaJpms0t0aJx+a4fPE6ZsBPtHUvhm4w+noUy7Kob6ijYaoef3YOHtUgGApVSYXhcLksy7gkF27dzdjoe8bHP/Lq5RtiUzEydobbA3e52deHlUhQWVCBpqgYhkFJSUm5bOaaRUISODgIBFUbK5iY+ExuwE8wuIxkMsmB5v0kUylUVUFVNRRZRiAIhUJFsqppXscBFqsoCjX11YyPf+D6zX6EEHiyPJStXIGTtnGrOrIsY9s2hmF4ZcuyLDuT0R2Xi9h0jJ7u3tTzkZGBhGU9BuKLnvh1t3tLw9Zt0dMnTyiRwjDpdJqFHz8sCsKFD7tu9Dodvd3Oug3rJ4Hav5hbW11TM/locNAZGh52SkpLHwIEvT7vGVVT2wHPEvT3KKra7vX5zgDBJfD/OL8AUqXSSNOauo4AAAAASUVORK5CYII="; + break; + case "fds": + base64String = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABnElEQVR4nNWSzUtUYRjFf++dq869Nxr1Kn1JUwniJyS2kmA2tQ0qwVW2kQIhXLVzk4vaBYILwYVuRAQhAqE/QSSqRW0lMSsYa/TG1Du396vFzIC5m50eOJyzeM7ZnAdOPURNu4CmBrMK2BMBzE7k45k43yE84cAZcIZKYqn8NDhrccZUecTLNHXrWj/3h2Hs3lRBxEOXGBloByvBSkofJHuvJEZWaeX/XiWJ2CkWx70chIWbF4ms5enMFggFQtGMIqc1rVrTpjXtWhNrTYdSdCrFOWs5C4EfQfD1/QIPFntJaUFOf2Z+9hf++SY6xzJY4+ELODi0lA4F1y4o3n7UXA8V0TNavAiymVaPidEioS5yv/CFnXf7vHxRZnXpG0srPzho3mVu8w+P1xxvvic8en2GT7EigqwfQtB15S+T3fvcuZUl3yOxKTwJS9WZvJToKty9XWawzzF64zdT5Qr9PZIAsuIhqPFufJGrbpOp0asRwAD2iAK4BNa20f4GLAfbTNaPvWMl7li4XmCBDViuP9LlWqYRGGC3wcxJxD8HtLlBUgFk6AAAAABJRU5ErkJggg=="; + break; + case "nes": + base64String = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABoklEQVR4nNWSu24TQQBFz8zO7MMCP+LYIibgBgRloKfiCxASCIREixAfwa8gIT6AhjJAUJQoEbQkDbISO2sTE1Cc3fXOYylA9LiC05/T3Av/PQKIgN6C/khcuXrt/cNHj2/9av0NFa9evtgQd+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KrRV0rRqu5U9J7nbqanik/RdNqdCClj4n4z9A4qr6Kg/x5AN60buenifd1yDDSNY6WInuduCmDSdvLbVm52SioFccDh909PgI1TmXk8cXH5GQkTTQj6Xs3tNetLv45raSfvOjOLykjZW4D2h3RqRsrecmYWVdrJu8DaaYANLP+FfCIywthnYP5x/QS/l+nrLLqt/wAAAABJRU5ErkJggg=="; + break; + case "gcn": + base64String = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACZklEQVR4nMWSS0tUYQCGn+87t7mdmc54SbO0i5gtzMiF3ShXtahAyGW4DKJF/Yr+gEQQtCuCahFSSVCbKDO6W6iB1tiUU844Os7NM2fO+dq4dOEmepYPL+/qgf+N2MA1AT1AB9Cw7paAeeAzkN3oICIQF5OxHedbk7t7m5LbhJNoJBqxAShXiiwXcmTzCyqT//YpX0rfUqjrQEUAjY3x7c8H+s7tS8STFAsl/izk6enrwDA1/HqAYWq8ffmNnr4O+g7t5cmj1zyduDudW00f13RpXj3YPnjGChl0djcz8yVF4AtymQqLCyWymRKZ9AqgiDsh3pku/Fnj1MCJplfvnlvSDjUf0zDZt7+V/iPdNLaEQUEQ+ES2mEQdEz8I0KTOh3id95e7mDqZxNliY4eaj+ko2hSKty++M/c1zc9UgbARxw98auUAUIDi6PIkhXGTh7c1Ys+WGUspULTpAs1xvTKoCJkfNUK6jdNgk18qMJsdR6mAHYle5mIGrpeg42YepQIqXhGB5siQEbV0aeAFLpomaWq1GRo+xM6uBqrVKu6ay6UrT7j2+AVGe42AOjW/iiEtwkbMklJI3zKj6MIklX/DQuY3k1+mmJ6ZRUrpCSm99FyE+ddRiquCVP4NujSxzAhCCF9365VsxS221H2X+dzky0R06+HxpyGJkiyVU3cA7o+eHh59FGVl7Wcwn5t81RzpPur5Ndx6eVGEDPteW/zAUCA8vucmzgIlQ7MGPb82C+rGem8XDM3s9Hz3AWDvaugfFcrg1+rH+wB7nFjrWNiyRwBtE/lrYcsecWItj4E9m9j/Y/4CVTv68jWErNkAAAAASUVORK5CYII="; + break; + case "gba": + base64String = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACHElEQVR4nNWSO09TYQCGn++c71zoDYSDQA9FLt5NHNDFReOkjqirg78A3Z1dwZi4+hMcHUw00UElxmiixKgotrS0tkdOW9rS79wcLJs/QJ/kzbs8eacX/nvEoHXgCHA+lxs5axjmEIAQf5RkICqleq3WzhvgOfAFiARwafHMuYeOMzFVLH7D834ShSFC09A0DYA4jkmSGCkNxp1JDs0u0KjXttfWXtwUhZm5p16jfjEMFWEYYaWznLpwmS4CpenshTHdbhe120Otv8QeCun4fWw7xeRk/pmU0pifm5/l1vIyq6v32PTajN64Rc626AtBJ4zxO32aDZ/g7kd6zTqjYw6OM04Si3kJOO12h+1qlXZ7l0jXeNJSpPowbOoIIWgh6GbTGIZk6eo1SGKEELx/98GRui4t399hZfU+owdG0FRCxjY5OZLicM5GABvtPdZ9CKVk7fUrWq02cZzg5guW1HUpTXsIgGxuGG+rgvngDvr0FA1Dp9ftEcRg1huYUUBjxwcE6UwOXUopgzj0jp84PVarVvCbHVKWhVErYtjQ7CviOEZLErLeL0QqjW1YZDJZptwCpR8bngCuH3RnVuYWjk1PTLiEgSJUCqUCgkABYJomhmFiWCaGaVKtlvn+9dNWrVy8vX8kASzqur6UL8xeybuFo9PuTLrgFgRAqVxKtsqlTqVc/FwpbT6OougR8BZI9gf+hj0IwN4g/yC/Acfl3bTkrOzdAAAAAElFTkSuQmCC"; + break; + case "dc": + base64String = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADDklEQVR4nH2T22tbdQDHP7/Tk+Zccm2aaJKm6UazNmDjrI5OV+06LxsMfVEY+DJ8EPegDw68PO3Zf0HFlz3MF4UhQ0FdB7PsUid2VszCYma6ybqmJieXc5LTXH4+TGFV8fv6vcAXvl/Bv2EIRXkjGo2/YvqDUwCtplXY2tz4TMrBh4DzoFj8w7z3kZl9n88vHNndsOtkK3cBQT76MCF/mIsXvir9vLbyMrC6I8AwzPfn5597fTqb2zX35CFRXi/xa6mA0mogFQVp+MhMZkmNTXD18pK8kf/p1vLytx87jv3BEJA4ceKdL9586+2I6fMJn+mn2Wpi2y1coSA9w5iGSWw0Riz2EJOT0+LYsVfDciAOrqx894kCHD5w4Bl16fx5Vi5fola9h6Z5KRbznDt7hnNnz1As5tE0Dc3rxePx0Gq1WFx8XgUOq7pu5pJjKcrlElL2CAZCyGaTYVVlc+MOAMOqiqZ50bwevnbLDBx4Kb4bXTdzaiQSTSJg9on9zO1/Gk3T6N2+TW5mFtnvAZCbmcUwdNKBTzlYXWS9E+bCwEskEk2qum4E6g2LUrGI3xdkajrLeCpFs9Vkz54sEuh1u6RTKeyKSkx0abQsfqx60HUjoApFDN0qFdnavEe1UmFkZITx8TSzj+6lWqshBIRDYQC60ddQv/yIRL/P0bkX+UYRQ6rrdtzEWALHsQmGQsTjCYRQAIiMRHaMZHvb5c5jL9Dr9xh0HFy346qNulVxHJvURAqA3zfKhIOj6JpJu90GQNd12h2bWn2Ltnt/iP1en0bdqqiWVSvWalVM00BKidtxsZ0WQghuFm4CkJnKIKWk2+3S73cRQmDbDpZVK6pSDq4VCr8wnc2y9UcNIRSkhGHPMKPRGCD4rbzOdncbIUDKAaORMIVCHikH11Rgee36qpOemDCuXL3C95cuLjWs2g+9XvcuYP9V31RVTzwQCj++76mFQ88uLrB2fdUBlgHw+wOnT757SkbjyRv/cbAd54vGk4WT752Sfn/g9INEZiy9qwoc/x/z3zieuq/NAPwJaks8AbN544kAAAAASUVORK5CYII="; + break; + case "wii": + base64String = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABNElEQVR4nJWRTU7DMBCFP3sSh1aVijgAEseiKxAViy44DAukXqAsEJwAdY3EAbhGHPoTJ7HNohUbbInO8vnpe288isRMp+eP17PZwhgjAH3X+dXz6snW9UPK/2fm83v39fEZrbXRWhvruo43t3cu5dUpsSwLfXF1SdN8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AAABJRU5ErkJggg=="; + break; + case "ps3": + base64String = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACFUlEQVR4nM2SzU4TYRhGz8w3P/2m00LaDkGKuGylaLAkxEBi3HoHrtwZXbpwZ+LOG3DrdbjhBlhiolEwBLQFoVPa0pl2OtPOdNxAQiTBLWf7PO+zeQ/cNvKAfkOuXXSuIQqFwvbGxka6Vl8LTcP48G9B1/V39Xo92NzcTB3H2QGMy0UURXm1Vq8/tnN5TMMwh8HwzeHBYfHqwNK9pefVSkUiVHK2vbq1tfV6mqYfFaBQrVSOqtX78rD5h/K8Q9aSWFJSLi+STBNOT04IRiOCYcBQA0fL8PXH99Hu7u6iBqzbti339g+Yc0q02l2Kszl6vT4/9/ZAUbAsG0NR0VSBTBWmXo+ZfF4C6ypQ6/fOMdUU122jTieoegbP80mmKZpuMEmmDJOEk67LWBHsd85ouy5ATRNCrJimSUZKxn0P34vwooQoGLDgFDnvdpmgEY4jjDTGO+9TKBbp9noIIVZU0zBq+Zk883cW8AY+3sDH0iAnTX41G52zXrejxCGzlkmapli2TfnuIo5TwtCNmpYxM8tSWoRRiKEbNI6aO5M4TkdB4A6Gw5cA/X7/k2VZc57nKasPHj5KkoRiqUQ221zWhBBJRkrieEIYhUkcxy/a7fa3qy8MguBZEAQAKy239aVYKolsNouu64kIo3CiKurTVut0dHR8/Bb4fIOJruf7nWg8fuL5Pr8bjfeXQeY/Cl8T8+LmFvAXCoPe95D1H9oAAAAASUVORK5CYII="; + break; + case "snes": + base64String = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAB0UlEQVR4nO2SO2hTYQCFv/9e8T6aNKbFpK1NhdgS89B0yRAnhaKbg+BqcWhRlw461EF0st3qJqiIiiiCdHIrQi10qyhUUwxGm9yY3Ca0NElDJffloBQnJxfBs5zpnOF8B/5L/PKTkYHIdGRgMCGEJP4U8DzXMyrlnFExZoFFAZy9fPHK/IlMVjZrG/SFwnT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nDun2KMTCYZeZ7jfSB4z6ePH54XRfgMPD14mnlAH3IkAbYP6Rwl/gIaq8NNl57HIwAAAABJRU5ErkJggg=="; + break; + case "xbox": + base64String = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACbUlEQVR4nKWTQYscRRiGn+qqrqkZ3O5ZE9RsMm42uSRHRY0QENF40Q0EEfYXePfmH8g/kdzEU/Ai5AeELIiseDAmBNlkUXamZ3a6q6uqq8rLIHpT8l6eD973+y4fL7ykxD9mCXyx4RPgKdBsvCmwB1wBIvDthn8fKMeT8Xdv3XhnP8ZITpkhBIIPGaDUpVBlSSYjEPx0+OP93trPgaAApJR3337/vf2tespkYogx4fuALkdCCIELjkJkqmoLrTQ5sn/48OHdFOPXEtjdmc3ujSeV7K1jtWrJKWFbz82bu8wuv8rTx6f0rueDGx2/P28ZhhIfwrurZvmNRIivrl679nFve2zXUU9rFvMVGUEuFrTdmvk8sVqd8cZrZ+S54PbrWxy1Qr44Pm6UMeaWlJLZ7oyR0XRdz2jkMCYg8prlvEVJQ1EIHjW3cfmYE/snUimMMbdUqfV17z1Ns6SuKuIQGYZITIZVs0NRCNpugRAR9+yQnAfCh4Lh10ipR9cVQmy73lPXNYv5glfqCms71mvLslmTyQQfGGnF9uYTp/cDrncIIbZVTll458gp03UdznvikCikwntPzlAqibUOM+6BTAa88+ScRRFjtD4EXjw/4cLFC1y8tIM2huA9QwikFOl7i1QlVV1hzJhmviSEQErJSinll3o0noIgZ/jl6Ch7H0WpNVpriqIgZ2jXa5799jiPxhNhu54YB9qz1bEaQvg5pXRZSoldN6enf5x8BHyqlP5EluUVgBjCk2HwPwDfu+78g6KQ55yLhOCPAA6q6bl0aXcvAQf/oT8Hb+5dTfX2+X/lPwPu/I8S3tnsvLz+AglTQvWE9wzEAAAAAElFTkSuQmCC"; + break; + case "ps": + base64String = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACKklEQVR4nM2SwUuTYRzHv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jQozygtaY2MM/xzgnKcoStpTU+R5jnUeVa1qgbKqqKqKyjqaaROTGLJmxl5/gLOOZpZtpI109fifBv+30VRVmSxe617xzv9Q1fUQ4hcNYb0qq4/W2pernz48evrk8QEQDy8JZ1znv+aXJXTj4At0AAAAAElFTkSuQmCC"; + break; + } + #endregion + + return base64String != null ? Convert.FromBase64String(base64String) : null; + } + private static void CreateInitialData(ISession session, User creator) { #region systems - var fds = new GamingSystem { Abbreviation = "FDS", Name = "Family Computer Disk System", ReleaseDate = new DateTime(1986, 2, 21) }; - var nes = new GamingSystem { Abbreviation = "NES", Name = "Nintendo Entertainment System", ReleaseDate = new DateTime(1985, 10, 18) }; - var snes = new GamingSystem { Abbreviation = "SNES", Name = "Super Nintendo Entertainment System", ReleaseDate = new DateTime(1991, 8, 23) }; - var genny = new GamingSystem { Abbreviation = "Genesis", Name = "Sega Genesis", ReleaseDate = new DateTime(1989, 10, 14) }; - var ps = new GamingSystem { Abbreviation = "PS", Name = "PlayStation", ReleaseDate = new DateTime(1995, 9, 9) }; - var ps2 = new GamingSystem { Abbreviation = "PS2", Name = "PlayStation 2", ReleaseDate = new DateTime(2000, 3, 4) }; - var xbox = new GamingSystem { Abbreviation = "Xbox", Name = "Xbox", ReleaseDate = new DateTime(2002, 2, 22) }; - var n64 = new GamingSystem { Abbreviation = "N64", Name = "Nintendo 64", ReleaseDate = new DateTime(1996, 9, 29) }; - var gcn = new GamingSystem { Abbreviation = "GCN", Name = "Nintendo GameCube", ReleaseDate = new DateTime(2001, 11, 18) }; - var dc = new GamingSystem { Abbreviation = "DC", Name = "Dreamcast", ReleaseDate = new DateTime(1999, 9, 9) }; - var wii = new GamingSystem { Abbreviation = "Wii", Name = "Wii", ReleaseDate = new DateTime(2006, 11, 19) }; - var xbox360 = new GamingSystem { Abbreviation = "360", Name = "Xbox 360", ReleaseDate = new DateTime(2005, 11, 16) }; - var ps3 = new GamingSystem { Abbreviation = "PS3", Name = "PlayStation 3", ReleaseDate = new DateTime(2006, 11, 17) }; + var fds = new GamingSystem { Abbreviation = "FDS", Name = "Family Computer Disk System", ReleaseDate = new DateTime(1986, 2, 21), Icon = GetSystemIcon("fds") }; + var nes = new GamingSystem { Abbreviation = "NES", Name = "Nintendo Entertainment System", ReleaseDate = new DateTime(1985, 10, 18), Icon = GetSystemIcon("nes") }; + var snes = new GamingSystem { Abbreviation = "SNES", Name = "Super Nintendo Entertainment System", ReleaseDate = new DateTime(1991, 8, 23), Icon = GetSystemIcon("snes") }; + var genny = new GamingSystem { Abbreviation = "Genesis", Name = "Sega Genesis", ReleaseDate = new DateTime(1989, 10, 14), Icon = GetSystemIcon("genny") }; + var ps = new GamingSystem { Abbreviation = "PS", Name = "PlayStation", ReleaseDate = new DateTime(1995, 9, 9), Icon = GetSystemIcon("ps") }; + var ps2 = new GamingSystem { Abbreviation = "PS2", Name = "PlayStation 2", ReleaseDate = new DateTime(2000, 3, 4), Icon = GetSystemIcon("ps2") }; + var xbox = new GamingSystem { Abbreviation = "Xbox", Name = "Xbox", ReleaseDate = new DateTime(2002, 2, 22), Icon = GetSystemIcon("xbox") }; + var n64 = new GamingSystem { Abbreviation = "N64", Name = "Nintendo 64", ReleaseDate = new DateTime(1996, 9, 29), Icon = GetSystemIcon("n64") }; + var gcn = new GamingSystem { Abbreviation = "GCN", Name = "Nintendo GameCube", ReleaseDate = new DateTime(2001, 11, 18), Icon = GetSystemIcon("gcn") }; + var dc = new GamingSystem { Abbreviation = "DC", Name = "Dreamcast", ReleaseDate = new DateTime(1999, 9, 9), Icon = GetSystemIcon("dc") }; + var wii = new GamingSystem { Abbreviation = "Wii", Name = "Wii", ReleaseDate = new DateTime(2006, 11, 19), Icon = GetSystemIcon("wii") }; + var xbox360 = new GamingSystem { Abbreviation = "360", Name = "Xbox 360", ReleaseDate = new DateTime(2005, 11, 16), Icon = GetSystemIcon("360") }; + var ps3 = new GamingSystem { Abbreviation = "PS3", Name = "PlayStation 3", ReleaseDate = new DateTime(2006, 11, 17), Icon = GetSystemIcon("ps3") }; var tgfx = new GamingSystem { Abbreviation = "TGfx", Name = "TurboGrafx-16 Entertainment SuperSystem", ReleaseDate = new DateTime(1989, 10, 29) }; var pc = new GamingSystem { Abbreviation = "PC", Name = "Personal Computer", ReleaseDate = new DateTime(1980, 1, 1) }; - var gb = new GamingSystem { Abbreviation = "GB", Name = "Game Boy", ReleaseDate = new DateTime(1989, 7, 31) }; + var gb = new GamingSystem { Abbreviation = "GB", Name = "Game Boy", ReleaseDate = new DateTime(1989, 7, 31), Icon = GetSystemIcon("gb") }; var gbc = new GamingSystem { Abbreviation = "GBC", Name = "Game Boy Color", ReleaseDate = new DateTime(1998, 11, 18) }; - var gba = new GamingSystem { Abbreviation = "GBA", Name = "Game Boy Advance", ReleaseDate = new DateTime(2001, 6, 11) }; - var nds = new GamingSystem { Abbreviation = "NDS", Name = "Nintendo DS", ReleaseDate = new DateTime(2004, 11, 21) }; - var psp = new GamingSystem { Abbreviation = "PSP", Name = "PlayStation Portable", ReleaseDate = new DateTime(2005, 3, 24) }; + var gba = new GamingSystem { Abbreviation = "GBA", Name = "Game Boy Advance", ReleaseDate = new DateTime(2001, 6, 11), Icon = GetSystemIcon("gba") }; + var nds = new GamingSystem { Abbreviation = "NDS", Name = "Nintendo DS", ReleaseDate = new DateTime(2004, 11, 21), Icon = GetSystemIcon("nds") }; + var psp = new GamingSystem { Abbreviation = "PSP", Name = "PlayStation Portable", ReleaseDate = new DateTime(2005, 3, 24), Icon = GetSystemIcon("psp") }; var arcade = new GamingSystem { Abbreviation = "Arcade", Name = "Arcade", ReleaseDate = new DateTime(1966, 1, 1) }; diff --git a/Tests/VideoGameQuotes.Api.Tests/NHibernate/schema.sql b/Tests/VideoGameQuotes.Api.Tests/NHibernate/schema.sql index 603ddcf..60c6820 100644 --- a/Tests/VideoGameQuotes.Api.Tests/NHibernate/schema.sql +++ b/Tests/VideoGameQuotes.Api.Tests/NHibernate/schema.sql @@ -167,6 +167,7 @@ alter table quote_category_map drop foreign key FK5892F846C2AA09DD system_abbreviation VARCHAR(12) unique, created DATETIME not null, release_date DATETIME, + icon BLOB, primary key (system_id) );