diff --git a/Data/Database.cs b/Data/Database.cs index cf287af..3ce842e 100644 --- a/Data/Database.cs +++ b/Data/Database.cs @@ -36,7 +36,7 @@ public async Task CreateTablesAsync() await _database.CreateTableAsync(); await _database.CreateTableAsync(); await _database.CreateTableAsync(); - await _database.CreateTableAsync(); + await _database.CreateTableAsync(); await _database.CreateTableAsync(); await _database.CreateTableAsync(); await _database.CreateTableAsync(); diff --git a/MauiProgram.cs b/MauiProgram.cs index d7d9f2b..9c1247c 100644 --- a/MauiProgram.cs +++ b/MauiProgram.cs @@ -1,8 +1,6 @@ using UndacApp.Data; using UndacApp.Services; using Microsoft.Extensions.Logging; -using UndacApp.Services.Accommodation; - namespace UndacApp; public static class MauiProgram @@ -34,11 +32,9 @@ public static MauiApp CreateMauiApp() builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); - builder.Services.AddSingleton(); - builder.Services.AddSingleton(); - + builder.Services.AddSingleton(); #if DEBUG builder.Logging.AddDebug(); diff --git a/Models/AnEquipment.cs b/Models/AnEquipment.cs new file mode 100644 index 0000000..6663ab9 --- /dev/null +++ b/Models/AnEquipment.cs @@ -0,0 +1,38 @@ +namespace UndacApp.Models +{ + /*! + A model structure for Equipment data + +
Data is stored in SQLite database.
*/ + public class AnEquipment : AModel + { + private string? _type = String.Empty; + public string? Type + { + get => _type; + set => SetField(ref _type, value); + } + + private string? _location = String.Empty; + public string? Location + { + get => _location; + set => SetField(ref _location, value); + } + + private string? _currentOperation = String.Empty; + public string? CurrentOperation + { + get => _currentOperation; + set => SetField(ref _currentOperation, value); + } + + private int _quantity = 0; + public int Quantity + { + get => _quantity; + set => SetField(ref _quantity, value); + } + + } +} \ No newline at end of file diff --git a/Models/Equipment.cs b/Models/Equipment.cs deleted file mode 100644 index 2f3ca38..0000000 --- a/Models/Equipment.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace UndacApp.Models -{ - /*! - A model structure for Equipment data - -
Data is stored in SQLite database.
*/ - public class Equipment : AModel - { - - /*! - A private variable, storing Equipment name - */ - private string _name; - public string Name - { - get => _name; - set => SetField(ref _name, value); - } - } -} \ No newline at end of file diff --git a/Services/Accommodation/BuildingTypeService.cs b/Services/Accommodation/BuildingTypeService.cs index 321aac6..ffdff63 100644 --- a/Services/Accommodation/BuildingTypeService.cs +++ b/Services/Accommodation/BuildingTypeService.cs @@ -1,6 +1,6 @@ using UndacApp.Models; -namespace UndacApp.Services.Accommodation +namespace UndacApp.Services { public class BuildingTypeService : AService, IBuildingTypeService { diff --git a/Services/Accommodation/IBuildingTypeService.cs b/Services/Accommodation/IBuildingTypeService.cs index 6e0d3f6..1c6a866 100644 --- a/Services/Accommodation/IBuildingTypeService.cs +++ b/Services/Accommodation/IBuildingTypeService.cs @@ -1,6 +1,6 @@ using UndacApp.Models; -namespace UndacApp.Services.Accommodation +namespace UndacApp.Services { /// /// A service for handling building types. diff --git a/Services/Accommodation/IRoomTypeService.cs b/Services/Accommodation/IRoomTypeService.cs index b0a49bf..a4cf627 100644 --- a/Services/Accommodation/IRoomTypeService.cs +++ b/Services/Accommodation/IRoomTypeService.cs @@ -1,6 +1,6 @@ using UndacApp.Models; -namespace UndacApp.Services.Accommodation +namespace UndacApp.Services { /// /// Interface used for managing rooms diff --git a/Services/Accommodation/RoomTypeService.cs b/Services/Accommodation/RoomTypeService.cs index 6d330f7..8794eb1 100644 --- a/Services/Accommodation/RoomTypeService.cs +++ b/Services/Accommodation/RoomTypeService.cs @@ -1,6 +1,6 @@ using UndacApp.Models; -namespace UndacApp.Services.Accommodation +namespace UndacApp.Services { /// /// service class for managing room types in a SQLite database diff --git a/Services/EquipmentService.cs b/Services/EquipmentService.cs index 20968b8..e78306e 100644 --- a/Services/EquipmentService.cs +++ b/Services/EquipmentService.cs @@ -5,7 +5,7 @@ namespace UndacApp.Services /*! EquipmentService extending IEQuipmentService Interface */ - public class EquipmentService : AService, IEquipmentService + public class EquipmentService : AService, IEquipmentService { } diff --git a/Services/IEquipmentService.cs b/Services/IEquipmentService.cs index 036da07..39e01e9 100644 --- a/Services/IEquipmentService.cs +++ b/Services/IEquipmentService.cs @@ -5,7 +5,7 @@ namespace UndacApp.Services /*! Interface that exposes methods of EquipmentService */ - public interface IEquipmentService : IService + public interface IEquipmentService : IService { } diff --git a/UndacApp.csproj b/UndacApp.csproj index 45d8fd8..ad76a81 100644 --- a/UndacApp.csproj +++ b/UndacApp.csproj @@ -65,6 +65,9 @@ MSBuild:Compile + + MSBuild:Compile + MSBuild:Compile @@ -141,6 +144,9 @@ + + EquipmentPage.xaml + LogisticOperationPage.xaml @@ -189,8 +195,8 @@ RotaPage.xaml - - EquipmentPage.xaml + + EquipmentPage_Old.xaml %(Filename) diff --git a/Views/AddResourcePage.xaml.cs b/Views/AddResourcePage.xaml.cs index 7124672..f6f5a0e 100644 --- a/Views/AddResourcePage.xaml.cs +++ b/Views/AddResourcePage.xaml.cs @@ -1,7 +1,6 @@ using System.Collections.ObjectModel; using UndacApp.Models; using UndacApp.Services; -using UndacApp.Services.Accommodation; namespace UndacApp.Views; public partial class AddResourcePage : ContentPage diff --git a/Views/BuildingTypePage.xaml.cs b/Views/BuildingTypePage.xaml.cs index 4737f52..0a2aa58 100644 --- a/Views/BuildingTypePage.xaml.cs +++ b/Views/BuildingTypePage.xaml.cs @@ -1,7 +1,7 @@ using UndacApp.Models; using System.Collections.ObjectModel; -using UndacApp.Services.Accommodation; +using UndacApp.Services; namespace UndacApp.Views; diff --git a/Views/EquipmentPage.xaml b/Views/EquipmentPage.xaml index e73ce38..bcfc092 100644 --- a/Views/EquipmentPage.xaml +++ b/Views/EquipmentPage.xaml @@ -1,29 +1,86 @@ - - + Title="AddEquipments"> - -