Guarantor: DataModels + Binding/Search/View models.

Contractor: DataModels.
This commit is contained in:
Yuee Shiness 2023-04-05 19:26:00 +04:00
parent 81eba38ae9
commit bc4efdc01a
9 changed files with 134 additions and 4 deletions

View File

@ -8,9 +8,7 @@
<ItemGroup>
<Folder Include="BusinessLogicContracts\" />
<Folder Include="ViewModels\" />
<Folder Include="StorageContracts\" />
<Folder Include="SearchModels\" />
</ItemGroup>
<ItemGroup>

View 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; }
}
}

View 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; }
}
}

View 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; }
}
}

View 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; }
}
}

View 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();
}
}

View 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();
}
}

View 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
}
}

View File

@ -1,5 +1,7 @@
using System;
using ComputerStoreDataModels.Enums;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@ -12,6 +14,7 @@ namespace ComputerStoreDataModels.Models
string Password { get; }
string FirstName { get; }
string LastName { get; }
string MiddleName { get; }
string MiddleName { get; }
EmployeeRole Role { get; }
}
}