@{ /****************************************************************************** // Canary Islands Computer Museum Website // ---------------------------------------------------------------------------- // // Filename : ByLetter.cshtml // Author(s) : Natalia Portillo // // --[ Description ] ---------------------------------------------------------- // // Lists computers by 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 *******************************************************************************/ ViewData["Title"] = "Companies"; } @using System.IO @using Cicm.Database.Schemas @model CompanyWithItems @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)) { }
@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()) {

@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 {

Company not found!

}