Контракты

This commit is contained in:
GokaPek 2024-05-13 16:21:24 +04:00
parent e0203bf412
commit 01b2bc9960
30 changed files with 481 additions and 5 deletions

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TaskTrackerDataModels.Models;
namespace TaskTrackerContracts.BindingModels
{
public class DirectionBindingModel : IDirectionModel
{
public int Id { get; set; }
public Dictionary<int, (IStudentModel, int)> DirectionStudents
{
get;
set;
} = new();
public Dictionary<int, (ISubjectModel, int)> DirectionSubjects
{
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;
using TaskTrackerDataModels.Models;
namespace TaskTrackerContracts.BindingModels
{
public class ExamBindingModel : IExamModel
{
public int Id { get; set; }
public int SubjectId { get; set; }
public DateTime Date { get; set; }
}
}

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TaskTrackerDataModels.Models;
namespace TaskTrackerContracts.BindingModels
{
public class ResultBindingModel : IResultModel
{
public int Id { get; set; }
public int StudentId { get; set; }
public int SubjectId { get; set; }
public string Grade { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TaskTrackerDataModels.Models;
namespace TaskTrackerContracts.BindingModels
{
public class StudentBindingModel : IStudentModel
{
public int Id { get; set; }
public DateTime DateBirth { get; set; }
public string Name { get; set; } = string.Empty;
};
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TaskTrackerDataModels.Models;
namespace TaskTrackerContracts.BindingModels
{
public class SubjectBindingModel : ISubjectModel
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TaskTrackerContracts.BindingModels;
using TaskTrackerContracts.SearchModels;
using TaskTrackerContracts.ViewModels;
namespace TaskTrackerContracts.BusinessLogicsContracts
{
public interface IDirectionLogic
{
List<DirectionViewModel>? ReadList(DirectionSearchModel? model);
DirectionViewModel? ReadElement(DirectionSearchModel model);
bool Create(DirectionBindingModel model);
bool Update(DirectionBindingModel model);
bool Delete(DirectionBindingModel model);
}
}

View File

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TaskTrackerContracts.BindingModels;
using TaskTrackerContracts.SearchModels;
using TaskTrackerContracts.ViewModels;
namespace TaskTrackerContracts.BusinessLogicsContracts
{
public interface IExamLogic
{
List<ExamViewModel>? ReadList(ExamSearchModel? model);
ExamViewModel? ReadElement(ExamSearchModel model);
bool Create(ExamBindingModel model);
bool Update(ExamBindingModel model);
bool Delete(ExamBindingModel model);
}
}

View File

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TaskTrackerContracts.BindingModels;
using TaskTrackerContracts.SearchModels;
using TaskTrackerContracts.ViewModels;
namespace TaskTrackerContracts.BusinessLogicsContracts
{
public interface IResultLogic
{
List<ResultViewModel>? ReadList(ResultSearchModel? model);
ResultViewModel? ReadElement(ResultSearchModel model);
bool Create(ResultBindingModel model);
bool Update(ResultBindingModel model);
bool Delete(ResultBindingModel model);
}
}

View File

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TaskTrackerContracts.BindingModels;
using TaskTrackerContracts.SearchModels;
using TaskTrackerContracts.ViewModels;
namespace TaskTrackerContracts.BusinessLogicsContracts
{
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,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TaskTrackerContracts.BindingModels;
using TaskTrackerContracts.SearchModels;
using TaskTrackerContracts.ViewModels;
namespace TaskTrackerContracts.BusinessLogicsContracts
{
public interface ISubjectLogic
{
List<SubjectViewModel>? ReadList(SubjectSearchModel? model);
SubjectViewModel? ReadElement(SubjectSearchModel model);
bool Create(SubjectBindingModel model);
bool Update(SubjectBindingModel model);
bool Delete(SubjectBindingModel model);
}
}

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TaskTrackerContracts.SearchModels
{
public class DirectionSearchModel
{
public int? Id { 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 TaskTrackerContracts.SearchModels
{
public class ExamSearchModel
{
public int? Id { 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 TaskTrackerContracts.SearchModels
{
public class ResultSearchModel
{
public int? Id { 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 TaskTrackerContracts.SearchModels
{
public class StudentSearchModel
{
public int? Id { 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 TaskTrackerContracts.SearchModels
{
public class SubjectSearchModel
{
public int? Id { get; set; }
}
}

View File

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TaskTrackerContracts.BindingModels;
using TaskTrackerContracts.SearchModels;
using TaskTrackerContracts.ViewModels;
namespace TaskTrackerContracts.StoragesContracts
{
public interface IDirectionStorage
{
List<DirectionBindingModel> GetFullList();
List<DirectionBindingModel> GetFilteredList(DirectionSearchModel model);
DirectionBindingModel? GetElement(DirectionSearchModel model);
DirectionBindingModel? Insert(DirectionBindingModel model);
DirectionBindingModel? Update(DirectionBindingModel model);
DirectionBindingModel? Delete(DirectionBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TaskTrackerContracts.BindingModels;
using TaskTrackerContracts.SearchModels;
using TaskTrackerContracts.ViewModels;
namespace TaskTrackerContracts.StoragesContracts
{
public interface IExamStorage
{
List<ExamBindingModel> GetFullList();
List<ExamBindingModel> GetFilteredList(ExamSearchModel model);
ExamBindingModel? GetElement(ExamSearchModel model);
ExamBindingModel? Insert(ExamBindingModel model);
ExamBindingModel? Update(ExamBindingModel model);
ExamBindingModel? Delete(ExamBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TaskTrackerContracts.BindingModels;
using TaskTrackerContracts.SearchModels;
using TaskTrackerContracts.ViewModels;
namespace TaskTrackerContracts.StoragesContracts
{
public interface IResultStorage
{
List<ResultBindingModel> GetFullList();
List<ResultBindingModel> GetFilteredList(ResultSearchModel model);
ResultBindingModel? GetElement(ResultSearchModel model);
ResultBindingModel? Insert(ResultBindingModel model);
ResultBindingModel? Update(ResultBindingModel model);
ResultBindingModel? Delete(ResultBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TaskTrackerContracts.BindingModels;
using TaskTrackerContracts.SearchModels;
using TaskTrackerContracts.ViewModels;
namespace TaskTrackerContracts.StoragesContracts
{
public interface IStudentStorage
{
List<StudentBindingModel> GetFullList();
List<StudentBindingModel> GetFilteredList(StudentSearchModel model);
StudentBindingModel? GetElement(StudentSearchModel model);
StudentBindingModel? Insert(StudentBindingModel model);
StudentBindingModel? Update(StudentBindingModel model);
StudentBindingModel? Delete(StudentBindingModel model);
}
}

View File

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TaskTrackerContracts.BindingModels;
using TaskTrackerContracts.SearchModels;
using TaskTrackerContracts.ViewModels;
namespace TaskTrackerContracts.StoragesContracts
{
public interface ISubjectStorage
{
List<SubjectBindingModel> GetFullList();
List<SubjectBindingModel> GetFilteredList(SubjectSearchModel model);
SubjectBindingModel? GetElement(SubjectSearchModel model);
SubjectBindingModel? Insert(SubjectBindingModel model);
SubjectBindingModel? Update(SubjectBindingModel model);
SubjectBindingModel? Delete(SubjectBindingModel model);
}
}

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TaskTrackerDataModels.Models;
namespace TaskTrackerContracts.ViewModels
{
public class DirectionViewModel : IDirectionModel
{
public int Id { get; set; }
public Dictionary<int, (IStudentModel, int)> DirectionStudents
{
get;
set;
} = new();
public Dictionary<int, (ISubjectModel, int)> DirectionSubjects
{
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;
using TaskTrackerDataModels.Models;
namespace TaskTrackerContracts.ViewModels
{
public class ExamViewModel : IExamModel
{
public int Id { get; set; }
public int SubjectId { get; set; }
public DateTime Date { get; set; }
}
}

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TaskTrackerDataModels.Models;
namespace TaskTrackerContracts.ViewModels
{
public class ResultViewModel : IResultModel
{
public int Id { get; set; }
public int StudentId { get; set; }
public int SubjectId { get; set; }
public string Grade { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TaskTrackerDataModels.Models;
namespace TaskTrackerContracts.ViewModels
{
public class StudentViewModel : IStudentModel
{
public int Id { get; set; }
public DateTime DateBirth { get; set; }
public string Name { get; set; } = string.Empty;
};
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TaskTrackerDataModels.Models;
namespace TaskTrackerContracts.ViewModels
{
public class SubjectViewModel : ISubjectModel
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
}
}

View File

@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace TaskTrackerDataModels.Models namespace TaskTrackerDataModels.Models
{ {
internal interface IDirectionModel : IId public interface IDirectionModel : IId
{ {
Dictionary<int, (IStudentModel, int)> DirectionStudents { get; } Dictionary<int, (IStudentModel, int)> DirectionStudents { get; }
Dictionary<int, (ISubjectModel, int)> DirectionSubjects { get; } Dictionary<int, (ISubjectModel, int)> DirectionSubjects { get; }

View File

@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace TaskTrackerDataModels.Models namespace TaskTrackerDataModels.Models
{ {
internal interface IExamModel : IId public interface IExamModel : IId
{ {
int SubjectId { get; } int SubjectId { get; }
DateTime Date { get; } DateTime Date { get; }

View File

@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace TaskTrackerDataModels.Models namespace TaskTrackerDataModels.Models
{ {
internal interface IResultModel : IId public interface IResultModel : IId
{ {
string Grade { get; } string Grade { get; }
int StudentId { get; } int StudentId { get; }

View File

@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace TaskTrackerDataModels.Models namespace TaskTrackerDataModels.Models
{ {
internal interface IStudentModel : IId public interface IStudentModel : IId
{ {
string Name { get; } string Name { get; }
DateTime DateBirth { get; } DateTime DateBirth { get; }

View File

@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace TaskTrackerDataModels.Models namespace TaskTrackerDataModels.Models
{ {
internal interface ISubjectModel : IId public interface ISubjectModel : IId
{ {
string Name { get; } string Name { get; }
} }