diff --git a/Marechai/Marechai.csproj b/Marechai/Marechai.csproj index 419d7f83..07c28e55 100644 --- a/Marechai/Marechai.csproj +++ b/Marechai/Marechai.csproj @@ -2,7 +2,7 @@ netcoreapp3.1 - 3.0.99.1159 + 3.0.99.1170 Canary Islands Computer Museum Copyright © 2003-2020 Natalia Portillo Canary Islands Computer Museum Website diff --git a/Marechai/Pages/Admin/Details/Company.razor b/Marechai/Pages/Admin/Details/Company.razor index 6cb8df9f..11d6d4c8 100644 --- a/Marechai/Pages/Admin/Details/Company.razor +++ b/Marechai/Pages/Admin/Details/Company.razor @@ -31,6 +31,7 @@ } @page "/admin/companies/details/{Id:int}" +@using Marechai.Database @inherits OwningComponentBase @inject IStringLocalizer L @inject Iso31661NumericService CountriesService @@ -52,7 +53,12 @@ @L["Status"] - + @if(_editable || _model.Founded.HasValue) { @@ -110,25 +116,18 @@ } - @if (_editable) + @if (_editable || _model.CountryId != null) { @L["Country"] - @foreach (var country in _countries) { - @country.Name + @country.Name } } - else if (_model.CountryId != null) - { - - @L["Country"] - - - } @if (_editable || _model.Sold != null) { @@ -136,25 +135,18 @@ } - @if (_editable) + @if (_editable || _model.SoldToId != null) { @L["Sold to"] - @foreach (var company in _companies) { - @company.Name + @company.Name } } - else if (_model.SoldToId != null) - { - - @L["Sold to"] - - - }
@L["Edit"] diff --git a/Marechai/Pages/Admin/Details/Company.razor.cs b/Marechai/Pages/Admin/Details/Company.razor.cs index fe020ead..a2224a41 100644 --- a/Marechai/Pages/Admin/Details/Company.razor.cs +++ b/Marechai/Pages/Admin/Details/Company.razor.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Threading.Tasks; using Marechai.Database; @@ -18,16 +17,10 @@ namespace Marechai.Pages.Admin.Details [Parameter] public int Id { get; set; } - public string CompanyStatus + int Status { - get => _model.Status.ToString(); - set - { - if(!Enum.TryParse(value, true, out CompanyStatus parsed)) - return; - - _model.Status = parsed; - } + get => (int)_model.Status; + set => _model.Status = (CompanyStatus)value; } protected override async Task OnAfterRenderAsync(bool firstRender) diff --git a/codealike.json b/codealike.json index e9d938ec..dacdf072 100644 --- a/codealike.json +++ b/codealike.json @@ -1 +1 @@ -{"projectId":"fd3f3857-80b9-4ed7-90f8-c6ebd0ae449f","projectName":"Marechai","neverTrack":false} \ No newline at end of file +{"projectId":"9fc561fc-2850-4b18-8a34-33bab85e34e1","projectName":"Marechai"} \ No newline at end of file