Исполнитель : слой контрактов

This commit is contained in:
Володя 2023-04-03 20:06:23 +03:00
parent 3594acfa15
commit 4f82ccbe6e
22 changed files with 458 additions and 0 deletions

View File

@ -0,0 +1,27 @@
using SchoolAgainStudyDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolAgainStudyContracts.BindingModel
{
public class DiyBindingModel : IDiy
{
public string Title { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public DateTime DateCreate { get; set; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc);
public int TaskId { get; set; }
public string TaskName { get; set; } = string.Empty;
public int StudentId { get; set; }
public Dictionary<int, IInterest> DiyInterests { get; set; } = new();
public int Id { get; set; }
}
}

View File

@ -0,0 +1,18 @@
using SchoolAgainStudyDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolAgainStudyContracts.BindingModel
{
public class InterestBindingModel : IInterest
{
public string Title { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public int Id { get; set; }
}
}

View File

@ -0,0 +1,24 @@
using SchoolAgainStudyDataModels.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolAgainStudyContracts.BindingModel
{
public class ProductBindingModel : IProduct
{
public string Title { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public DateTime DateCreate { get; set; }
public int StudentId { get; set; }
public Dictionary<int, IInterest> ProductInterests { get; set; } = new();
public int Id { get; set; }
}
}

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SchoolAgainStudyDataModels.Models;
namespace SchoolAgainStudyContracts.BindingModel
{
public class StudentBindingModel : IStudent
{
public string Name { get; set; } = string.Empty;
public int Class { get; set; }
public string Email { get; set; } = string.Empty;
public string Login { get; set; } = string.Empty;
public string Password { get; set; } = string.Empty;
public Dictionary<int, IInterest> StudentInterests { get; set; } = new() ;
public int Id { get; set; }
}
}

View File

@ -0,0 +1,20 @@
using SchoolAgainStudyContracts.BindingModel;
using SchoolAgainStudyContracts.SearchModel;
using SchoolAgainStudyContracts.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolAgainStudyContracts.BusinessLogicContracts
{
public interface IDiyLogic
{
List<DiyViewModel>? ReadList(DiySearchModel? model);
DiyViewModel? ReadElement(DiySearchModel model);
bool Create(DiyBindingModel model);
bool Update(DiyBindingModel model);
bool Delete(DiyBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using SchoolAgainStudyContracts.BindingModel;
using SchoolAgainStudyContracts.SearchModel;
using SchoolAgainStudyContracts.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolAgainStudyContracts.BusinessLogicContracts
{
public interface IInterestLogic
{
List<InterestViewModel>? ReadList(InterestSearchModel? model);
InterestViewModel? ReadElement(InterestSearchModel model);
bool Create(InterestBindingModel model);
bool Update(InterestBindingModel model);
bool Delete(InterestBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using SchoolAgainStudyContracts.BindingModel;
using SchoolAgainStudyContracts.SearchModel;
using SchoolAgainStudyContracts.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolAgainStudyContracts.BusinessLogicContracts
{
public interface IProductLogic
{
List<ProductViewModel>? ReadList(ProductSearchModel? model);
ProductViewModel? ReadElement(ProductSearchModel model);
bool Create(ProductBindingModel model);
bool Update(ProductBindingModel model);
bool Delete(ProductBindingModel model);
}
}

View File

@ -0,0 +1,20 @@
using SchoolAgainStudyContracts.BindingModel;
using SchoolAgainStudyContracts.SearchModel;
using SchoolAgainStudyContracts.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolAgainStudyContracts.BusinessLogicContracts
{
public interface IStudentLogic
{
List<StudentViewModel>? ReadList(StudentSearchModel? model);
StudentViewModel? ReadElement(StudentSearchModel model);
bool Create(StudentBindingModel model);
bool Update(StudentBindingModel model);
bool Delete(StudentBindingModel model);
}
}

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolAgainStudyContracts.SearchModel
{
public class DiySearchModel
{
public int? Id { get; set; }
public string? Title { get; set; }
public DateTime? DateFrom { get; set; }
public DateTime? DateTo { get; set; }
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolAgainStudyContracts.SearchModel
{
public class InterestSearchModel
{
public int? Id { get; set; }
public string? Title { get; set; }
}
}

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolAgainStudyContracts.SearchModel
{
public class ProductSearchModel
{
public int? Id { get; set; }
public string? Title { get; set; }
public DateTime? DateFrom { get; set; }
public DateTime? DateTo { get; set; }
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolAgainStudyContracts.SearchModel
{
public class StudentSearchModel
{
public int? Id { get; set; }
public string? Login { get; set; }
public string? Name { get; set; }
}
}

View File

@ -0,0 +1,21 @@
using SchoolAgainStudyContracts.BindingModel;
using SchoolAgainStudyContracts.SearchModel;
using SchoolAgainStudyContracts.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolAgainStudyContracts.StorageContracts
{
public interface IDiyStorage
{
List<DiyViewModel> GetFullList();
List<DiyViewModel> GetFilteredList(DiySearchModel model);
DiyViewModel? GetElement(DiySearchModel model);
DiyViewModel? Insert(DiyBindingModel model);
DiyViewModel? Update(DiyBindingModel model);
DiyViewModel? Delete(DiyBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using SchoolAgainStudyContracts.BindingModel;
using SchoolAgainStudyContracts.SearchModel;
using SchoolAgainStudyContracts.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolAgainStudyContracts.StorageContracts
{
public interface IInterestStorage
{
List<InterestViewModel> GetFullList();
List<InterestViewModel> GetFilteredList(InterestSearchModel model);
InterestViewModel? GetElement(InterestSearchModel model);
InterestViewModel? Insert(InterestBindingModel model);
InterestViewModel? Update(InterestBindingModel model);
InterestViewModel? Delete(InterestBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using SchoolAgainStudyContracts.BindingModel;
using SchoolAgainStudyContracts.SearchModel;
using SchoolAgainStudyContracts.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolAgainStudyContracts.StorageContracts
{
public interface IProductStorage
{
List<ProductViewModel> GetFullList();
List<ProductViewModel> GetFilteredList(ProductSearchModel model);
ProductViewModel? GetElement(ProductSearchModel model);
ProductViewModel? Insert(ProductBindingModel model);
ProductViewModel? Update(ProductBindingModel model);
ProductViewModel? Delete(ProductBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using SchoolAgainStudyContracts.BindingModel;
using SchoolAgainStudyContracts.SearchModel;
using SchoolAgainStudyContracts.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolAgainStudyContracts.StorageContracts
{
public interface IStudentStorage
{
List<StudentViewModel> GetFullList();
List<StudentViewModel> GetFilteredList(StudentSearchModel model);
StudentViewModel? GetElement(StudentSearchModel model);
StudentViewModel? Insert(StudentBindingModel model);
StudentViewModel? Update(StudentBindingModel model);
StudentViewModel? Delete(StudentBindingModel model);
}
}

View File

@ -0,0 +1,30 @@
using SchoolAgainStudyDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolAgainStudyContracts.ViewModel
{
public class DiyViewModel : IDiy
{
[DisplayName("Название")]
public string Title { get; set; } = string.Empty;
[DisplayName("Описание")]
public string Description { get; set; } = string.Empty;
[DisplayName("Дата создания")]
public DateTime DateCreate { get; set; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc);
public int TaskId { get; set; }
[DisplayName("Задание")]
public string TaskName { get; set; } = string.Empty;
public int StudentId { get; set; }
public Dictionary<int, IInterest> DiyInterests { get; set; } = new();
[DisplayName("Номер")]
public int Id { get; set; }
}
}

View File

@ -0,0 +1,20 @@
using SchoolAgainStudyDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolAgainStudyContracts.ViewModel
{
public class InterestViewModel : IInterest
{
[DisplayName("Название")]
public string Title { get; set; } = string.Empty;
[DisplayName("Описание")]
public string Description { get; set; } = string.Empty;
[DisplayName("Номер")]
public int Id { get; set; }
}
}

View File

@ -0,0 +1,26 @@
using SchoolAgainStudyDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolAgainStudyContracts.ViewModel
{
public class ProductViewModel : IProduct
{
[DisplayName("Название")]
public string Title { get; set; } = string.Empty;
[DisplayName("Описание")]
public string Description { get; set; } = string.Empty;
[DisplayName("Дата создания")]
public DateTime DateCreate { get; set; }
public int StudentId { get; set; }
public Dictionary<int, IInterest> ProductInterests { get; set; } = new();
[DisplayName("Номер")]
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 SchoolAgainStudyContracts.ViewModel
{
public class ReportInterestLessonViewModel
{
public string Title { get; set; } = string.Empty;
public List<string> Lessons { get; set; } = new();
}
}

View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SchoolAgainStudyContracts.ViewModel
{
public class ReportInterestViewModel
{
public int Id { get; set; }
public string InterestTitle { get; set; } = string.Empty;
public string InterestDesc { get; set; } = string.Empty;
public string WorkType { get; set; } = string.Empty;
public string WorkTitle { get; set; } = string.Empty;
public string WorkDesc { get; set; } = string.Empty;
public DateTime DateCreate { get; set; }
}
}

View File

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SchoolAgainStudyDataModels.Models;
namespace SchoolAgainStudyContracts.ViewModel
{
public class StudentViewModel : IStudent
{
[DisplayName("ФИО")]
public string Name { get; set; } = string.Empty;
[DisplayName("Класс")]
public int Class { get; set; }
[DisplayName("Почта")]
public string Email { get; set; } = string.Empty;
[DisplayName("Логин")]
public string Login { get; set; } = string.Empty;
[DisplayName("Пароль")]
public string Password { get; set; } = string.Empty;
public Dictionary<int, IInterest> StudentInterests { get; set; } = new() ;
[DisplayName("Номер")]
public int Id { get; set; }
}
}