Compare commits

..

9 Commits

33 changed files with 939 additions and 36 deletions

View File

@ -0,0 +1,79 @@
using UniversityContracts.BindingModels;
using UniversityContracts.SearchModels;
using UniversityContracts.StoragesContracts;
using UniversityContracts.ViewModels;
using UniversityDatabaseImplement.Models;
namespace UniversityDatabaseImplement.Implements
{
internal class ActivityStorage : IActivityStorage
{
public ActivityViewModel? Delete(ActivityBindingModel model)
{
using var context = new UniversityDatabase();
var element = context.Activities.FirstOrDefault(rec => rec.Id == model.Id);
if (element != null)
{
context.Activities.Remove(element);
context.SaveChanges();
return element.GetViewModel;
}
return null;
}
public ActivityViewModel? GetElement(ActivitySearchModel model)
{
if (!model.Id.HasValue)
{
return null;
}
using var context = new UniversityDatabase();
return context.Activities
.FirstOrDefault(x => (model.Id.HasValue && x.Id == model.Id))?.GetViewModel;
}
public List<ActivityViewModel> GetFilteredList(ActivitySearchModel model)
{
using var context = new UniversityDatabase();
return context.Activities
.Where(x => (
(!model.Id.HasValue || x.Id == model.Id)
)
)
.Select(x => x.GetViewModel)
.ToList();
}
public List<ActivityViewModel> GetFullList()
{
using var context = new UniversityDatabase();
return context.Activities.Select(x => x.GetViewModel).ToList();
}
public ActivityViewModel? Insert(ActivityBindingModel model)
{
var newActivity = Activity.Create(model);
if (newActivity == null)
{
return null;
}
using var context = new UniversityDatabase();
context.Activities.Add(newActivity);
context.SaveChanges();
return newActivity.GetViewModel;
}
public ActivityViewModel? Update(ActivityBindingModel model)
{
using var context = new UniversityDatabase();
var activity = context.Activities.FirstOrDefault(x => x.Id == model.Id);
if (activity == null)
{
return null;
}
activity.Update(model);
context.SaveChanges();
return activity.GetViewModel;
}
}
}

View File

@ -0,0 +1,81 @@
using UniversityContracts.BindingModels;
using UniversityContracts.SearchModels;
using UniversityContracts.StoragesContracts;
using UniversityContracts.ViewModels;
using UniversityDatabaseImplement.Models;
namespace UniversityDatabaseImplement.Implements
{
internal class DisciplineStorage : IDisciplineStorage
{
public DisciplineViewModel? Delete(DisciplineBindingModel model)
{
using var context = new UniversityDatabase();
var element = context.Disciplines.FirstOrDefault(rec => rec.Id == model.Id);
if (element != null)
{
context.ExaminationResults.Remove(element);
context.SaveChanges();
return element.GetViewModel;
}
return null;
}
public DisciplineViewModel? GetElement(DisciplineSearchModel model)
{
if (string.IsNullOrEmpty(model.Name) && !model.Id.HasValue)
{
return null;
}
using var context = new UniversityDatabase();
return context.Disciplines
.FirstOrDefault(x => (!string.IsNullOrEmpty(model.Name) && x.Name == model.Name) ||
(model.Id.HasValue && x.Id == model.Id))?.GetViewModel;
}
public List<DisciplineViewModel> GetFilteredList(DisciplineSearchModel model)
{
using var context = new UniversityDatabase();
return context.Disciplines
.Where(x => (
(!model.Id.HasValue || x.Id == model.Id) &&
(string.IsNullOrEmpty(model.Name) || x.Name.Contains(model.Name))
)
)
.Select(x => x.GetViewModel)
.ToList();
}
public List<DisciplineViewModel> GetFullList()
{
using var context = new UniversityDatabase();
return context.Disciplines.Select(x => x.GetViewModel).ToList();
}
public DisciplineViewModel? Insert(DisciplineBindingModel model)
{
var newDiscipline = Discipline.Create(model);
if (newDiscipline == null)
{
return null;
}
using var context = new UniversityDatabase();
context.Disciplines.Add(newDiscipline);
context.SaveChanges();
return newDiscipline.GetViewModel;
}
public DisciplineViewModel? Update(DisciplineBindingModel model)
{
using var context = new UniversityDatabase();
var discipline = context.Disciplines.FirstOrDefault(x => x.Id == model.Id);
if (discipline == null)
{
return null;
}
discipline.Update(model);
context.SaveChanges();
return discipline.GetViewModel;
}
}
}

View File

@ -0,0 +1,79 @@
using UniversityContracts.BindingModels;
using UniversityContracts.SearchModels;
using UniversityContracts.StoragesContracts;
using UniversityContracts.ViewModels;
using UniversityDatabaseImplement.Models;
namespace UniversityDatabaseImplement.Implements
{
internal class ExaminationResultStorage : IExaminationResultStorage
{
public ExaminationResultViewModel? Delete(ExaminationResultBindingModel model)
{
using var context = new UniversityDatabase();
var element = context.ExaminationResults.FirstOrDefault(rec => rec.Id == model.Id);
if (element != null)
{
context.ExaminationResults.Remove(element);
context.SaveChanges();
return element.GetViewModel;
}
return null;
}
public ExaminationResultViewModel? GetElement(ExaminationResultSearchModel model)
{
if (!model.Id.HasValue)
{
return null;
}
using var context = new UniversityDatabase();
return context.ExaminationResults
.FirstOrDefault(x => (model.Id.HasValue && x.Id == model.Id))?.GetViewModel;
}
public List<ExaminationResultViewModel> GetFilteredList(ExaminationResultSearchModel model)
{
using var context = new UniversityDatabase();
return context.ExaminationResults
.Where(x => (
(!model.Id.HasValue || x.Id == model.Id)
)
)
.Select(x => x.GetViewModel)
.ToList();
}
public List<ExaminationResultViewModel> GetFullList()
{
using var context = new UniversityDatabase();
return context.ExaminationResults.Select(x => x.GetViewModel).ToList();
}
public ExaminationResultViewModel? Insert(ExaminationResultBindingModel model)
{
var newExaminationResult = ExaminationResult.Create(model);
if (newExaminationResult == null)
{
return null;
}
using var context = new UniversityDatabase();
context.ExaminationResults.Add(newExaminationResult);
context.SaveChanges();
return newExaminationResult.GetViewModel;
}
public ExaminationResultViewModel? Update(ExaminationResultBindingModel model)
{
using var context = new UniversityDatabase();
var examinationResult = context.ExaminationResults.FirstOrDefault(x => x.Id == model.Id);
if (examinationResult == null)
{
return null;
}
examinationResult.Update(model);
context.SaveChanges();
return examinationResult.GetViewModel;
}
}
}

View File

@ -0,0 +1,81 @@
using UniversityContracts.BindingModels;
using UniversityContracts.SearchModels;
using UniversityContracts.StoragesContracts;
using UniversityContracts.ViewModels;
using UniversityDatabaseImplement.Models;
namespace UniversityDatabaseImplement.Implements
{
internal class ReportTypeStorage : IReportTypeStorage
{
public ReportTypeViewModel? Delete(ReportTypeBindingModel model)
{
using var context = new UniversityDatabase();
var element = context.ReportTypes.FirstOrDefault(rec => rec.Id == model.Id);
if (element != null)
{
context.ReportTypes.Remove(element);
context.SaveChanges();
return element.GetViewModel;
}
return null;
}
public ReportTypeViewModel? GetElement(ReportTypeSearchModel model)
{
if (string.IsNullOrEmpty(model.Name) && !model.Id.HasValue)
{
return null;
}
using var context = new UniversityDatabase();
return context.ReportTypes
.FirstOrDefault(x => (!string.IsNullOrEmpty(model.Name) && x.Name == model.Name) ||
(model.Id.HasValue && x.Id == model.Id))?.GetViewModel;
}
public List<ReportTypeViewModel> GetFilteredList(ReportTypeSearchModel model)
{
using var context = new UniversityDatabase();
return context.ReportTypes
.Where(x => (
(!model.Id.HasValue || x.Id == model.Id) &&
(string.IsNullOrEmpty(model.Name) || x.Name.Contains(model.Name))
)
)
.Select(x => x.GetViewModel)
.ToList();
}
public List<ReportTypeViewModel> GetFullList()
{
using var context = new UniversityDatabase();
return context.ReportTypes.Select(x => x.GetViewModel).ToList();
}
public ReportTypeViewModel? Insert(ReportTypeBindingModel model)
{
var newReportType = ReportType.Create(model);
if (newReportType == null)
{
return null;
}
using var context = new UniversityDatabase();
context.ReportTypes.Add(newReportType);
context.SaveChanges();
return newReportType.GetViewModel;
}
public ReportTypeViewModel? Update(ReportTypeBindingModel model)
{
using var context = new UniversityDatabase();
var reportType = context.ReportTypes.FirstOrDefault(x => x.Id == model.Id);
if (reportType == null)
{
return null;
}
reportType.Update(model);
context.SaveChanges();
return reportType.GetViewModel;
}
}
}

View File

@ -0,0 +1,79 @@
using UniversityContracts.BindingModels;
using UniversityContracts.SearchModels;
using UniversityContracts.StoragesContracts;
using UniversityContracts.ViewModels;
using UniversityDatabaseImplement.Models;
namespace UniversityDatabaseImplement.Implements
{
internal class StatementStorage : IStatementStorage
{
public StatementViewModel? Delete(StatementBindingModel model)
{
using var context = new UniversityDatabase();
var element = context.Statements.FirstOrDefault(rec => rec.Id == model.Id);
if (element != null)
{
context.Statements.Remove(element);
context.SaveChanges();
return element.GetViewModel;
}
return null;
}
public StatementViewModel? GetElement(StatementSearchModel model)
{
if (!model.Id.HasValue)
{
return null;
}
using var context = new UniversityDatabase();
return context.Statements
.FirstOrDefault(x => (model.Id.HasValue && x.Id == model.Id))?.GetViewModel;
}
public List<StatementViewModel> GetFilteredList(StatementSearchModel model)
{
using var context = new UniversityDatabase();
return context.Statements
.Where(x => (
(!model.Id.HasValue || x.Id == model.Id)
)
)
.Select(x => x.GetViewModel)
.ToList();
}
public List<StatementViewModel> GetFullList()
{
using var context = new UniversityDatabase();
return context.Statements.Select(x => x.GetViewModel).ToList();
}
public StatementViewModel? Insert(StatementBindingModel model)
{
var newStatement = Statement.Create(model);
if (newStatement == null)
{
return null;
}
using var context = new UniversityDatabase();
context.Statements.Add(newStatement);
context.SaveChanges();
return newStatement.GetViewModel;
}
public StatementViewModel? Update(StatementBindingModel model)
{
using var context = new UniversityDatabase();
var statement = context.Statements.FirstOrDefault(x => x.Id == model.Id);
if (statement == null)
{
return null;
}
statement.Update(model);
context.SaveChanges();
return statement.GetViewModel;
}
}
}

View File

@ -0,0 +1,81 @@
using UniversityContracts.BindingModels;
using UniversityContracts.SearchModels;
using UniversityContracts.StoragesContracts;
using UniversityContracts.ViewModels;
using UniversityDatabaseImplement.Models;
namespace UniversityDatabaseImplement.Implements
{
internal class StudentStorage : IStudentStorage
{
public StudentViewModel? Delete(StudentBindingModel model)
{
using var context = new UniversityDatabase();
var element = context.Students.FirstOrDefault(rec => rec.Id == model.Id);
if (element != null)
{
context.Students.Remove(element);
context.SaveChanges();
return element.GetViewModel;
}
return null;
}
public StudentViewModel? GetElement(StudentSearchModel model)
{
if (string.IsNullOrEmpty(model.Name) && !model.Id.HasValue)
{
return null;
}
using var context = new UniversityDatabase();
return context.Students
.FirstOrDefault(x => (!string.IsNullOrEmpty(model.Name) && x.Name== model.Name) ||
(model.Id.HasValue && x.Id == model.Id))?.GetViewModel;
}
public List<StudentViewModel> GetFilteredList(StudentSearchModel model)
{
using var context = new UniversityDatabase();
return context.Students
.Where(x => (
(!model.Id.HasValue || x.Id == model.Id) &&
(string.IsNullOrEmpty(model.Name) || x.Name.Contains(model.Name))
)
)
.Select(x => x.GetViewModel)
.ToList();
}
public List<StudentViewModel> GetFullList()
{
using var context = new UniversityDatabase();
return context.Students.Select(x => x.GetViewModel).ToList();
}
public StudentViewModel? Insert(StudentBindingModel model)
{
var newStudent = Student.Create(model);
if (newStudent == null)
{
return null;
}
using var context = new UniversityDatabase();
context.Students.Add(newStudent);
context.SaveChanges();
return newStudent.GetViewModel;
}
public StudentViewModel? Update(StudentBindingModel model)
{
using var context = new UniversityDatabase();
var student = context.Students.FirstOrDefault(x => x.Id == model.Id);
if (student == null)
{
return null;
}
student.Update(model);
context.SaveChanges();
return student.GetViewModel;
}
}
}

View File

@ -0,0 +1,45 @@
using UniversityContracts.BindingModels;
using UniversityContracts.ViewModels;
using UniversityDataModels.Models;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace UniversityDatabaseImplement.Models
{
public class Activity : IActivityModel
{
public int Id { get; set; }
[Required]
public DateTime Date { get; set; }
[Required]
public int Number { get; set; }
[ForeignKey("ActivityId")]
public virtual List<ReportTypeActivity> ReportTypeActivities { get; set; } = new();
public static Activity Create(ActivityBindingModel model)
{
return new Activity
{
Id = model.Id,
Date = model.Date,
Number = model.Number
};
}
public void Update(ActivityBindingModel model)
{
if (model == null) return;
Id = model.Id;
Date = model.Date;
Number = model.Number;
}
public ActivityViewModel GetViewModel => new()
{
Id = Id,
Date = Date,
Number = Number
};
}
}

View File

@ -0,0 +1,47 @@
using UniversityContracts.BindingModels;
using UniversityContracts.ViewModels;
using UniversityDataModels.Models;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace UniversityDatabaseImplement.Models
{
public class Discipline : IDisciplineModel
{
public int Id { get; set; }
[Required]
public string Name { get; set; }
[Required]
public string Department { get; set; }
[ForeignKey("DisciplineId")]
public virtual List<Statement> Statements { get; set; } = new();
[ForeignKey("DisciplineId")]
public virtual List<ReportTypeDiscipline> ReportTypeDisciplines { get; set; } = new();
public static Discipline Create(DisciplineBindingModel model)
{
return new Discipline
{
Id = model.Id,
Name = model.Name,
Department = model.Department
};
}
public void Update(DisciplineBindingModel model)
{
if (model == null) return;
Id = model.Id;
Name = model.Name;
Department = model.Department;
}
public DisciplineViewModel GetViewModel => new()
{
Id = Id,
Name = Name,
Department = Department
};
}
}

View File

@ -0,0 +1,51 @@
using UniversityContracts.BindingModels;
using UniversityContracts.ViewModels;
using UniversityDataModels.Models;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using UniversityDataModels.Enums;
namespace UniversityDatabaseImplement.Models
{
public class ExaminationResult : IExaminationResultModel
{
public int Id { get; set; }
public string ExaminationForm { get; set; }
[Required]
public MarkType Mark { get; set; }
[Required]
public DateTime Date { get; set; }
[ForeignKey("ExaminationResultId")]
public virtual List<Activity> Activities { get; set; } = new();
[ForeignKey("ExaminationResultId")]
public virtual List<StudentExaminationResult> StudentExaminationResults { get; set; } = new();
public static ExaminationResult Create(ExaminationResultBindingModel model)
{
return new ExaminationResult
{
Id = model.Id,
ExaminationForm = model.ExaminationForm,
Mark = model.Mark,
Date = model.Date
};
}
public void Update(ExaminationResultBindingModel model)
{
if (model == null) return;
Id = model.Id;
ExaminationForm = model.ExaminationForm;
Mark = model.Mark;
Date = model.Date;
}
public ExaminationResultViewModel GetViewModel => new()
{
Id = Id,
ExaminationForm = ExaminationForm,
Mark = Mark,
Date = Date
};
}
}

View File

@ -0,0 +1,40 @@
using UniversityContracts.BindingModels;
using UniversityContracts.ViewModels;
using UniversityDataModels.Models;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace UniversityDatabaseImplement.Models
{
public class ReportType : IReportTypeModel
{
public int Id { get; set; }
[Required]
public string Name { get; set; }
[ForeignKey("ReportTypeId")]
public virtual List<ReportTypeActivity> ReportTypeActivities { get; set; } = new();
[ForeignKey("ReportTypeId")]
public virtual List<ReportTypeDiscipline> ReportTypeDisciplines { get; set; } = new();
public static ReportType Create(ReportTypeBindingModel model)
{
return new ReportType
{
Id = model.Id,
Name = model.Name
};
}
public void Update(ReportTypeBindingModel model)
{
if (model == null) return;
Id = model.Id;
Name = model.Name;
}
public ReportTypeViewModel GetViewModel => new()
{
Id = Id,
Name = Name
};
}
}

View File

@ -0,0 +1,15 @@
using System.ComponentModel.DataAnnotations;
namespace UniversityDatabaseImplement.Models
{
public class ReportTypeActivity
{
public int Id { get; set; }
[Required]
public int ReportTypeId { get; set; }
[Required]
public int ActivityId { get; set; }
public virtual ReportType ReportType { get; set; } = new();
public virtual Activity Activity { get; set; } = new();
}
}

View File

@ -0,0 +1,15 @@
using System.ComponentModel.DataAnnotations;
namespace UniversityDatabaseImplement.Models
{
public class ReportTypeDiscipline
{
public int Id { get; set; }
[Required]
public int ReportTypeId { get; set; }
[Required]
public int DisciplineId { get; set; }
public virtual ReportType ReportType { get; set; } = new();
public virtual Discipline Discipline { get; set; } = new();
}
}

View File

@ -0,0 +1,45 @@
using UniversityContracts.BindingModels;
using UniversityContracts.ViewModels;
using UniversityDataModels.Models;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace UniversityDatabaseImplement.Models
{
public class Statement : IStatementModel
{
public int Id { get; set; }
[Required]
public DateTime Date { get; set; }
[Required]
public int HoursCount { get; set; }
[ForeignKey("StatementId")]
public virtual List<StatementStudent> StatementStudents { get; set; } = new();
[ForeignKey("StatementId")]
public virtual List<ExaminationResult> ExaminationResults { get; set; } = new();
public static Statement Create(StatementBindingModel model)
{
return new Statement
{
Id = model.Id,
Date = model.Date,
HoursCount = model.HoursCount
};
}
public void Update(StatementBindingModel model)
{
if (model == null) return;
Id = model.Id;
Date = model.Date;
HoursCount = model.HoursCount;
}
public StatementViewModel GetViewModel => new()
{
Id = Id,
Date = Date,
HoursCount = HoursCount
};
}
}

View File

@ -0,0 +1,15 @@
using System.ComponentModel.DataAnnotations;
namespace UniversityDatabaseImplement.Models
{
public class StatementStudent
{
public int Id { get; set; }
[Required]
public int StudentTypeId { get; set; }
[Required]
public int StatementId { get; set; }
public virtual Student Student { get; set; } = new();
public virtual Statement Statement { get; set; } = new();
}
}

View File

@ -0,0 +1,45 @@
using UniversityContracts.BindingModels;
using UniversityContracts.ViewModels;
using UniversityDataModels.Models;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace UniversityDatabaseImplement.Models
{
public class Student : IStudentModel
{
public int Id { get; set; }
[Required]
public string Name { get; set; }
[Required]
public string RecordCardNumber { get; set; }
[ForeignKey("StudentId")]
public virtual List<StatementStudent> StatementStudents { get; set; } = new();
[ForeignKey("StudentId")]
public virtual List<StudentExaminationResult> StudentExaminationResults { get; set; } = new();
public static Student Create(StudentBindingModel model)
{
return new Student
{
Id = model.Id,
Name = model.Name,
RecordCardNumber = model.RecordCardNumber
};
}
public void Update(StudentBindingModel model)
{
if (model == null) return;
Id = model.Id;
Name = model.Name;
RecordCardNumber = model.RecordCardNumber;
}
public StudentViewModel GetViewModel => new()
{
Id = Id,
Name = Name,
RecordCardNumber = RecordCardNumber
};
}
}

View File

@ -0,0 +1,15 @@
using System.ComponentModel.DataAnnotations;
namespace UniversityDatabaseImplement.Models
{
public class StudentExaminationResult
{
public int Id { get; set; }
[Required]
public int ExaminationResultId { get; set; }
[Required]
public int StudentId { get; set; }
public virtual ExaminationResult ExaminationResult { get; set; } = new();
public virtual Student Student { get; set; } = new();
}
}

View File

@ -0,0 +1,27 @@
using UniversityDatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
namespace UniversityDatabaseImplement
{
public class UniversityDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseNpgsql(@"Host=localhost;Port=5432;Database=UniversityDatabase;Username=postgres;Password=postgres");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Activity> Activities { set; get; }
public virtual DbSet<Discipline> Disciplines { set; get; }
public virtual DbSet<ExaminationResult> ExaminationResults { set; get; }
public virtual DbSet<ReportType> ReportTypes { set; get; }
public virtual DbSet<ReportTypeActivity> ReportTypeActivities { set; get; }
public virtual DbSet<ReportTypeDiscipline> ReportTypeDisciplines { set; get; }
public virtual DbSet<Statement> Statements { set; get; }
public virtual DbSet<StatementStudent> StatementStudents { set; get; }
public virtual DbSet<Student> Students { set; get; }
public virtual DbSet<StudentExaminationResult> StudentExaminationResults { set; get; }
}
}

View File

@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\UniversityContracts\UniversityContracts.csproj" />
<ProjectReference Include="..\UniversityDataModels\UniversityDataModels.csproj" />
</ItemGroup>
</Project>

View File

@ -5,9 +5,11 @@ VisualStudioVersion = 17.1.32319.34
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "University", "University\University.csproj", "{34B9CDDB-BFE5-48B9-AA3A-1A01D99A765D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniversityDataModels", "UniversityDataModels\UniversityDataModels.csproj", "{36B2DE4B-7689-4287-911E-892FCD27AE84}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UniversityDataModels", "UniversityDataModels\UniversityDataModels.csproj", "{36B2DE4B-7689-4287-911E-892FCD27AE84}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniversityContracts", "UniversityContracts\UniversityContracts.csproj", "{BACEFD46-1073-4730-BC42-15B0D0D359C9}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UniversityContracts", "UniversityContracts\UniversityContracts.csproj", "{BACEFD46-1073-4730-BC42-15B0D0D359C9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniversityDatabaseImplement", "DatabaseImplement\UniversityDatabaseImplement.csproj", "{E90DAE97-8D0D-4E8E-89BC-82D3B54DA067}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -27,6 +29,10 @@ Global
{BACEFD46-1073-4730-BC42-15B0D0D359C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BACEFD46-1073-4730-BC42-15B0D0D359C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BACEFD46-1073-4730-BC42-15B0D0D359C9}.Release|Any CPU.Build.0 = Release|Any CPU
{E90DAE97-8D0D-4E8E-89BC-82D3B54DA067}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E90DAE97-8D0D-4E8E-89BC-82D3B54DA067}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E90DAE97-8D0D-4E8E-89BC-82D3B54DA067}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E90DAE97-8D0D-4E8E-89BC-82D3B54DA067}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -2,7 +2,7 @@
namespace UniversityContracts.BindingModels
{
public class StatementBindingModel : IStatementModel
public class StatementBindingModel : IStudentModel
{
public int Id { get; set; }
public DateTime Date { get; set; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc);

View File

@ -1,8 +1,15 @@
using UniversityDataModels.Models;
using UniversityContracts.BindingModels;
using UniversityContracts.SearchModels;
using UniversityContracts.ViewModels;
namespace UniversityContracts.BuisnessLogicContracts
{
public interface IActivityLogic
{
List<ActivityViewModel>? ReadList(ActivitySearchModel? model);
ActivityViewModel? ReadElement(ActivitySearchModel model);
bool Create(ActivityBindingModel model);
bool Update(ActivityBindingModel model);
bool Delete(ActivityBindingModel model);
}
}

View File

@ -1,9 +1,16 @@
using UniversityDataModels.Models;
using UniversityContracts.BindingModels;
using UniversityContracts.SearchModels;
using UniversityContracts.ViewModels;
namespace UniversityContracts.BuisnessLogicContracts
{
public interface IDisciplineLogic
{
List<DisciplineViewModel>? ReadList(DisciplineSearchModel? model);
DisciplineViewModel? ReadElement(DisciplineSearchModel model);
bool Create(DisciplineBindingModel model);
bool Update(DisciplineBindingModel model);
bool Delete(DisciplineBindingModel model);
}
}

View File

@ -1,8 +1,15 @@
using UniversityDataModels.Models;
using UniversityContracts.BindingModels;
using UniversityContracts.SearchModels;
using UniversityContracts.ViewModels;
namespace UniversityContracts.BuisnessLogicContracts
{
public interface IExaminationResultLogic
{
List<ExaminationResultViewModel>? ReadList(ExaminationResultSearchModel? model);
ExaminationResultViewModel? ReadElement(ExaminationResultSearchModel model);
bool Create(ExaminationResultBindingModel model);
bool Update(ExaminationResultBindingModel model);
bool Delete(ExaminationResultBindingModel model);
}
}

View File

@ -1,9 +1,16 @@
using UniversityDataModels.Models;
using UniversityContracts.BindingModels;
using UniversityContracts.SearchModels;
using UniversityContracts.ViewModels;
namespace UniversityContracts.BuisnessLogicContracts
{
public interface IReportTypeLogic
{
List<ReportTypeViewModel>? ReadList(ReportTypeSearchModel? model);
ReportTypeViewModel? ReadElement(ReportTypeSearchModel model);
bool Create(ReportTypeBindingModel model);
bool Update(ReportTypeBindingModel model);
bool Delete(ReportTypeBindingModel model);
}
}

View File

@ -1,8 +1,15 @@
using UniversityDataModels.Models;
using UniversityContracts.BindingModels;
using UniversityContracts.SearchModels;
using UniversityContracts.ViewModels;
namespace UniversityContracts.BuisnessLogicContracts
{
public interface IStatementLogic
{
List<StatementViewModel>? ReadList(StatementSearchModel? model);
StatementViewModel? ReadElement(StatementSearchModel model);
bool Create(StatementBindingModel model);
bool Update(StatementBindingModel model);
bool Delete(StatementBindingModel model);
}
}

View File

@ -1,8 +1,15 @@
using UniversityDataModels.Models;
using UniversityContracts.BindingModels;
using UniversityContracts.SearchModels;
using UniversityContracts.ViewModels;
namespace UniversityContracts.BuisnessLogicContracts
{
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

@ -2,10 +2,8 @@
namespace UniversityContracts.SearchModels
{
public class ActivitySearchModel : IActivityModel
public class ActivitySearchModel
{
public int Id { get; set; }
public DateTime Date { get; set; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc);
public int Number { get; set; }
public int? Id { get; set; }
}
}

View File

@ -2,10 +2,9 @@
namespace UniversityContracts.SearchModels
{
public class DisciplineSearchModel : IDisciplineModel
public class DisciplineSearchModel
{
public int Id { get; set; }
public string Name { get; set; } = String.Empty;
public string Department { get; set; } = String.Empty;
public int? Id { get; set; }
public string? Name { get; set; }
}
}

View File

@ -3,11 +3,8 @@ using UniversityDataModels.Models;
namespace UniversityContracts.SearchModels
{
public class ExaminationResultSearchModel : IExaminationResultModel
public class ExaminationResultSearchModel
{
public int Id { get; set; }
public string ExaminationForm { get; set; } = String.Empty;
public MarkType Mark { get; set; } = MarkType.Неизвестен;
public DateTime Date { get; set; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc);
public int? Id { get; set; }
}
}

View File

@ -2,9 +2,9 @@
namespace UniversityContracts.SearchModels
{
public class ReportTypeSearchModel : IReportTypeModel
public class ReportTypeSearchModel
{
public int Id { get; set; }
public string Name { get; set; } = String.Empty;
public int? Id { get; set; }
public string? Name { get; set; }
}
}

View File

@ -2,10 +2,8 @@
namespace UniversityContracts.SearchModels
{
public class StatementSearchModel : IStatementModel
public class StatementSearchModel
{
public int Id { get; set; }
public DateTime Date { get; set; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc);
public int HoursCount { get; set; }
public int? Id { get; set; }
}
}

View File

@ -2,10 +2,9 @@
namespace UniversityContracts.SearchModels
{
public class StudentSearchModel : IStudentModel
public class StudentSearchModel
{
public int Id { get; set; }
public string Name { get; set; } = String.Empty;
public string RecordCardNumber { get; set; } = String.Empty;
public int? Id { get; set; }
public string? Name { get; set; }
}
}

View File

@ -2,10 +2,10 @@
namespace UniversityContracts.ViewModels
{
public class StudentViewModel : IStatementModel
public class StudentViewModel : IStudentModel
{
public int Id { get; set; }
public DateTime Date { get; set; } = DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Utc);
public int HoursCount { get; set; }
public string Name { get; set; } = String.Empty;
public string RecordCardNumber { get; set; } = String.Empty;
}
}