Created project with contracts for construction company + naming fix in models projects

This commit is contained in:
abazov73 2023-03-26 19:14:28 +04:00
parent 8761d86e50
commit 73bed7238e
26 changed files with 422 additions and 7 deletions

View File

@ -3,9 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32825.248
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConstructionCompanyView", "ConstructionCompanyView\ConstructionCompanyView.csproj", "{E6C11D11-F20B-4A39-8FDA-82C75463ACBE}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConstructionCompanyView", "ConstructionCompanyView\ConstructionCompanyView.csproj", "{E6C11D11-F20B-4A39-8FDA-82C75463ACBE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConstructionCompanyDataModels", "ConstructionCompanyDataModels\ConstructionCompanyDataModels.csproj", "{78CB5CC6-B587-41DD-B595-13138E6351C8}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConstructionCompanyDataModels", "ConstructionCompanyDataModels\ConstructionCompanyDataModels.csproj", "{78CB5CC6-B587-41DD-B595-13138E6351C8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConstructionCompanyContracts", "ConstructionCompanyContracts\ConstructionCompanyContracts.csproj", "{CFB66158-7025-4605-9739-C4A2F07D2EB6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -21,6 +23,10 @@ Global
{78CB5CC6-B587-41DD-B595-13138E6351C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{78CB5CC6-B587-41DD-B595-13138E6351C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{78CB5CC6-B587-41DD-B595-13138E6351C8}.Release|Any CPU.Build.0 = Release|Any CPU
{CFB66158-7025-4605-9739-C4A2F07D2EB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CFB66158-7025-4605-9739-C4A2F07D2EB6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CFB66158-7025-4605-9739-C4A2F07D2EB6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CFB66158-7025-4605-9739-C4A2F07D2EB6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -0,0 +1,18 @@
using ConstructionCompanyDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConstructionCompanyContracts.BindingModels
{
public class EmployeeBindingModel : IEmployeeModel
{
public string EmployeeName { get; set; } = string.Empty;
public int PositionID { get; set; }
public int Id {get; set; }
}
}

View File

@ -0,0 +1,18 @@
using ConstructionCompanyDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConstructionCompanyContracts.BindingModels
{
public class MaterialBindingModel : IMaterialModel
{
public string MaterialName { get; set; } = string.Empty;
public int Quantity { get; set; }
public int Id { get; set; }
}
}

View File

@ -0,0 +1,29 @@
using ConstructionCompanyDataModels.Enums;
using ConstructionCompanyDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConstructionCompanyContracts.BindingModels
{
public class OrderBindingModel : IOrderModel
{
public string Description { get; set; } = string.Empty;
public string Adress { get; set; } = string.Empty;
public double Price => throw new NotImplementedException();
public OrderStatus Status => throw new NotImplementedException();
public string CustomerNumber { get; set; } = string.Empty;
public DateTime DateBegin { get; set; } = DateTime.Now.Date;
public DateTime? DateEnd { get; set; }
public int Id { get; set; }
}
}

View File

@ -0,0 +1,18 @@
using ConstructionCompanyDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConstructionCompanyContracts.BindingModels
{
public class PositionBindingModel : IPositionModel
{
public string PositionName { get; set; } = string.Empty;
public double Salary { get; set; }
public int Id { get; set; }
}
}

View File

@ -0,0 +1,20 @@
using ConstructionCompanyContracts.BindingModels;
using ConstructionCompanyContracts.SearchModels;
using ConstructionCompanyContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConstructionCompanyContracts.BusinessLogicContracts
{
public interface IEmployeeModel
{
List<EmployeeViewModel>? ReadList(EmployeeSearchModel? model);
EmployeeViewModel? ReadElement(EmployeeSearchModel model);
bool Create(EmployeeBindingModel model);
bool Update(EmployeeBindingModel model);
bool Delete(EmployeeBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using ConstructionCompanyContracts.BindingModels;
using ConstructionCompanyContracts.SearchModels;
using ConstructionCompanyContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConstructionCompanyContracts.BusinessLogicContracts
{
public interface IMaterialLogic
{
List<MaterialViewModel>? ReadList(MaterialSearchModel? model);
MaterialViewModel? ReadElement(MaterialSearchModel model);
bool Create(MaterialBindingModel model);
bool Update(MaterialBindingModel model);
bool Delete(MaterialBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using ConstructionCompanyContracts.BindingModels;
using ConstructionCompanyContracts.SearchModels;
using ConstructionCompanyContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConstructionCompanyContracts.BusinessLogicContracts
{
public interface IOrderLogic
{
List<OrderViewModel>? ReadList(OrderSearchModel? model);
OrderViewModel? ReadElement(OrderSearchModel model);
bool CreateOrder(OrderBindingModel model);
bool TakeOrderInWork(OrderBindingModel model);
bool FinishOrder(OrderBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using ConstructionCompanyContracts.BindingModels;
using ConstructionCompanyContracts.SearchModels;
using ConstructionCompanyContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConstructionCompanyContracts.BusinessLogicContracts
{
public interface IPositionLogic
{
List<PositionViewModel>? ReadList(PositionSearchModel? model);
PositionViewModel? ReadElement(PositionSearchModel model);
bool Create(PositionBindingModel model);
bool Update(PositionBindingModel model);
bool Delete(PositionBindingModel model);
}
}

View File

@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\ConstructionCompanyDataModels\ConstructionCompanyDataModels.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConstructionCompanyContracts.SearchModels
{
public class EmployeeSearchModel
{
public int? Id { get; set; }
public string? EmployeeName { 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 ConstructionCompanyContracts.SearchModels
{
public class MaterialSearchModel
{
public int? Id { get; set; }
public string? MaterialName { get; set; }
}
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConstructionCompanyContracts.SearchModels
{
public class OrderSearchModel
{
public int? Id { 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 ConstructionCompanyContracts.SearchModels
{
public class PositionSearchModel
{
public int? Id { get; set; }
public string? PositionName { get; set; }
}
}

View File

@ -0,0 +1,21 @@
using ConstructionCompanyContracts.BindingModels;
using ConstructionCompanyContracts.SearchModels;
using ConstructionCompanyContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConstructionCompanyContracts.StorageContracts
{
public interface IEmployeeStorage
{
List<EmployeeViewModel> GetFullList();
List<EmployeeViewModel> GetFilteredList(EmployeeSearchModel model);
EmployeeViewModel? GetElement(EmployeeSearchModel model);
EmployeeViewModel? Insert(EmployeeBindingModel model);
EmployeeViewModel? Update(EmployeeBindingModel model);
EmployeeViewModel? Delete(EmployeeBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using ConstructionCompanyContracts.BindingModels;
using ConstructionCompanyContracts.SearchModels;
using ConstructionCompanyContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConstructionCompanyContracts.StorageContracts
{
public interface IMaterialStorage
{
List<MaterialViewModel> GetFullList();
List<MaterialViewModel> GetFilteredList(MaterialSearchModel model);
MaterialViewModel? GetElement(MaterialSearchModel model);
MaterialViewModel? Insert(MaterialBindingModel model);
MaterialViewModel? Update(MaterialBindingModel model);
MaterialViewModel? Delete(MaterialBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using ConstructionCompanyContracts.BindingModels;
using ConstructionCompanyContracts.SearchModels;
using ConstructionCompanyContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConstructionCompanyContracts.StorageContracts
{
public interface IOrderStorage
{
List<OrderViewModel> GetFullList();
List<OrderViewModel> GetFilteredList(OrderSearchModel model);
OrderViewModel? GetElement(OrderSearchModel model);
OrderViewModel? Insert(OrderBindingModel model);
OrderViewModel? Update(OrderBindingModel model);
OrderViewModel? Delete(OrderBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using ConstructionCompanyContracts.BindingModels;
using ConstructionCompanyContracts.SearchModels;
using ConstructionCompanyContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConstructionCompanyContracts.StorageContracts
{
public interface IPositionStorage
{
List<PositionViewModel> GetFullList();
List<PositionViewModel> GetFilteredList(PositionSearchModel model);
PositionViewModel? GetElement(PositionSearchModel model);
PositionViewModel? Insert(PositionBindingModel model);
PositionViewModel? Update(PositionBindingModel model);
PositionViewModel? Delete(PositionBindingModel model);
}
}

View File

@ -0,0 +1,22 @@
using ConstructionCompanyDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConstructionCompanyContracts.ViewModels
{
public class EmployeeViewModel : IEmployeeModel
{
[DisplayName("ФИО")]
public string EmployeeName {get; set;} = string.Empty;
public int PositionID {get; set;}
[DisplayName("Должность")]
public string PositionName { get; set;} = string.Empty;
public int Id { get; set;}
}
}

View File

@ -0,0 +1,19 @@
using ConstructionCompanyDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConstructionCompanyContracts.ViewModels
{
public class MaterialViewModel : IMaterialModel
{
[DisplayName("Название материала")]
public string MaterialName { get; set; } = string.Empty;
[DisplayName("Количество")]
public int Quantity {get; set; }
public int Id { get; set; }
}
}

View File

@ -0,0 +1,34 @@
using ConstructionCompanyDataModels.Enums;
using ConstructionCompanyDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConstructionCompanyContracts.ViewModels
{
public class OrderViewModel : IOrderModel
{
[DisplayName("Описание")]
public string Description {get;set;} = string.Empty;
[DisplayName("Адрес")]
public string Adress {get;set;} = string.Empty;
[DisplayName("Стоимость")]
public double Price { get; set; }
[DisplayName("Статус")]
public OrderStatus Status { get; set; } = OrderStatus.Неизвестен;
[DisplayName("Телефон заказчика")]
public string CustomerNumber { get; set; } = string.Empty;
[DisplayName("Дата создания")]
public DateTime DateBegin { get; set; } = DateTime.Now.Date;
[DisplayName("Дата выполнения")]
public DateTime? DateEnd { get; set; }
[DisplayName("Номер")]
public int Id { get; set; }
public Dictionary<int, IEmployeeModel> OrderEmployees { get; set; } = new();
public Dictionary<int, (IMaterialModel, int)> OrderMaterials { get; set; } = new();
}
}

View File

@ -0,0 +1,19 @@
using ConstructionCompanyDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConstructionCompanyContracts.ViewModels
{
public class PositionViewModel : IPositionModel
{
[DisplayName("Название должности")]
public string PositionName { get; set; } = string.Empty;
[DisplayName("Зарплата")]
public double Salary { get; set; }
public int Id { get; set; }
}
}

View File

@ -8,7 +8,7 @@ namespace ConstructionCompanyDataModels.Models
{
public interface IEmployeeModel : IId
{
string Name { get; }
string EmployeeName { get; }
int PositionID { get; }
}
}

View File

@ -8,7 +8,7 @@ namespace ConstructionCompanyDataModels.Models
{
public interface IMaterialModel : IId
{
string Name { get; }
string MaterialName { get; }
int Quantity { get; }
}
}

View File

@ -14,7 +14,7 @@ namespace ConstructionCompanyDataModels.Models
double Price { get; }
OrderStatus Status { get; }
string CustomerNumber { get; }
DateOnly DateBegin { get; }
DateOnly? DateEnd { get; }
DateTime DateBegin { get; }
DateTime? DateEnd { get; }
}
}

View File

@ -8,7 +8,7 @@ namespace ConstructionCompanyDataModels.Models
{
public interface IPositionModel : IId
{
string Name { get; }
string PositionName { get; }
double Salary { get; }
}
}