Продолжение(Легендарное)
This commit is contained in:
parent
6d1f93451c
commit
6ee89f6397
8
12345678
Normal file
8
12345678
Normal file
@ -0,0 +1,8 @@
|
||||
-----BEGIN OPENSSH PRIVATE KEY-----
|
||||
b3BlbnNzaC1rZXktdjEAAAAACmFlczI1Ni1jdHIAAAAGYmNyeXB0AAAAGAAAABBdnP+MV4
|
||||
VwS1yecrAOXrzjAAAAEAAAAAEAAAAzAAAAC3NzaC1lZDI1NTE5AAAAIKR8odg9m0A3Wn1f
|
||||
AsD8bFrBr2c7U4gzr34WAPTOClvKAAAAoETF2SR1FCOl3OGFsy+vuQwfqp8qySZsswBKSu
|
||||
6YTNm65JWix/m2P3bO1mMSiiu6t0olwNQnXz7inHHf7YoIsOskkqMdD9/0wDgmrG/D9Wl1
|
||||
SEEsIZBNy5u0C4ufdifb6/4zTAMOGcIt8+w1G2jbPvnJ2ez/70aGOANYl6rzsQZS0IdS4X
|
||||
SADuP5bdG1Q2zaOj5+3bOivM0co10Vkx9hJG4=
|
||||
-----END OPENSSH PRIVATE KEY-----
|
1
12345678.pub
Normal file
1
12345678.pub
Normal file
@ -0,0 +1 @@
|
||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKR8odg9m0A3Wn1fAsD8bFrBr2c7U4gzr34WAPTOClvK rgismatullinm@yandex.ru
|
@ -14,9 +14,9 @@ namespace ServiceSourceBusinessLogic.BusinessLogic {
|
||||
public class ReportLogic : IReportLogic {
|
||||
|
||||
private readonly ILogger _logger;
|
||||
private readonly IReportStorage _storage;
|
||||
private readonly ITaskStorage _storage;
|
||||
|
||||
public ReportLogic(ILogger logger, IReportStorage storage) {
|
||||
public ReportLogic(ILogger logger, ITaskStorage storage) {
|
||||
_logger = logger;
|
||||
_storage = storage;
|
||||
}
|
||||
@ -49,7 +49,7 @@ namespace ServiceSourceBusinessLogic.BusinessLogic {
|
||||
return true;
|
||||
}
|
||||
|
||||
public List<ReportViewModel>? ReadList(ReportSearchModel model) {
|
||||
public List<TaskViewModel>? ReadList(TaskSearchModel model) {
|
||||
_logger.LogInformation($"ReadList. Id:{model?.Id}");
|
||||
var list = model == null ? _storage.GetFullList() : _storage.GetFilteredList(model);
|
||||
if (list == null) {
|
||||
|
@ -10,7 +10,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceSourceBusinessLogic.BusinessLogic {
|
||||
public class ReportWork : IReportWorkLogic {
|
||||
public class ReportWork : ITaskLogic {
|
||||
|
||||
private readonly IWorkStorage _storage;
|
||||
|
||||
@ -18,7 +18,7 @@ namespace ServiceSourceBusinessLogic.BusinessLogic {
|
||||
_storage = storage;
|
||||
}
|
||||
|
||||
public List<ReportWorkViewModel> GetWorks(ReportWorkBindingModel model) {
|
||||
public List<ReportWorkViewModel> GetWorks(TaskBindingModel model) {
|
||||
return _storage.GetFilteredList(new WorkSearchModel {
|
||||
Date = model.Date
|
||||
}).Select(x => new ReportWorkViewModel {
|
||||
|
@ -3,7 +3,7 @@ using ServiceStationContracts.BindingModels;
|
||||
using ServiceStationContracts.BusinessLogicContracts;
|
||||
using ServiceStationContracts.SearchModels;
|
||||
using ServiceStationContracts.ViewModels;
|
||||
using ServiceStationDataModels;
|
||||
using ServiceStationDataModels.Enums;
|
||||
using ServiceStationsContracts.StorageContracts;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -11,8 +11,9 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceSourceBusinessLogic.BusinessLogic {
|
||||
public class WorkLogic : IWorkLogic {
|
||||
namespace ServiceSourceBusinessLogic.BusinessLogic
|
||||
{
|
||||
public class WorkLogic : IWorkLogic {
|
||||
|
||||
private readonly ILogger _logger;
|
||||
private readonly IWorkStorage _storage;
|
||||
|
@ -1,14 +0,0 @@
|
||||
|
||||
using ServiceStationDataModels;
|
||||
|
||||
namespace ServiceStationContracts.BindingModels
|
||||
{
|
||||
public class CategoryWorkBindingModel : ICategoryWorkModel
|
||||
{
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
public int ExecutorId { get; set; }
|
||||
|
||||
public int ID { get; set; }
|
||||
}
|
||||
}
|
@ -1,25 +1,16 @@
|
||||
|
||||
|
||||
using ServiceStationDataModels;
|
||||
using ServiceStationDataModels.Models;
|
||||
|
||||
namespace ServiceStationContracts.BindingModels
|
||||
{
|
||||
public class ClientBindingModel : IClientModel
|
||||
{
|
||||
public string FirstName { get; set; } = string.Empty;
|
||||
|
||||
public string LastName { get; set; } = string.Empty;
|
||||
|
||||
public string Email { get; set; } = string.Empty;
|
||||
public string FIO { get; set; } = string.Empty;
|
||||
|
||||
public string Password { get; set; } = string.Empty;
|
||||
|
||||
public string PhoneNumber { get; set; } = string.Empty;
|
||||
public int Points { get; set; }
|
||||
|
||||
public string Login { get; set; } = string.Empty;
|
||||
|
||||
public int Point { get; set; }
|
||||
|
||||
public int ID { get; set; }
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
using ServiceStationDataModels;
|
||||
using ServiceStationDataModels.Models;
|
||||
|
||||
namespace ServiceStationContracts.BindingModels
|
||||
{
|
||||
|
@ -1,23 +1,13 @@
|
||||
|
||||
|
||||
using ServiceStationDataModels;
|
||||
using ServiceStationDataModels.Models;
|
||||
|
||||
namespace ServiceStationContracts.BindingModels
|
||||
{
|
||||
public class ExecutorBindingModel : IExecutorModel
|
||||
{
|
||||
public string FirstName { get; set; } = string.Empty;
|
||||
|
||||
public string LastName { get; set; } = string.Empty;
|
||||
|
||||
public string Email { get; set; } = string.Empty;
|
||||
|
||||
public string Password { get; set; } = string.Empty;
|
||||
|
||||
public string PhoneNumber { get; set; } = string.Empty;
|
||||
|
||||
public string Login { get; set; } = string.Empty;
|
||||
|
||||
public int ID { get; set; }
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +0,0 @@
|
||||
using ServiceStationDataModels;
|
||||
|
||||
namespace ServiceStationContracts.BindingModels
|
||||
{
|
||||
public class ReportBindingModel : IReportModel
|
||||
{
|
||||
public int Count { get; set; }
|
||||
|
||||
public int ID { get; set; }
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationContracts.BindingModels {
|
||||
public class ReportWorkBindingModel {
|
||||
public string FileName { get; set; } = string.Empty;
|
||||
public DateTime? Date { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
using ServiceStationDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationContracts.BindingModels {
|
||||
public class TaskBindingModel : ITaskModel {
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
using ServiceStationDataModels;
|
||||
using ServiceStationDataModels.Enums;
|
||||
using ServiceStationDataModels.Models;
|
||||
|
||||
namespace ServiceStationContracts.BindingModels
|
||||
{
|
||||
@ -6,16 +7,14 @@ namespace ServiceStationContracts.BindingModels
|
||||
{
|
||||
public DateTime Date { get; set; } = DateTime.Now;
|
||||
|
||||
public int Price { get; set; }
|
||||
public double Price { get; set; }
|
||||
|
||||
public WorkStatus Status { get; set; } = WorkStatus.Неизвестно;
|
||||
public WorkStatus Status { get; set; } = WorkStatus.Ожидает_выполнения;
|
||||
|
||||
public int ExecutorId { get; set; }
|
||||
|
||||
public int ReportId { get; set; }
|
||||
public int TaskId { get; set; }
|
||||
|
||||
public int CategoryWorkId { get; set; }
|
||||
|
||||
public int ID { get; set; }
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,14 +0,0 @@
|
||||
using ServiceStationContracts.BindingModels;
|
||||
using ServiceStationContracts.SearchModels;
|
||||
using ServiceStationContracts.ViewModels;
|
||||
|
||||
namespace ServiceStationContracts.BusinessLogicContracts
|
||||
{
|
||||
public interface ICategoryWorkLogic
|
||||
{
|
||||
List<CategoryWorkViewModel>? ReadList(CategoryWorkSearchModel? model);
|
||||
bool Create(CategoryWorkBindingModel model);
|
||||
bool Update(CategoryWorkBindingModel model);
|
||||
bool Delete(CategoryWorkBindingModel model);
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
using ServiceStationContracts.BindingModels;
|
||||
using ServiceStationContracts.SearchModels;
|
||||
using ServiceStationContracts.ViewModels;
|
||||
|
||||
namespace ServiceStationContracts.BusinessLogicContracts
|
||||
{
|
||||
public interface IReportLogic
|
||||
{
|
||||
List<ReportViewModel>? ReadList(ReportSearchModel model);
|
||||
bool Create(ReportBindingModel model);
|
||||
bool Update(ReportBindingModel model);
|
||||
bool Delete(ReportBindingModel model);
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
using ServiceStationContracts.BindingModels;
|
||||
using ServiceStationContracts.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationContracts.BusinessLogicContracts {
|
||||
public interface IReportWorkLogic {
|
||||
// Получение списка заказов за определенный период
|
||||
List<ReportWorkViewModel> GetWorks(ReportWorkBindingModel model);
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
using ServiceStationContracts.BindingModels;
|
||||
using ServiceStationContracts.SearchModels;
|
||||
using ServiceStationContracts.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationContracts.BusinessLogicContracts {
|
||||
public interface ITaskLogic {
|
||||
List<TaskViewModel>? ReadList(TaskSearchModel? model = null);
|
||||
TaskViewModel? ReadElement(TaskSearchModel model);
|
||||
bool Create(TaskBindingModel model);
|
||||
bool Update(TaskBindingModel model);
|
||||
bool Delete(TaskBindingModel model);
|
||||
}
|
||||
}
|
@ -4,8 +4,7 @@
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
|
||||
public string? LastName { get; set; }
|
||||
public string? FIO { get; set; }
|
||||
|
||||
public string? Email { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -4,8 +4,6 @@
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
|
||||
public string? LastName { get; set; }
|
||||
|
||||
public string? Email { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +0,0 @@
|
||||
namespace ServiceStationContracts.SearchModels
|
||||
{
|
||||
public class ReportSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
}
|
||||
}
|
@ -1,8 +1,9 @@
|
||||
namespace ServiceStationContracts.SearchModels
|
||||
{
|
||||
public class CategoryWorkSearchModel
|
||||
public class TaskSearchModel
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
|
||||
public string? Name { get; set; }
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
using ServiceStationDataModels;
|
||||
using ServiceStationDataModels.Enums;
|
||||
|
||||
namespace ServiceStationContracts.SearchModels
|
||||
{
|
||||
|
@ -1,21 +0,0 @@
|
||||
using ServiceStationContracts.BindingModels;
|
||||
using ServiceStationContracts.SearchModels;
|
||||
using ServiceStationContracts.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationsContracts.StorageContracts
|
||||
{
|
||||
public interface ICategoryWorkStorage
|
||||
{
|
||||
List<CategoryWorkViewModel> GetFullList();
|
||||
List<CategoryWorkViewModel> GetFilteredList(CategoryWorkSearchModel model);
|
||||
CategoryWorkViewModel? GetElement(CategoryWorkSearchModel model);
|
||||
CategoryWorkViewModel? Insert(CategoryWorkBindingModel model);
|
||||
CategoryWorkViewModel? Update(CategoryWorkBindingModel model);
|
||||
CategoryWorkViewModel? Delete(CategoryWorkBindingModel model);
|
||||
}
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
using ServiceStationContracts.BindingModels;
|
||||
using ServiceStationContracts.SearchModels;
|
||||
using ServiceStationContracts.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationsContracts.StorageContracts
|
||||
{
|
||||
public interface IReportStorage
|
||||
{
|
||||
List<ReportViewModel> GetFullList();
|
||||
List<ReportViewModel> GetFilteredList(ReportSearchModel model);
|
||||
ReportViewModel? GetElement(ReportSearchModel model);
|
||||
ReportViewModel? Insert(ReportBindingModel model);
|
||||
ReportViewModel? Update(ReportBindingModel model);
|
||||
ReportViewModel? Delete(ReportBindingModel model);
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
using ServiceStationContracts.BindingModels;
|
||||
using ServiceStationContracts.SearchModels;
|
||||
using ServiceStationContracts.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationsContracts.StorageContracts
|
||||
{
|
||||
public interface ITaskStorage
|
||||
{
|
||||
List<TaskViewModel> GetFullList();
|
||||
List<TaskViewModel> GetFilteredList(TaskSearchModel model);
|
||||
TaskViewModel? GetElement(TaskSearchModel model);
|
||||
TaskViewModel? Insert(TaskBindingModel model);
|
||||
TaskViewModel? Update(TaskBindingModel model);
|
||||
TaskViewModel? Delete(TaskBindingModel model);
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
using ServiceStationDataModels;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace ServiceStationContracts.ViewModels
|
||||
{
|
||||
public class CategoryWorkViewModel : ICategoryWorkModel
|
||||
{
|
||||
[DisplayName("Название категории работ")]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
public int ExecutorId { get; set; }
|
||||
|
||||
public int ID { get; set; }
|
||||
}
|
||||
}
|
@ -1,25 +1,19 @@
|
||||
using ServiceStationDataModels;
|
||||
using ServiceStationDataModels.Models;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace ServiceStationContracts.ViewModels
|
||||
{
|
||||
public class ClientViewModel : IClientModel
|
||||
{
|
||||
[DisplayName("Имя")]
|
||||
public string FirstName { get; set; } = string.Empty;
|
||||
[DisplayName("Фамилия")]
|
||||
public string LastName { get; set; } = string.Empty;
|
||||
[DisplayName("Email")]
|
||||
public string Email { get; set; } = string.Empty;
|
||||
[DisplayName("ФИО")]
|
||||
public string FIO { get; set; } = string.Empty;
|
||||
|
||||
[DisplayName("Пароль")]
|
||||
public string Password { get; set; } = string.Empty;
|
||||
[DisplayName("Телефон")]
|
||||
public string PhoneNumber { get; set; } = string.Empty;
|
||||
[DisplayName("Логин")]
|
||||
public string Login { get; set; } = string.Empty;
|
||||
[DisplayName("Бонусы")]
|
||||
public int Point { get; set; }
|
||||
|
||||
public int ID { get; set; }
|
||||
[DisplayName("Бонусы")]
|
||||
public int Points { get; set; }
|
||||
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
using ServiceStationDataModels;
|
||||
using ServiceStationDataModels.Models;
|
||||
|
||||
|
||||
namespace ServiceStationContracts.ViewModels
|
||||
|
@ -1,22 +1,15 @@
|
||||
using ServiceStationDataModels;
|
||||
using ServiceStationDataModels.Models;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace ServiceStationContracts.ViewModels
|
||||
{
|
||||
public class ExecutorViewModel : IExecutorModel
|
||||
{
|
||||
[DisplayName("Имя")]
|
||||
public string FirstName { get; set; } = string.Empty;
|
||||
[DisplayName("Фамилия")]
|
||||
public string LastName { get; set; } = string.Empty;
|
||||
[DisplayName("Email")]
|
||||
public string Email { get; set; } = string.Empty;
|
||||
[DisplayName("Пароль")]
|
||||
public string Password { get; set; } = string.Empty;
|
||||
[DisplayName("Телефон")]
|
||||
public string PhoneNumber { get; set; } = string.Empty;
|
||||
[DisplayName("Логин")]
|
||||
public string Login { get; set; } = string.Empty;
|
||||
public int ID { get; set; }
|
||||
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +0,0 @@
|
||||
using ServiceStationDataModels;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace ServiceStationContracts.ViewModels
|
||||
{
|
||||
public class ReportViewModel : IReportModel
|
||||
{
|
||||
public int Count { get; set; }
|
||||
|
||||
public int ID { get; set; }
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationContracts.ViewModels {
|
||||
public class ReportWorkViewModel {
|
||||
public int Id { get; set; }
|
||||
public DateTime Date { get; set; }
|
||||
public double price { get; set; }
|
||||
|
||||
public string WorkStatus { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
using ServiceStationDataModels.Models;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace ServiceStationContracts.ViewModels
|
||||
{
|
||||
public class TaskViewModel : ITaskModel
|
||||
{
|
||||
[DisplayName("Имя задачи")]
|
||||
public string Name { get; set; }
|
||||
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
using ServiceStationDataModels;
|
||||
using ServiceStationDataModels.Enums;
|
||||
using ServiceStationDataModels.Models;
|
||||
using System.ComponentModel;
|
||||
|
||||
|
||||
@ -9,17 +10,15 @@ namespace ServiceStationContracts.ViewModels
|
||||
[DisplayName("Дата")]
|
||||
public DateTime Date { get; set; } = DateTime.Now;
|
||||
[DisplayName("Цена")]
|
||||
public int Price { get; set; }
|
||||
public double Price { get; set; }
|
||||
[DisplayName("Статус")]
|
||||
public WorkStatus Status { get; set; } = WorkStatus.Неизвестно;
|
||||
public WorkStatus Status { get; set; } = WorkStatus.Ожидает_выполнения;
|
||||
|
||||
public int ExecutorId { get; set; }
|
||||
|
||||
public int ReportId { get; set; }
|
||||
public int TaskId { get; set; }
|
||||
|
||||
public int CategoryWorkId { get; set; }
|
||||
public int Id { get; set; }
|
||||
|
||||
public int ID { get; set; }
|
||||
public Dictionary<int, (ICategoryWorkModel, int)> CategoryWorkList { get; set; } = new();
|
||||
}
|
||||
}
|
||||
|
14
ServiceStation/ServiceStationDataModels/Enums/WorkStatus.cs
Normal file
14
ServiceStation/ServiceStationDataModels/Enums/WorkStatus.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationDataModels.Enums
|
||||
{
|
||||
public enum WorkStatus
|
||||
{
|
||||
Ожидает_выполнения = -1,
|
||||
Выполняется = 1
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
using ServiceStationDataModels.HelperInterfaces;
|
||||
|
||||
namespace ServiceStationDataModels
|
||||
{
|
||||
public interface IClientModel : IId
|
||||
{
|
||||
string FirstName { get; }
|
||||
string LastName { get; }
|
||||
string Email { get; }
|
||||
string Password { get; }
|
||||
string PhoneNumber { get; }
|
||||
string Login { get; }
|
||||
int Point { get; }
|
||||
}
|
||||
}
|
@ -2,6 +2,6 @@
|
||||
{
|
||||
public interface IId
|
||||
{
|
||||
int ID { get; }
|
||||
int Id { get; }
|
||||
}
|
||||
}
|
||||
|
@ -1,14 +0,0 @@
|
||||
using ServiceStationDataModels.HelperInterfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationDataModels
|
||||
{
|
||||
public interface IReportModel : IId
|
||||
{
|
||||
int Count { get; }
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
using ServiceStationDataModels.HelperInterfaces;
|
||||
|
||||
namespace ServiceStationDataModels.Models
|
||||
{
|
||||
public interface IClientModel : IId
|
||||
{
|
||||
string FIO { get; }
|
||||
string Password { get; }
|
||||
int Points { get; }
|
||||
}
|
||||
}
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationDataModels
|
||||
namespace ServiceStationDataModels.Models
|
||||
{
|
||||
public interface IClientWorkModel
|
||||
{
|
@ -5,15 +5,11 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationDataModels
|
||||
namespace ServiceStationDataModels.Models
|
||||
{
|
||||
public interface IExecutorModel : IId
|
||||
{
|
||||
string FirstName { get; }
|
||||
string LastName { get; }
|
||||
string Email { get; }
|
||||
string Password { get; }
|
||||
string PhoneNumber { get; }
|
||||
string Login { get; }
|
||||
}
|
||||
}
|
@ -5,11 +5,10 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationDataModels
|
||||
namespace ServiceStationDataModels.Models
|
||||
{
|
||||
public interface ICategoryWorkModel: IId
|
||||
public interface ITaskModel : IId
|
||||
{
|
||||
string Name { get; }
|
||||
int ExecutorId { get; }
|
||||
}
|
||||
}
|
@ -1,19 +1,19 @@
|
||||
using ServiceStationDataModels.HelperInterfaces;
|
||||
using ServiceStationDataModels.Enums;
|
||||
using ServiceStationDataModels.HelperInterfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationDataModels
|
||||
namespace ServiceStationDataModels.Models
|
||||
{
|
||||
public interface IWorkModel : IId
|
||||
{
|
||||
DateTime Date { get; }
|
||||
int Price { get; }
|
||||
double Price { get; }
|
||||
WorkStatus Status { get; }
|
||||
int ExecutorId { get; }
|
||||
int ReportId { get; }
|
||||
int CategoryWorkId { get; }
|
||||
int TaskId { get; }
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationDataModels
|
||||
{
|
||||
public enum WorkStatus
|
||||
{
|
||||
Неизвестно = -1,
|
||||
Принят = 0,
|
||||
Выполняется = 1,
|
||||
Готов = 2,
|
||||
Выдан = 3
|
||||
}
|
||||
}
|
@ -11,12 +11,12 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationsDataBaseImplement.Implements
|
||||
{
|
||||
public class ReportStorage : IReportStorage
|
||||
public class ReportStorage : ITaskStorage
|
||||
{
|
||||
public ReportViewModel? Delete(ReportBindingModel model)
|
||||
public TaskViewModel? Delete(ReportBindingModel model)
|
||||
{
|
||||
using var context = new Database();
|
||||
var element = context.Reports.FirstOrDefault(rec => rec.Id == model.ID);
|
||||
var element = context.Reports.FirstOrDefault(rec => rec.Id == model.Id);
|
||||
if (element != null)
|
||||
{
|
||||
context.Reports.Remove(element);
|
||||
@ -26,7 +26,7 @@ namespace ServiceStationsDataBaseImplement.Implements
|
||||
return null;
|
||||
}
|
||||
|
||||
public ReportViewModel? GetElement(ReportSearchModel model)
|
||||
public TaskViewModel? GetElement(TaskSearchModel model)
|
||||
{
|
||||
if (!model.Id.HasValue)
|
||||
{
|
||||
@ -37,7 +37,7 @@ namespace ServiceStationsDataBaseImplement.Implements
|
||||
(model.Id.HasValue && x.Id == model.Id))?.GetViewModel;
|
||||
}
|
||||
|
||||
public List<ReportViewModel> GetFilteredList(ReportSearchModel model)
|
||||
public List<TaskViewModel> GetFilteredList(TaskSearchModel model)
|
||||
{
|
||||
if (!model.Id.HasValue)
|
||||
{
|
||||
@ -47,13 +47,13 @@ namespace ServiceStationsDataBaseImplement.Implements
|
||||
return context.Reports.Where(x => x.Id == model.Id).Select(x => x.GetViewModel).ToList();
|
||||
}
|
||||
|
||||
public List<ReportViewModel> GetFullList()
|
||||
public List<TaskViewModel> GetFullList()
|
||||
{
|
||||
using var context = new Database();
|
||||
return context.Reports.Select(x => x.GetViewModel).ToList();
|
||||
}
|
||||
|
||||
public ReportViewModel? Insert(ReportBindingModel model)
|
||||
public TaskViewModel? Insert(ReportBindingModel model)
|
||||
{
|
||||
var newComponent = Report.Create(model);
|
||||
if (newComponent == null)
|
||||
@ -66,10 +66,10 @@ namespace ServiceStationsDataBaseImplement.Implements
|
||||
return newComponent.GetViewModel;
|
||||
}
|
||||
|
||||
public ReportViewModel? Update(ReportBindingModel model)
|
||||
public TaskViewModel? Update(ReportBindingModel model)
|
||||
{
|
||||
using var context = new Database();
|
||||
var component = context.Reports.FirstOrDefault(x => x.Id == model.ID);
|
||||
var component = context.Reports.FirstOrDefault(x => x.Id == model.Id);
|
||||
if (component == null)
|
||||
{
|
||||
return null;
|
||||
|
@ -1,6 +1,6 @@
|
||||
using ServiceStationContracts.BindingModels;
|
||||
using ServiceStationContracts.ViewModels;
|
||||
using ServiceStationDataModels;
|
||||
using ServiceStationDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
@ -1,6 +1,6 @@
|
||||
using ServiceStationContracts.BindingModels;
|
||||
using ServiceStationContracts.ViewModels;
|
||||
using ServiceStationDataModels;
|
||||
using ServiceStationDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
@ -1,6 +1,6 @@
|
||||
using ServiceStationContracts.BindingModels;
|
||||
using ServiceStationContracts.ViewModels;
|
||||
using ServiceStationDataModels;
|
||||
using ServiceStationDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
@ -25,7 +25,7 @@ namespace ServiceStationsDataBaseImplement.Models
|
||||
[Required]
|
||||
public string Login { get; set; } = string.Empty;
|
||||
[Required]
|
||||
public int ID { get; set; }
|
||||
public int Id { get; set; }
|
||||
public static Executor? Create(ExecutorBindingModel? model)
|
||||
{
|
||||
if (model == null)
|
||||
@ -40,7 +40,7 @@ namespace ServiceStationsDataBaseImplement.Models
|
||||
Password = model.Password,
|
||||
PhoneNumber = model.PhoneNumber,
|
||||
Login = model.Login,
|
||||
ID = model.ID
|
||||
Id = model.Id
|
||||
|
||||
};
|
||||
}
|
||||
@ -54,7 +54,7 @@ namespace ServiceStationsDataBaseImplement.Models
|
||||
Password = model.Password,
|
||||
PhoneNumber = model.PhoneNumber,
|
||||
Login = model.Login,
|
||||
ID = model.ID
|
||||
Id = model.Id
|
||||
};
|
||||
}
|
||||
public void Update(ExecutorBindingModel model)
|
||||
@ -79,7 +79,7 @@ namespace ServiceStationsDataBaseImplement.Models
|
||||
Password = Password,
|
||||
PhoneNumber = PhoneNumber,
|
||||
Login = Login,
|
||||
ID = ID
|
||||
Id = Id
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
using ServiceStationContracts.BindingModels;
|
||||
using ServiceStationContracts.ViewModels;
|
||||
using ServiceStationDataModels;
|
||||
using ServiceStationDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
@ -10,12 +10,12 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace ServiceStationsDataBaseImplement.Models
|
||||
{
|
||||
public class Report : IReportModel
|
||||
public class Report : ITaskModel
|
||||
{
|
||||
[Required]
|
||||
public int Count { get; set; }
|
||||
|
||||
public int ID { get; set; }
|
||||
public int Id { get; set; }
|
||||
public static Report? Create(ReportBindingModel? model)
|
||||
{
|
||||
if (model == null)
|
||||
@ -24,15 +24,15 @@ namespace ServiceStationsDataBaseImplement.Models
|
||||
}
|
||||
return new Report()
|
||||
{
|
||||
ID = model.ID,
|
||||
Id = model.Id,
|
||||
Count = model.Count
|
||||
};
|
||||
}
|
||||
public static Report? Create(ReportViewModel model)
|
||||
public static Report? Create(TaskViewModel model)
|
||||
{
|
||||
return new Report
|
||||
{
|
||||
ID = model.ID,
|
||||
Id = model.Id,
|
||||
Count = model.Count,
|
||||
};
|
||||
}
|
||||
@ -45,9 +45,9 @@ namespace ServiceStationsDataBaseImplement.Models
|
||||
Count = model.Count;
|
||||
|
||||
}
|
||||
public ReportViewModel GetViewModel => new()
|
||||
public TaskViewModel GetViewModel => new()
|
||||
{
|
||||
ID = ID,
|
||||
Id = Id,
|
||||
Count = Count
|
||||
};
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
using ServiceStationContracts.BindingModels;
|
||||
using ServiceStationContracts.ViewModels;
|
||||
using ServiceStationDataModels;
|
||||
using ServiceStationDataModels.Enums;
|
||||
using ServiceStationDataModels.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@ -22,7 +23,7 @@ namespace ServiceStationsDataBaseImplement.Models
|
||||
|
||||
public int CategoryWorkId { get; set; }
|
||||
|
||||
public int ID { get; set; }
|
||||
public int Id { get; set; }
|
||||
public static Work? Create(WorkBindingModel? model)
|
||||
{
|
||||
if (model == null)
|
||||
@ -37,7 +38,7 @@ namespace ServiceStationsDataBaseImplement.Models
|
||||
ExecutorId = model.ExecutorId,
|
||||
ReportId = model.ReportId,
|
||||
CategoryWorkId = model.CategoryWorkId,
|
||||
ID = model.ID
|
||||
Id = model.Id
|
||||
|
||||
|
||||
};
|
||||
@ -52,7 +53,7 @@ namespace ServiceStationsDataBaseImplement.Models
|
||||
ExecutorId = model.ExecutorId,
|
||||
ReportId = model.ReportId,
|
||||
CategoryWorkId = model.CategoryWorkId,
|
||||
ID = model.ID
|
||||
Id = model.Id
|
||||
};
|
||||
}
|
||||
public void Update(WorkBindingModel model)
|
||||
@ -78,7 +79,7 @@ namespace ServiceStationsDataBaseImplement.Models
|
||||
ExecutorId = ExecutorId,
|
||||
ReportId = ReportId,
|
||||
CategoryWorkId = CategoryWorkId,
|
||||
ID = ID
|
||||
Id = Id
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user