@{ /****************************************************************************** // 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 @using Cicm.Database.Models @model Cicm.Database.Models.Company @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.Count > 1) {
}
@if(Model.Founded.HasValue) { } @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.Value.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.Value.ToLongDateString(). Company was sold on @Model.Sold.Value.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.Value.ToLongDateString() to form @Model.SoldTo.Name. Company was merge on @Model.Sold.Value.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.Value.ToLongDateString().Company declared bankruptcy on an unknown date.Company ceased operations on @Model.Sold.Value.ToLongDateString().Company ceased operations on an unknown date. Company was renamed to @Model.SoldTo.Name on @Model.Sold.Value.ToLongDateString(). Company was renamed on @Model.Sold.Value.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.Machines.Any(t => t.Type == MachineType.Computer)) {
@foreach(Machine computer in Model.Machines.Where(t => t.Type == MachineType.Computer)) { @computer.Name
}
} else {
} @if(Model.Machines.Any(t => t.Type == MachineType.Console)) {
@foreach(Machine console in Model.Machines.Where(t => t.Type == MachineType.Console)) { @console.Name
}
} else {
}
@* TODO: This is not working with EF, check why *@ @if(Model.Description != null) {
@Html.Raw(Model.Description)
}
} else {

Company not found!

}