diff --git a/Cicm.Database/Operations/Company.cs b/Cicm.Database/Operations/Company.cs index 52fa9b37..fa127438 100644 --- a/Cicm.Database/Operations/Company.cs +++ b/Cicm.Database/Operations/Company.cs @@ -394,6 +394,10 @@ namespace Cicm.Database entry.LastLogo = entry.Logos[0]; } + if(GetCompanyDescriptionsByCompany(out List descriptions, entry.Id)) + if(descriptions != null && descriptions.Count > 0) + entry.Description = descriptions[0].Text; + entries.Add(entry); } diff --git a/Cicm.Database/Operations/CompanyDescription.cs b/Cicm.Database/Operations/CompanyDescription.cs new file mode 100644 index 00000000..ec4c74e6 --- /dev/null +++ b/Cicm.Database/Operations/CompanyDescription.cs @@ -0,0 +1,329 @@ +/****************************************************************************** +// Canary Islands Computer Museum Website +// ---------------------------------------------------------------------------- +// +// Filename : CompanyDescription.cs +// Author(s) : Natalia Portillo +// +// --[ Description ] ---------------------------------------------------------- +// +// Contains operations to manage company descriptions. +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2003-2018 Natalia Portillo +*******************************************************************************/ + +using System; +using System.Collections.Generic; +using System.Data; +using Cicm.Database.Schemas; +using Console = System.Console; + +namespace Cicm.Database +{ + public partial class Operations + { + /// + /// Gets all company descriptions + /// + /// All company descriptions + /// true if is correct, false otherwise + public bool GetCompanyDescriptions(out List entries) + { + #if DEBUG + Console.WriteLine("Getting all company descriptions..."); + #endif + + try + { + const string SQL = "SELECT * from company_descriptions"; + + IDbCommand dbCmd = dbCon.CreateCommand(); + IDbDataAdapter dataAdapter = dbCore.GetNewDataAdapter(); + dbCmd.CommandText = SQL; + DataSet dataSet = new DataSet(); + dataAdapter.SelectCommand = dbCmd; + dataAdapter.Fill(dataSet); + + entries = CompanyDescriptionsFromDataTable(dataSet.Tables[0]); + + return true; + } + catch(Exception ex) + { + Console.WriteLine("Error getting company descriptions."); + Console.WriteLine(ex); + entries = null; + return false; + } + } + + /// + /// Gets the specified number of company descriptions since the specified start + /// + /// List of company_descriptions + /// Start of query + /// How many entries to retrieve + /// true if is correct, false otherwise + public bool GetCompanyDescriptions(out List entries, ulong start, ulong count) + { + #if DEBUG + Console.WriteLine("Getting {0} company descriptions from {1}...", count, start); + #endif + + try + { + string sql = $"SELECT * FROM company_descriptions LIMIT {start}, {count}"; + + IDbCommand dbCmd = dbCon.CreateCommand(); + IDbDataAdapter dataAdapter = dbCore.GetNewDataAdapter(); + dbCmd.CommandText = sql; + DataSet dataSet = new DataSet(); + dataAdapter.SelectCommand = dbCmd; + dataAdapter.Fill(dataSet); + + entries = CompanyDescriptionsFromDataTable(dataSet.Tables[0]); + + return true; + } + catch(Exception ex) + { + Console.WriteLine("Error getting company descriptions."); + Console.WriteLine(ex); + entries = null; + return false; + } + } + + /// + /// Gets company description by specified id + /// + /// Id + /// CompanyDescription with specified id, null if not found or error + public CompanyDescription GetCompanyDescription(int id) + { + #if DEBUG + Console.WriteLine("Getting company description with id {0}...", id); + #endif + + try + { + string sql = $"SELECT * from company_descriptions WHERE id = '{id}'"; + + IDbCommand dbCmd = dbCon.CreateCommand(); + IDbDataAdapter dataAdapter = dbCore.GetNewDataAdapter(); + dbCmd.CommandText = sql; + DataSet dataSet = new DataSet(); + dataAdapter.SelectCommand = dbCmd; + dataAdapter.Fill(dataSet); + + List entries = CompanyDescriptionsFromDataTable(dataSet.Tables[0]); + + return entries == null || entries.Count == 0 ? null : entries[0]; + } + catch(Exception ex) + { + Console.WriteLine("Error getting company."); + Console.WriteLine(ex); + return null; + } + } + + /// + /// Gets company description by specified id + /// + /// List of company_descriptions + /// Company id + /// CompanyDescription with specified id, null if not found or error + public bool GetCompanyDescriptionsByCompany(out List entries, int company) + { + #if DEBUG + Console.WriteLine("Getting company descriptions for company {0}...", company); + #endif + + try + { + string sql = $"SELECT * FROM company_descriptions WHERE company_id = {company}"; + + IDbCommand dbCmd = dbCon.CreateCommand(); + IDbDataAdapter dataAdapter = dbCore.GetNewDataAdapter(); + dbCmd.CommandText = sql; + DataSet dataSet = new DataSet(); + dataAdapter.SelectCommand = dbCmd; + dataAdapter.Fill(dataSet); + + entries = CompanyDescriptionsFromDataTable(dataSet.Tables[0]); + + return true; + } + catch(Exception ex) + { + Console.WriteLine("Error getting company descriptions."); + Console.WriteLine(ex); + entries = null; + return false; + } + } + + /// + /// Counts the number of company descriptions in the database + /// + /// Entries in database + public long CountCompanyDescriptions() + { + #if DEBUG + Console.WriteLine("Counting company descriptions..."); + #endif + + IDbCommand dbcmd = dbCon.CreateCommand(); + dbcmd.CommandText = "SELECT COUNT(*) FROM company_descriptions"; + object count = dbcmd.ExecuteScalar(); + dbcmd.Dispose(); + try { return Convert.ToInt64(count); } + catch { return 0; } + } + + /// + /// Adds a new company description to the database + /// + /// Entry to add + /// ID of added entry + /// true if added correctly, false otherwise + public bool AddCompanyDescription(CompanyDescription entry, out long id) + { + #if DEBUG + Console.Write("Adding description for company id `{0}`...", entry.CompanyId); + #endif + + IDbCommand dbcmd = GetCommandCompanyDescription(entry); + IDbTransaction trans = dbCon.BeginTransaction(); + dbcmd.Transaction = trans; + + const string SQL = + "INSERT INTO company_descriptions (company_id, text) VALUES (@company_id, @text)"; + + dbcmd.CommandText = SQL; + + dbcmd.ExecuteNonQuery(); + trans.Commit(); + dbcmd.Dispose(); + + id = dbCore.LastInsertRowId; + + #if DEBUG + Console.WriteLine(" id {0}", id); + #endif + + return true; + } + + /// + /// Updated a company description in the database + /// + /// Updated entry + /// true if updated correctly, false otherwise + public bool UpdateCompanyDescription(CompanyDescription entry) + { + #if DEBUG + Console.WriteLine("Updating company description id `{0}`...", entry.Id); + #endif + + IDbCommand dbcmd = GetCommandCompanyDescription(entry); + IDbTransaction trans = dbCon.BeginTransaction(); + dbcmd.Transaction = trans; + + string sql = "UPDATE company_descriptions SET company_id = @company_id, text = @text " + + $"WHERE id = {entry.Id}"; + + dbcmd.CommandText = sql; + + dbcmd.ExecuteNonQuery(); + trans.Commit(); + dbcmd.Dispose(); + + return true; + } + + /// + /// Removes a company description from the database + /// + /// ID of entry to remove + /// true if removed correctly, false otherwise + public bool RemoveCompanyDescription(long id) + { + #if DEBUG + Console.WriteLine("Removing company description with id `{0}`...", id); + #endif + + IDbCommand dbcmd = dbCon.CreateCommand(); + IDbTransaction trans = dbCon.BeginTransaction(); + dbcmd.Transaction = trans; + + string sql = $"DELETE FROM company_descriptions WHERE id = '{id}';"; + + dbcmd.CommandText = sql; + + dbcmd.ExecuteNonQuery(); + trans.Commit(); + dbcmd.Dispose(); + + return true; + } + + IDbCommand GetCommandCompanyDescription(CompanyDescription entry) + { + IDbCommand dbcmd = dbCon.CreateCommand(); + + IDbDataParameter param1 = dbcmd.CreateParameter(); + IDbDataParameter param2 = dbcmd.CreateParameter(); + + param1.ParameterName = "@company_id"; + param2.ParameterName = "@text"; + + param1.DbType = DbType.String; + param2.DbType = DbType.String; + + param1.Value = entry.CompanyId; + param2.Value = entry.Text; + + dbcmd.Parameters.Add(param1); + dbcmd.Parameters.Add(param2); + + return dbcmd; + } + + static List CompanyDescriptionsFromDataTable(DataTable dataTable) + { + List entries = new List(); + + foreach(DataRow dataRow in dataTable.Rows) + { + CompanyDescription entry = new CompanyDescription + { + Id = int.Parse(dataRow["id"].ToString()), + CompanyId = int.Parse(dataRow["company_id"].ToString()), + Text = dataRow["text"].ToString() + }; + + entries.Add(entry); + } + + return entries; + } + } +} \ No newline at end of file diff --git a/Cicm.Database/Operations/Operations.cs b/Cicm.Database/Operations/Operations.cs index 396b0b82..baaabf42 100644 --- a/Cicm.Database/Operations/Operations.cs +++ b/Cicm.Database/Operations/Operations.cs @@ -35,7 +35,7 @@ namespace Cicm.Database public partial class Operations { /// Last known database version - const int DB_VERSION = 8; + const int DB_VERSION = 9; readonly IDbConnection dbCon; readonly IDbCore dbCore; diff --git a/Cicm.Database/Operations/Update.cs b/Cicm.Database/Operations/Update.cs index 59f35471..0b96cbf7 100644 --- a/Cicm.Database/Operations/Update.cs +++ b/Cicm.Database/Operations/Update.cs @@ -108,6 +108,11 @@ namespace Cicm.Database UpdateDatabaseToV8(); break; } + case 8: + { + UpdateDatabaseToV9(); + break; + } } OptimizeDatabase(); @@ -804,6 +809,26 @@ namespace Cicm.Database dbCmd.Dispose(); } + void UpdateDatabaseToV9() + { + Console.WriteLine("Updating database to version 9"); + + Console.WriteLine("Creating table `company_descriptions`"); + IDbCommand dbCmd = dbCon.CreateCommand(); + IDbTransaction trans = dbCon.BeginTransaction(); + dbCmd.Transaction = trans; + dbCmd.CommandText = V9.CompanyDescriptions; + dbCmd.ExecuteNonQuery(); + trans.Commit(); + dbCmd.Dispose(); + + Console.WriteLine("Setting new database version to 9..."); + dbCmd = dbCon.CreateCommand(); + dbCmd.CommandText = "INSERT INTO cicm_db (version) VALUES ('9')"; + dbCmd.ExecuteNonQuery(); + dbCmd.Dispose(); + } + void OptimizeDatabase() { IDbCommand dbCmd = dbCon.CreateCommand(); diff --git a/Cicm.Database/Schemas/Company.cs b/Cicm.Database/Schemas/Company.cs index ca4a5049..75889fbf 100644 --- a/Cicm.Database/Schemas/Company.cs +++ b/Cicm.Database/Schemas/Company.cs @@ -67,5 +67,7 @@ namespace Cicm.Database.Schemas public string Twitter; /// Website public string Website; + /// Description + public string Description; } } \ No newline at end of file diff --git a/Cicm.Database/Schemas/CompanyDescription.cs b/Cicm.Database/Schemas/CompanyDescription.cs new file mode 100644 index 00000000..443bb432 --- /dev/null +++ b/Cicm.Database/Schemas/CompanyDescription.cs @@ -0,0 +1,45 @@ +/****************************************************************************** +// Canary Islands Computer Museum Website +// ---------------------------------------------------------------------------- +// +// Filename : Company.cs +// Author(s) : Natalia Portillo +// +// --[ Description ] ---------------------------------------------------------- +// +// High level representation of a company. +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2003-2018 Natalia Portillo +*******************************************************************************/ + +using System; + +namespace Cicm.Database.Schemas +{ + /// Company description + public class CompanyDescription + { + /// ID + public int Id; + /// Company ID + public int CompanyId; + /// Description + public string Text; + } +} \ No newline at end of file diff --git a/Cicm.Database/Schemas/Sql/V9.cs b/Cicm.Database/Schemas/Sql/V9.cs new file mode 100644 index 00000000..7bf305ad --- /dev/null +++ b/Cicm.Database/Schemas/Sql/V9.cs @@ -0,0 +1,97 @@ +/****************************************************************************** +// Canary Islands Computer Museum Website +// ---------------------------------------------------------------------------- +// +// Filename : V8.cs +// Author(s) : Natalia Portillo +// +// --[ Description ] ---------------------------------------------------------- +// +// Contains SQL queries to create the database version 7. +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright © 2003-2018 Natalia Portillo +*******************************************************************************/ + +namespace Cicm.Database.Schemas.Sql +{ + public static class V9 + { + public static readonly string Admins = V8.Admins; + + public static readonly string BrowserTests = V8.BrowserTests; + + public static readonly string CicmDb = "CREATE TABLE `cicm_db` (\n" + + "`id` int(11) NOT NULL AUTO_INCREMENT,\n" + + "`version` int(11) NOT NULL,\n" + + "`updated` datetime DEFAULT CURRENT_TIMESTAMP,\n" + + "PRIMARY KEY (`id`)\n" + ");\n" + + "INSERT INTO cicm_db (version) VALUES ('9');"; + + public static readonly string Companies = V8.Companies; + + public static readonly string Computers = V8.Computers; + + public static readonly string Consoles = V8.Consoles; + + public static readonly string DiskFormats = V8.DiskFormats; + + public static readonly string Forbidden = V8.Forbidden; + + public static readonly string Gpus = V8.Gpus; + + public static readonly string Logs = V8.Logs; + + public static readonly string MoneyDonations = V8.MoneyDonations; + + public static readonly string MusicSynths = V8.MusicSynths; + + public static readonly string News = V8.News; + + public static readonly string OwnedComputers = V8.OwnedComputers; + + public static readonly string OwnedConsoles = V8.OwnedConsoles; + + public static readonly string Processors = V8.Processors; + + public static readonly string SoundSynths = V8.SoundSynths; + + public static readonly string ComputersForeignKeys = V8.ComputersForeignKeys; + + public static readonly string ConsolesForeignKeys = V8.ConsolesForeignKeys; + + public static readonly string Iso3166Numeric = V8.Iso3166Numeric; + + public static readonly string Iso3166NumericValues = V8.Iso3166NumericValues; + + public static readonly string CompaniesForeignKeys = V8.CompaniesForeignKeys; + + public static readonly string CompanyLogos = V8.CompanyLogos; + + public static readonly string CompanyDescriptions = + "CREATE TABLE `company_descriptions` (\n" + + "`id` INT NOT NULL AUTO_INCREMENT,\n" + + "`company_id` INT NOT NULL,\n" + + "`text` text,\n" + + "PRIMARY KEY (`id`),\n" + + "INDEX `idx_company_id` (`company_id` ASC),\n" + + "FULLTEXT KEY `idx_text` (`text`),\n" + + "CONSTRAINT `fk_company_id` FOREIGN KEY (`id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE\n" + + ")"; + } +} \ No newline at end of file diff --git a/cicm_web/Models/Company.cs b/cicm_web/Models/Company.cs index 0a2dc204..db9414a7 100644 --- a/cicm_web/Models/Company.cs +++ b/cicm_web/Models/Company.cs @@ -55,6 +55,7 @@ namespace cicm_web.Models public CompanyStatus Status; public string Twitter; public string Website; + public string Description; public static CompanyWithItems GetItem(int id) { @@ -81,7 +82,8 @@ namespace cicm_web.Models Twitter = dbItem.Twitter, Website = dbItem.Website, Logos = dbItem.Logos, - LastLogo = dbItem.LastLogo + LastLogo = dbItem.LastLogo, + Description = dbItem.Description }; } @@ -110,7 +112,8 @@ namespace cicm_web.Models Twitter = t.Twitter, Website = t.Website, Logos = t.Logos, - LastLogo = t.LastLogo + LastLogo = t.LastLogo, + Description = t.Description }).OrderBy(t => t.Name).ToArray(); } @@ -141,7 +144,8 @@ namespace cicm_web.Models Twitter = t.Twitter, Website = t.Website, Logos = t.Logos, - LastLogo = t.LastLogo + LastLogo = t.LastLogo, + Description = t.Description }).OrderBy(t => t.Name).ToArray(); } } diff --git a/cicm_web/Views/Company/View.cshtml b/cicm_web/Views/Company/View.cshtml index 6538f835..dd488a72 100644 --- a/cicm_web/Views/Company/View.cshtml +++ b/cicm_web/Views/Company/View.cshtml @@ -37,347 +37,403 @@ @if(Model != null) { -
-

- @if(Model.LastLogo != null && File.Exists(System.IO.Path.Combine(ViewBag.WebRootPath, "assets/logos", Model.LastLogo.Guid + ".svg"))) - { - - - - - - } -

-
- @{ - string carrouselActive = "active"; - } - @if(Model.Logos != null && Model.Logos.Length > 1) - { -
- -
- } -
- - - - - @if(Model.Founded > DateTime.MinValue) - { - - - - - } - - - - - - - @switch(Model.Status) - { - case CompanyStatus.Unknown: - - break; - case CompanyStatus.Active: - - break; - case CompanyStatus.Sold: - if(Model.Sold != DateTime.MinValue) - { - if(Model.SoldTo != null) - { - - } - else - { - - } - } - else - { - if(Model.SoldTo != null) - { - - } - else - { - - } - } - break; - case CompanyStatus.Merged: - if(Model.Sold != DateTime.MinValue) - { - if(Model.SoldTo != null) - { - - } - else - { - - } - } - else - { - if(Model.SoldTo != null) - { - - } - else - { - - } - } - break; - case CompanyStatus.Bankrupt: - if(Model.Sold != DateTime.MinValue) - { - - } - else - { - - } - break; - case CompanyStatus.Defunct: - if(Model.Sold != DateTime.MinValue) - { - - } - else - { - - } - break; - case CompanyStatus.Renamed: - if(Model.Sold != DateTime.MinValue) - { - if(Model.SoldTo != null) - { - - } - else - { - - } - } - else - { - if(Model.SoldTo != null) - { - - } - else - { - - } - } - break; - default: - throw new ArgumentOutOfRangeException(); - } - - - - - - @if(!string.IsNullOrEmpty(Model.Website) || !string.IsNullOrEmpty(Model.Twitter) || !string.IsNullOrEmpty(Model.Facebook)) + @if(Model.Logos != null && Model.Logos.Length > 1) + { +
+ +
+ } + +
+
- @Model.Name -
Founded@Model.Founded.ToLongDateString().
Country - @if(File.Exists(System.IO.Path.Combine(ViewBag.WebRootPath, "assets/flags/countries", Model.Country.Id + ".svg"))) +
+

+ @if(Model.LastLogo != null && File.Exists(System.IO.Path.Combine(ViewBag.WebRootPath, "assets/logos", Model.LastLogo.Guid + ".svg"))) { + srcset="/assets/logos/@(Model.LastLogo.Guid).svg"> - + + height="auto" + width="auto" + style="max-height: 256px; max-width: 256px" /> } - @Model.Country.Name -

StatusCurrent company status is unknown.Company is active. - Company was sold to - - @Model.SoldTo.Name on @Model.Sold.ToLongDateString(). - Company was sold on @Model.Sold.ToLongDateString() to an unknown company. - Company was sold to - - @Model.SoldTo.Name on an unknown date. - Company was sold to an unknown company on an unknown date. - Company was merged on @Model.Sold.ToLongDateString() to form - - @Model.SoldTo.Name. - Company was merge on @Model.Sold.ToLongDateString() to form an unknown company. - Company was merged on an unknown date to form - - @Model.SoldTo.Name. - Company was merged to form an unknown company on an unknown date.Company declared bankruptcy on @Model.Sold.ToLongDateString().Company declared bankruptcy on an unknown date.Company ceased operations on @Model.Sold.ToLongDateString().Company ceased operations on an unknown date. - Company was renamed to - - @Model.SoldTo.Name on @Model.Sold.ToLongDateString(). - Company was renamed on @Model.Sold.ToLongDateString() to an unknown name. - Company was renamed to - - @Model.SoldTo.Name on an unknown date. - Company was renamed to an unknown name on an unknown date.
Address - @Model.Address
- @if(Model.City != Model.Province) - { - @Model.City
+

+
+ @{ + string carrouselActive = "active"; } - @Model.PostalCode @Model.Province
+ + + + @if(Model.Founded > DateTime.MinValue) + { + + + + + } + + + + + + + @switch(Model.Status) + { + case CompanyStatus.Unknown: + + break; + case CompanyStatus.Active: + + break; + case CompanyStatus.Sold: + if(Model.Sold != DateTime.MinValue) + { + if(Model.SoldTo != null) + { + + } + else + { + + } + } + else + { + if(Model.SoldTo != null) + { + + } + else + { + + } + } + break; + case CompanyStatus.Merged: + if(Model.Sold != DateTime.MinValue) + { + if(Model.SoldTo != null) + { + + } + else + { + + } + } + else + { + if(Model.SoldTo != null) + { + + } + else + { + + } + } + break; + case CompanyStatus.Bankrupt: + if(Model.Sold != DateTime.MinValue) + { + + } + else + { + + } + break; + case CompanyStatus.Defunct: + if(Model.Sold != DateTime.MinValue) + { + + } + else + { + + } + break; + case CompanyStatus.Renamed: + if(Model.Sold != DateTime.MinValue) + { + if(Model.SoldTo != null) + { + + } + else + { + + } + } + else + { + if(Model.SoldTo != null) + { + + } + else + { + + } + } + break; + default: + throw new ArgumentOutOfRangeException(); + } + + + + + + @if(!string.IsNullOrEmpty(Model.Website) || !string.IsNullOrEmpty(Model.Twitter) || !string.IsNullOrEmpty(Model.Facebook)) + { + + + + + } +
+ @Model.Name +
Founded@Model.Founded.ToLongDateString().
Country + @if(File.Exists(System.IO.Path.Combine(ViewBag.WebRootPath, "assets/flags/countries", Model.Country.Id + ".svg"))) + { + + + + + + } + @Model.Country.Name +
StatusCurrent company status is unknown.Company is active. + Company was sold to + + @Model.SoldTo.Name on @Model.Sold.ToLongDateString(). + Company was sold on @Model.Sold.ToLongDateString() to an unknown company. + Company was sold to + + @Model.SoldTo.Name on an unknown date. + Company was sold to an unknown company on an unknown date. + Company was merged on @Model.Sold.ToLongDateString() to form + + @Model.SoldTo.Name. + Company was merge on @Model.Sold.ToLongDateString() to form an unknown company. + Company was merged on an unknown date to form + + @Model.SoldTo.Name. + Company was merged to form an unknown company on an unknown date.Company declared bankruptcy on @Model.Sold.ToLongDateString().Company declared bankruptcy on an unknown date.Company ceased operations on @Model.Sold.ToLongDateString().Company ceased operations on an unknown date. + Company was renamed to + + @Model.SoldTo.Name on @Model.Sold.ToLongDateString(). + Company was renamed on @Model.Sold.ToLongDateString() to an unknown name. + Company was renamed to + + @Model.SoldTo.Name on an unknown date. + Company was renamed to an unknown name on an unknown date.
Address + @Model.Address
+ @if(Model.City != Model.Province) + { + @Model.City
+ } + @Model.PostalCode @Model.Province
Links + @if(!string.IsNullOrEmpty(Model.Website)) + { + Website +
+ } + @if(!string.IsNullOrEmpty(Model.Twitter)) + { + Twitter +
+ } + @if(!string.IsNullOrEmpty(Model.Facebook)) + { + Facebook +
+ } +
+
+
+ +
+
+ @if(Model.Computers.Any()) + { +
+
+ +
+ +
+
+
+ @foreach(ComputerMini computer in Model.Computers) + { + + @computer.Model +
+ } +
+
+ } + else + { +
+
+ +
+
+ } + @if(Model.Consoles.Any()) + { +
+
+ +
+ +
+
+
+ @foreach(ConsoleMini console in Model.Consoles) + { + + @console.Model +
+ } +
+
+ } + else + { +
+
+ +
+
+ } +
+
+ + @if(Model.Description != null) { - - Links - - @if(!string.IsNullOrEmpty(Model.Website)) - { - Website -
- } - @if(!string.IsNullOrEmpty(Model.Twitter)) - { - Twitter -
- } - @if(!string.IsNullOrEmpty(Model.Facebook)) - { - Facebook -
- } - - +
+ @Model.Description +
} - -
- - -
- @if(Model.Computers.Any()) - { -

- @Model.Computers.Count() computers made by this company found in the database.
- @foreach(ComputerMini computer in Model.Computers) - { - - @computer.Model -
- } -

- } - else - { -

There are no computers made by this company in the database.

- } -
- -
- @if(Model.Consoles.Any()) - { -

- @Model.Consoles.Count() videogame consoles made by this company found in the database.
- @foreach(ConsoleMini console in Model.Consoles) - { - - @console.Model -
- } -

- } - else - { -

There are no videogame consoles made by this company found in the database.

- } -
} else diff --git a/cicm_web/cicm_web.csproj b/cicm_web/cicm_web.csproj index 10bf1bcb..1e7ff99f 100644 --- a/cicm_web/cicm_web.csproj +++ b/cicm_web/cicm_web.csproj @@ -2,7 +2,7 @@ netcoreapp2.0 - 3.0.99.149 + 3.0.99.150 Canary Islands Computer Museum Copyright © 2003-2018 Natalia Portillo Canary Islands Computer Museum Website