Add screen editing in admin view.

This commit is contained in:
2020-05-27 03:48:34 +01:00
parent e234b8ffec
commit a3ecfa66b3
11 changed files with 429 additions and 101 deletions

View File

@@ -0,0 +1,31 @@
using System.ComponentModel.DataAnnotations.Schema;
namespace Marechai.ViewModels
{
public class ScreenViewModel : BaseViewModel<int>
{
public double? Width { get; set; }
public double? Height { get; set; }
public double Diagonal { get; set; }
public int NativeResolutionId { get; set; }
public ResolutionViewModel NativeResolution { get; set; }
public long? EffectiveColors { get; set; }
public string Type { get; set; }
[NotMapped]
public long? Colors => EffectiveColors ?? NativeResolution.Colors;
[NotMapped]
public string Size
{
get
{
if(Width != null &&
Height != null)
return$"{Width}x{Height} mm";
return"Unknown";
}
}
}
}