Guarantor: DataModels + Binding/Search/View models.
Contractor: DataModels.
This commit is contained in:
parent
81eba38ae9
commit
bc4efdc01a
@ -8,9 +8,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="BusinessLogicContracts\" />
|
<Folder Include="BusinessLogicContracts\" />
|
||||||
<Folder Include="ViewModels\" />
|
|
||||||
<Folder Include="StorageContracts\" />
|
<Folder Include="StorageContracts\" />
|
||||||
<Folder Include="SearchModels\" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
14
ComputerStoreContracts/SearchModels/ComponentSearchModel.cs
Normal file
14
ComputerStoreContracts/SearchModels/ComponentSearchModel.cs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ComputerStoreContracts.SearchModels
|
||||||
|
{
|
||||||
|
public class ComponentSearchModel
|
||||||
|
{
|
||||||
|
public int? ID { get; set; }
|
||||||
|
public string? Name { get; set; }
|
||||||
|
}
|
||||||
|
}
|
14
ComputerStoreContracts/SearchModels/PCSearchModel.cs
Normal file
14
ComputerStoreContracts/SearchModels/PCSearchModel.cs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ComputerStoreContracts.SearchModels
|
||||||
|
{
|
||||||
|
public class PCSearchModel
|
||||||
|
{
|
||||||
|
public int? ID { get; set; }
|
||||||
|
public string? Name { get; set; }
|
||||||
|
}
|
||||||
|
}
|
14
ComputerStoreContracts/SearchModels/ProductSearchModel.cs
Normal file
14
ComputerStoreContracts/SearchModels/ProductSearchModel.cs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ComputerStoreContracts.SearchModels
|
||||||
|
{
|
||||||
|
public class ProductSearchModel
|
||||||
|
{
|
||||||
|
public int? ID { get; set; }
|
||||||
|
public string? Name { get; set; }
|
||||||
|
}
|
||||||
|
}
|
23
ComputerStoreContracts/ViewModels/ComponentViewModel.cs
Normal file
23
ComputerStoreContracts/ViewModels/ComponentViewModel.cs
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
using ComputerStoreDataModels.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ComputerStoreContracts.ViewModels
|
||||||
|
{
|
||||||
|
public class ComponentViewModel : IComponentModel
|
||||||
|
{
|
||||||
|
public int ID {get; set;}
|
||||||
|
|
||||||
|
[DisplayName("Component's name")]
|
||||||
|
public string Name { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[DisplayName("Component's price")]
|
||||||
|
public double Price { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
25
ComputerStoreContracts/ViewModels/PCViewModel.cs
Normal file
25
ComputerStoreContracts/ViewModels/PCViewModel.cs
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
using ComputerStoreDataModels.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ComputerStoreContracts.ViewModels
|
||||||
|
{
|
||||||
|
public class PCViewModel : IPCModel
|
||||||
|
{
|
||||||
|
public int ID { get; set; }
|
||||||
|
|
||||||
|
[DisplayName("PC's name")]
|
||||||
|
public string Name { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[DisplayName("PC's price")]
|
||||||
|
public double Price { get; set; }
|
||||||
|
|
||||||
|
public Dictionary<int, (IComponentModel, int)> PCComponents { get; set; } = new();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
25
ComputerStoreContracts/ViewModels/ProductViewModel.cs
Normal file
25
ComputerStoreContracts/ViewModels/ProductViewModel.cs
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
using ComputerStoreDataModels.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ComputerStoreContracts.ViewModels
|
||||||
|
{
|
||||||
|
public class ProductViewModel : IProductModel
|
||||||
|
{
|
||||||
|
public int ID {get; set;}
|
||||||
|
|
||||||
|
[DisplayName("Product's name")]
|
||||||
|
public string Name { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[DisplayName("Product's price")]
|
||||||
|
public double Price { get; set; }
|
||||||
|
|
||||||
|
public Dictionary<int, (IComponentModel, int)> ProductComponents { get; set; } = new();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
14
ComputerStoreDataModels/Enums/EmployeeRole.cs
Normal file
14
ComputerStoreDataModels/Enums/EmployeeRole.cs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ComputerStoreDataModels.Enums
|
||||||
|
{
|
||||||
|
public enum EmployeeRole
|
||||||
|
{
|
||||||
|
Guarantor = 0,
|
||||||
|
Cotnractor = 1
|
||||||
|
}
|
||||||
|
}
|
@ -1,5 +1,7 @@
|
|||||||
using System;
|
using ComputerStoreDataModels.Enums;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@ -12,6 +14,7 @@ namespace ComputerStoreDataModels.Models
|
|||||||
string Password { get; }
|
string Password { get; }
|
||||||
string FirstName { get; }
|
string FirstName { get; }
|
||||||
string LastName { get; }
|
string LastName { get; }
|
||||||
string MiddleName { get; }
|
string MiddleName { get; }
|
||||||
|
EmployeeRole Role { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user