diff --git a/src/Elektrifikatsiya/Elektrifikatsiya/Models/Device.cs b/src/Elektrifikatsiya/Elektrifikatsiya/Models/Device.cs index b41d572..86c3d8c 100644 --- a/src/Elektrifikatsiya/Elektrifikatsiya/Models/Device.cs +++ b/src/Elektrifikatsiya/Elektrifikatsiya/Models/Device.cs @@ -1,6 +1,8 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Net; +using Microsoft.AspNetCore.Razor.TagHelpers; +using Microsoft.AspNetCore.Server.IIS.Core; namespace Elektrifikatsiya.Models; @@ -35,5 +37,17 @@ public class Device Room = room; } + public static Device CopyDevice(Device device) => new Device(device.MacAddress, device.Name, device.IpAddress, device.User, device.Room); + + public void OverwiteDevice(Device overwriter) + { + this.Room = overwriter.Room; + this.Available = overwriter.Available; + this.PowerUsage = overwriter.PowerUsage; + this.Name = overwriter.Name; + this.User = overwriter.User; + this.MacAddress = overwriter.MacAddress; + this.IpAddress = overwriter.IpAddress; + } private Device(){} } \ No newline at end of file diff --git a/src/Elektrifikatsiya/Elektrifikatsiya/Pages/Dashboard.razor b/src/Elektrifikatsiya/Elektrifikatsiya/Pages/Dashboard.razor index a09d7f5..70a9522 100644 --- a/src/Elektrifikatsiya/Elektrifikatsiya/Pages/Dashboard.razor +++ b/src/Elektrifikatsiya/Elektrifikatsiya/Pages/Dashboard.razor @@ -5,6 +5,7 @@ @using Elektrifikatsiya.Services @using Elektrifikatsiya.Utilities @using System.Diagnostics +@using Elektrifikatsiya.Services.Implementations @inject IVersionProvider VersionProvider @inject IDeviceStatusService DeviceStatusService; diff --git a/src/Elektrifikatsiya/Elektrifikatsiya/Pages/Settings.razor b/src/Elektrifikatsiya/Elektrifikatsiya/Pages/Settings.razor index 46f8278..60e82b6 100644 --- a/src/Elektrifikatsiya/Elektrifikatsiya/Pages/Settings.razor +++ b/src/Elektrifikatsiya/Elektrifikatsiya/Pages/Settings.razor @@ -2,6 +2,13 @@ @using Blazorise.Components; @using Elektrifikatsiya.Models; @using System.Net +@using System.Text.Json +@using Elektrifikatsiya.Services.Implementations +@using Elektrifikatsiya.Services; +@using FluentResults + +@inject IDeviceManagmentService DeviceManagmentService +