История синхронизации оценок

This commit is contained in:
kotcheshir73 2022-12-21 09:49:18 +04:00
parent 11db061b1a
commit 7a94448f94
9 changed files with 1847 additions and 1 deletions

View File

@ -124,6 +124,8 @@ namespace CoreDatabase
public virtual DbSet<OrderSyncHistory> OrderSyncHistories { set; get; } public virtual DbSet<OrderSyncHistory> OrderSyncHistories { set; get; }
public virtual DbSet<OrderSyncHistoryRecord> OrderSyncHistoryRecords { set; get; } public virtual DbSet<OrderSyncHistoryRecord> OrderSyncHistoryRecords { set; get; }
public virtual DbSet<StudentMarkPassedDiscipline> StudentMarkPassedDisciplines { set; get; } public virtual DbSet<StudentMarkPassedDiscipline> StudentMarkPassedDisciplines { set; get; }
public virtual DbSet<StudentMarkSyncHistory> StudentMarkSyncHistories { set; get; }
public virtual DbSet<StudentMarkSyncHistoryRecord> StudentMarkSyncHistoryRecords { set; get; }
#endregion #endregion
} }
} }

View File

@ -0,0 +1,56 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace CoreDatabase.Migrations
{
public partial class AddStudentMarkSyncHistory : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "StudentMarkSyncHistories",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
SyncDate = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_StudentMarkSyncHistories", x => x.Id);
});
migrationBuilder.CreateTable(
name: "StudentMarkSyncHistoryRecords",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
StudentMarkSyncHistoryId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Information = table.Column<string>(type: "nvarchar(max)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_StudentMarkSyncHistoryRecords", x => x.Id);
table.ForeignKey(
name: "FK_StudentMarkSyncHistoryRecords_StudentMarkSyncHistories_StudentMarkSyncHistoryId",
column: x => x.StudentMarkSyncHistoryId,
principalTable: "StudentMarkSyncHistories",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_StudentMarkSyncHistoryRecords_StudentMarkSyncHistoryId",
table: "StudentMarkSyncHistoryRecords",
column: "StudentMarkSyncHistoryId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "StudentMarkSyncHistoryRecords");
migrationBuilder.DropTable(
name: "StudentMarkSyncHistories");
}
}
}

View File

@ -926,6 +926,38 @@ namespace CoreDatabase.Migrations
b.ToTable("StudentMarkPassedDisciplines"); b.ToTable("StudentMarkPassedDisciplines");
}); });
modelBuilder.Entity("CoreDatabase.Models.Department.StudentMarkSyncHistory", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("SyncDate")
.HasColumnType("datetime2");
b.HasKey("Id");
b.ToTable("StudentMarkSyncHistories");
});
modelBuilder.Entity("CoreDatabase.Models.Department.StudentMarkSyncHistoryRecord", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<string>("Information")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<Guid>("StudentMarkSyncHistoryId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("StudentMarkSyncHistoryId");
b.ToTable("StudentMarkSyncHistoryRecords");
});
modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
@ -1424,6 +1456,17 @@ namespace CoreDatabase.Migrations
b.Navigation("Student"); b.Navigation("Student");
}); });
modelBuilder.Entity("CoreDatabase.Models.Department.StudentMarkSyncHistoryRecord", b =>
{
b.HasOne("CoreDatabase.Models.Department.StudentMarkSyncHistory", "StudentMarkSyncHistory")
.WithMany("StudentMarkSyncHistoryRecords")
.HasForeignKey("StudentMarkSyncHistoryId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("StudentMarkSyncHistory");
});
modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b =>
{ {
b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock") b.HasOne("CoreDatabase.Models.Department.DisciplineBlock", "DisciplineBlock")
@ -1564,6 +1607,11 @@ namespace CoreDatabase.Migrations
b.Navigation("Students"); b.Navigation("Students");
}); });
modelBuilder.Entity("CoreDatabase.Models.Department.StudentMarkSyncHistory", b =>
{
b.Navigation("StudentMarkSyncHistoryRecords");
});
modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b => modelBuilder.Entity("CoreDatabase.Models.Department.TimeNorm", b =>
{ {
b.Navigation("AcademicPlanRecordTimeNormHours"); b.Navigation("AcademicPlanRecordTimeNormHours");

View File

@ -0,0 +1,31 @@
using CoreModels.ModelsDepartment;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization;
using ToolsModule.ManagmentSecurity;
namespace CoreDatabase.Models.Department
{
[DataContract]
public class StudentMarkSyncHistory : IdEntity, IEntitySecurityExtenstion<StudentMarkSyncHistory>, IStudentMarkSyncHistoryModel
{
[DataMember]
[Required(ErrorMessage = "required")]
public DateTime SyncDate { get; set; }
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
[ForeignKey("StudentMarkSyncHistoryId")]
public virtual List<StudentMarkSyncHistoryRecord> StudentMarkSyncHistoryRecords { get; set; }
//-------------------------------------------------------------------------
public StudentMarkSyncHistory SecurityCheck(StudentMarkSyncHistory entity, bool allowFullData) => entity;
public override string ToString() => SyncDate.ToShortDateString();
}
}

View File

@ -0,0 +1,40 @@
using CoreModels.ModelsDepartment;
using System;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using ToolsModule.ManagmentSecurity;
namespace CoreDatabase.Models.Department
{
[DataContract]
public class StudentMarkSyncHistoryRecord : IdEntity, IEntitySecurityExtenstion<StudentMarkSyncHistoryRecord>, IStudentMarkSyncHistoryRecordModel
{
[DataMember]
[Required(ErrorMessage = "required")]
public Guid StudentMarkSyncHistoryId { get; set; }
[DataMember]
[Required(ErrorMessage = "required")]
public string Information { get; set; }
//-------------------------------------------------------------------------
public virtual StudentMarkSyncHistory StudentMarkSyncHistory { get; set; }
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
public StudentMarkSyncHistoryRecord SecurityCheck(StudentMarkSyncHistoryRecord entity, bool allowFullData)
{
if (!allowFullData)
{
entity.Information = "скрыто";
}
return entity;
}
public override string ToString() => Information;
}
}

View File

@ -5,7 +5,7 @@ using ToolsModule.ManagmentEntity;
namespace CoreModels.ModelsDepartment namespace CoreModels.ModelsDepartment
{ {
[EntityDescription("OrderSyncHistoryRecord", "Дисципилна кафедры")] [EntityDescription("OrderSyncHistoryRecord", "Дисципилна кафедры")]
[EntityDependency("OrderSyncHistory", "OrderSyncHistoryId", "История синхронизации прказов, к которой относитя запись")] [EntityDependency("OrderSyncHistory", "OrderSyncHistoryId", "История синхронизации прказов, к которой относится запись")]
public interface IOrderSyncHistoryRecordModel : IId public interface IOrderSyncHistoryRecordModel : IId
{ {
Guid OrderSyncHistoryId { get; } Guid OrderSyncHistoryId { get; }

View File

@ -0,0 +1,12 @@
using CoreModels.Tools;
using System;
using ToolsModule.ManagmentEntity;
namespace CoreModels.ModelsDepartment
{
[EntityDescription("StudentMarkSyncHistory", "История синхронизации оценок студентов")]
public interface IStudentMarkSyncHistoryModel : IId
{
DateTime SyncDate { get; }
}
}

View File

@ -0,0 +1,15 @@
using CoreModels.Tools;
using System;
using ToolsModule.ManagmentEntity;
namespace CoreModels.ModelsDepartment
{
[EntityDescription("StudentMarkSyncHistoryRecord", "Запись оценки по студенту")]
[EntityDependency("StudentMarkSyncHistory", "StudentMarkSyncHistoryId", "История синхронизации оценок, к которой относится запись")]
public interface IStudentMarkSyncHistoryRecordModel : IId
{
Guid StudentMarkSyncHistoryId { get; }
string Information { get; }
}
}