2018-04-15 01:38:49 +01:00
|
|
|
@{
|
|
|
|
|
/******************************************************************************
|
|
|
|
|
// Canary Islands Computer Museum Website
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// Filename : ByLetter.cshtml
|
|
|
|
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
|
|
|
|
//
|
|
|
|
|
// --[ 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 <http://www.gnu.org/licenses/>.
|
|
|
|
|
//
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
// Copyright © 2003-2018 Natalia Portillo
|
|
|
|
|
*******************************************************************************/
|
|
|
|
|
|
|
|
|
|
ViewData["Title"] = "Companies";
|
|
|
|
|
}
|
|
|
|
|
@using System.IO
|
2018-04-15 17:51:07 +01:00
|
|
|
@model CompanyWithItems
|
2018-04-15 01:38:49 +01:00
|
|
|
|
|
|
|
|
<p>Search results:</p>
|
|
|
|
|
<p align=center>
|
2018-04-15 17:51:07 +01:00
|
|
|
@if(Model != null)
|
2018-04-15 01:38:49 +01:00
|
|
|
{
|
2018-04-15 17:51:07 +01:00
|
|
|
if(File.Exists(System.IO.Path.Combine(ViewBag.WebRootPath, "assets/logos", Model.Id + ".gif")))
|
2018-04-15 01:38:49 +01:00
|
|
|
{
|
2018-04-15 17:51:07 +01:00
|
|
|
<img src="@(System.IO.Path.Combine("/assets/logos", Model.Id + ".gif"))"
|
2018-04-15 01:38:49 +01:00
|
|
|
alt="">
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-15 17:51:07 +01:00
|
|
|
if(File.Exists(System.IO.Path.Combine(ViewBag.WebRootPath, "assets/logos", Model.Id + ".jpg")))
|
2018-04-15 01:38:49 +01:00
|
|
|
{
|
2018-04-15 17:51:07 +01:00
|
|
|
<img src="@(System.IO.Path.Combine("/assets/logos", Model.Id + ".jpg"))"
|
2018-04-15 01:38:49 +01:00
|
|
|
alt="">
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-15 17:51:07 +01:00
|
|
|
if(File.Exists(System.IO.Path.Combine(ViewBag.WebRootPath, "assets/logos", Model.Id + ".png")))
|
2018-04-15 01:38:49 +01:00
|
|
|
{
|
2018-04-15 17:51:07 +01:00
|
|
|
<img src="@(System.IO.Path.Combine("/assets/logos", Model.Id + ".png"))"
|
2018-04-15 01:38:49 +01:00
|
|
|
alt="">
|
|
|
|
|
}
|
2018-04-15 17:51:07 +01:00
|
|
|
<b>@Model.Name</b>
|
2018-04-15 01:38:49 +01:00
|
|
|
<br />
|
|
|
|
|
|
2018-04-15 17:51:07 +01:00
|
|
|
if(Model.Computers.Any())
|
|
|
|
|
{
|
|
|
|
|
<p>
|
|
|
|
|
@Model.Computers.Count() computers found in the database.<br />
|
|
|
|
|
@foreach(ComputerMini computer in Model.Computers)
|
|
|
|
|
{
|
|
|
|
|
<a asp-controller="Computer"
|
|
|
|
|
asp-action="View"
|
|
|
|
|
asp-route-id="@computer.Id">
|
|
|
|
|
@computer.Model</a>
|
|
|
|
|
<br />
|
|
|
|
|
}
|
|
|
|
|
</p>
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
<p>There are no computers found in the database that belong to that company.</p>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(Model.Consoles.Any())
|
|
|
|
|
{
|
|
|
|
|
<p>
|
|
|
|
|
@Model.Consoles.Count() videoconsoles found in the database.<br />
|
|
|
|
|
@foreach(ConsoleMini console in Model.Consoles)
|
|
|
|
|
{
|
|
|
|
|
<a asp-controller="Console"
|
|
|
|
|
asp-action="View"
|
|
|
|
|
asp-route-id="@console.Id">
|
|
|
|
|
@console.Model</a>
|
|
|
|
|
<br />
|
|
|
|
|
}
|
|
|
|
|
</p>
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
<p>There are no videoconsoles found in the database that belong to that company.</p>
|
|
|
|
|
}
|
2018-04-15 01:38:49 +01:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2018-04-15 17:51:07 +01:00
|
|
|
<p>Company not found!</p>
|
2018-04-15 01:38:49 +01:00
|
|
|
}
|
|
|
|
|
</p>
|