diff --git a/DepartmentPortal/Common/DatabaseCore/DatabaseContext.cs b/DepartmentPortal/Common/DatabaseCore/DatabaseContext.cs index 4f4fae2..bd1a15f 100644 --- a/DepartmentPortal/Common/DatabaseCore/DatabaseContext.cs +++ b/DepartmentPortal/Common/DatabaseCore/DatabaseContext.cs @@ -49,6 +49,14 @@ namespace DatabaseCore modelBuilder.Entity().HasIndex(d => new { d.FirstName, d.LastName, d.Patronymic }).IsUnique(); modelBuilder.Entity().HasIndex(d => new { d.Title, d.Profile }).IsUnique(); + + modelBuilder.Entity().HasIndex(d => new { d.TimeNormName, d.TimeNormShortName }).IsUnique(); + + modelBuilder.Entity().HasIndex(d => new { d.EducationDirectionId, d.YearEntrance }).IsUnique(); + + modelBuilder.Entity().HasIndex(d => new { d.AcademicPlanId, d.DisciplineId, d.Semester }).IsUnique(); + + modelBuilder.Entity().HasIndex(d => new { d.AcademicPlanRecordId, d.TimeNormId }).IsUnique(); } #region Security @@ -71,6 +79,10 @@ namespace DatabaseCore public virtual DbSet LecturerPosts { set; get; } public virtual DbSet Lecturers { set; get; } public virtual DbSet EducationDirections { set; get; } + public virtual DbSet TimeNorms { set; get; } + public virtual DbSet AcademicPlans { set; get; } + public virtual DbSet AcademicPlanRecords { set; get; } + public virtual DbSet AcademicPlanRecordTimeNormHours { set; get; } #endregion } } \ No newline at end of file diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210405171658_AddAcademicPlans.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210405171658_AddAcademicPlans.Designer.cs new file mode 100644 index 0000000..271e464 --- /dev/null +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210405171658_AddAcademicPlans.Designer.cs @@ -0,0 +1,1131 @@ +// +using System; +using DatabaseCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +namespace DatabaseCore.Migrations +{ + [DbContext(typeof(DatabaseContext))] + [Migration("20210405171658_AddAcademicPlans")] + partial class AddAcademicPlans + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("ProductVersion", "5.0.4") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EducationDirectionId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("YearEntrance") + .HasColumnType("datetime2"); + + b.Property("YearFinish") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.HasIndex("EducationDirectionId", "YearEntrance") + .IsUnique(); + + b.ToTable("AcademicPlans"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanId") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineId") + .HasColumnType("uniqueidentifier"); + + b.Property("InDepartment") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsFacultative") + .HasColumnType("bit"); + + b.Property("IsParent") + .HasColumnType("bit"); + + b.Property("Semester") + .HasColumnType("int"); + + b.Property("Zet") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineId"); + + b.HasIndex("AcademicPlanId", "DisciplineId", "Semester") + .IsUnique(); + + b.ToTable("AcademicPlanRecords"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PlanHours") + .HasColumnType("decimal(18,2)"); + + b.Property("TimeNormId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("TimeNormId"); + + b.HasIndex("AcademicPlanRecordId", "TimeNormId") + .IsUnique(); + + b.ToTable("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Capacity") + .HasColumnType("int"); + + b.Property("ClassroomType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("HaveProjector") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Number") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("SecurityCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Square") + .HasColumnType("decimal(18,2)"); + + b.Property("Title") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Classrooms"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisciplineBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DisciplineShortName") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineBlockId"); + + b.HasIndex("DisciplineName") + .IsUnique(); + + b.ToTable("Disciplines"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockOrder") + .HasColumnType("int"); + + b.Property("DisciplineBlockUseForGrouping") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Title") + .IsUnique(); + + b.ToTable("DisciplineBlocks"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Cipher") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Profile") + .HasColumnType("nvarchar(450)"); + + b.Property("Qualification") + .HasColumnType("int"); + + b.Property("ShortName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("LecturerId"); + + b.HasIndex("Title", "Profile") + .IsUnique() + .HasFilter("[Profile] IS NOT NULL"); + + b.ToTable("EducationDirections"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .HasColumnType("nvarchar(450)"); + + b.Property("MobileNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.HasIndex("FirstName", "LastName", "Patronymic") + .IsUnique() + .HasFilter("[FirstName] IS NOT NULL AND [LastName] IS NOT NULL AND [Patronymic] IS NOT NULL"); + + b.ToTable("Employees"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("Rate") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("PostId"); + + b.ToTable("EmployeePosts"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .HasColumnType("nvarchar(max)"); + + b.Property("Address") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("LecturerAcademicDegreeId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerAcademicRankId") + .HasColumnType("uniqueidentifier"); + + b.Property("MobileNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OnlyForPrivate") + .HasColumnType("bit"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicDegreeId"); + + b.HasIndex("LecturerAcademicRankId"); + + b.HasIndex("UserId"); + + b.HasIndex("FirstName", "LastName", "Patronymic") + .IsUnique() + .HasFilter("[Patronymic] IS NOT NULL"); + + b.ToTable("Lecturers"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicDegreeName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicDegreeName") + .IsUnique(); + + b.ToTable("LecturerAcademicDegrees"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicRankName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicRankName") + .IsUnique(); + + b.ToTable("LecturerAcademicRanks"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("Rate") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("LecturerId"); + + b.HasIndex("PostId"); + + b.ToTable("LecturerPosts"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Hours") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("PostName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("PostName") + .IsUnique() + .HasFilter("[PostName] IS NOT NULL"); + + b.ToTable("Posts"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("KindOfLoadAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskPracticName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TimeNormEducationDirectionQualification") + .HasColumnType("int"); + + b.Property("TimeNormName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("TimeNormOrder") + .HasColumnType("int"); + + b.Property("TimeNormShortName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UseInLearningProgress") + .HasColumnType("bit"); + + b.Property("UseInSite") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineBlockId"); + + b.HasIndex("TimeNormName") + .IsUnique(); + + b.ToTable("TimeNorms"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RoleName") + .IsUnique(); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserName"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + { + b.HasOne("DatabaseCore.Models.Department.EducationDirection", "EducationDirection") + .WithMany("AcademicPlans") + .HasForeignKey("EducationDirectionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EducationDirection"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + { + b.HasOne("DatabaseCore.Models.Department.AcademicPlan", "AcademicPlan") + .WithMany("AcademicPlanRecords") + .HasForeignKey("AcademicPlanId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DatabaseCore.Models.Department.Discipline", "Discipline") + .WithMany("AcademicPlanRecords") + .HasForeignKey("DisciplineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AcademicPlan"); + + b.Navigation("Discipline"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.HasOne("DatabaseCore.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("AcademicPlanRecordId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DatabaseCore.Models.Department.TimeNorm", "TimeNorm") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("TimeNormId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AcademicPlanRecord"); + + b.Navigation("TimeNorm"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + { + b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + .WithMany("Classrooms") + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Employee"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + { + b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + .WithMany("Disciplines") + .HasForeignKey("DisciplineBlockId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineBlock"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + { + b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + .WithMany("EducationDirections") + .HasForeignKey("LecturerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Lecturer"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + { + b.HasOne("DatabaseCore.Models.Security.User", "User") + .WithMany("Employees") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + { + b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + .WithMany("EmployeePosts") + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DatabaseCore.Models.Department.Post", "Post") + .WithMany("EmployeePosts") + .HasForeignKey("PostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Employee"); + + b.Navigation("Post"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + { + b.HasOne("DatabaseCore.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") + .WithMany("Lecturers") + .HasForeignKey("LecturerAcademicDegreeId"); + + b.HasOne("DatabaseCore.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") + .WithMany("Lecturers") + .HasForeignKey("LecturerAcademicRankId"); + + b.HasOne("DatabaseCore.Models.Security.User", "User") + .WithMany("Lecturers") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("LecturerAcademicDegree"); + + b.Navigation("LecturerAcademicRank"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + { + b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + .WithMany("LecturerPosts") + .HasForeignKey("LecturerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DatabaseCore.Models.Department.Post", "Post") + .WithMany("LecturerPosts") + .HasForeignKey("PostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Lecturer"); + + b.Navigation("Post"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + { + b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + .WithMany("TimeNorms") + .HasForeignKey("DisciplineBlockId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineBlock"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + { + b.HasOne("DatabaseCore.Models.Security.Role", "Role") + .WithMany("Access") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + { + b.HasOne("DatabaseCore.Models.Security.Role", "Role") + .WithMany("UserRoles") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DatabaseCore.Models.Security.User", "User") + .WithMany("UserRoles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + { + b.Navigation("AcademicPlanRecords"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + { + b.Navigation("AcademicPlanRecords"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + { + b.Navigation("Disciplines"); + + b.Navigation("TimeNorms"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + { + b.Navigation("AcademicPlans"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + { + b.Navigation("Classrooms"); + + b.Navigation("EmployeePosts"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + { + b.Navigation("EducationDirections"); + + b.Navigation("LecturerPosts"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + { + b.Navigation("Lecturers"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + { + b.Navigation("Lecturers"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + { + b.Navigation("EmployeePosts"); + + b.Navigation("LecturerPosts"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + { + b.Navigation("Access"); + + b.Navigation("UserRoles"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + { + b.Navigation("Employees"); + + b.Navigation("Lecturers"); + + b.Navigation("UserRoles"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210405171658_AddAcademicPlans.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210405171658_AddAcademicPlans.cs new file mode 100644 index 0000000..c7352a3 --- /dev/null +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210405171658_AddAcademicPlans.cs @@ -0,0 +1,183 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace DatabaseCore.Migrations +{ + public partial class AddAcademicPlans : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "AcademicPlans", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + EducationDirectionId = table.Column(type: "uniqueidentifier", nullable: false), + YearEntrance = table.Column(type: "datetime2", nullable: false), + YearFinish = table.Column(type: "datetime2", nullable: false), + DateCreate = table.Column(type: "datetime2", nullable: false), + DateDelete = table.Column(type: "datetime2", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AcademicPlans", x => x.Id); + table.ForeignKey( + name: "FK_AcademicPlans_EducationDirections_EducationDirectionId", + column: x => x.EducationDirectionId, + principalTable: "EducationDirections", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "TimeNorms", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + DisciplineBlockId = table.Column(type: "uniqueidentifier", nullable: false), + TimeNormName = table.Column(type: "nvarchar(450)", nullable: false), + TimeNormShortName = table.Column(type: "nvarchar(max)", nullable: false), + TimeNormOrder = table.Column(type: "int", nullable: false), + TimeNormEducationDirectionQualification = table.Column(type: "int", nullable: true), + KindOfLoadName = table.Column(type: "nvarchar(max)", nullable: false), + KindOfLoadAttributeName = table.Column(type: "nvarchar(max)", nullable: true), + KindOfLoadBlueAsteriskName = table.Column(type: "nvarchar(max)", nullable: true), + KindOfLoadBlueAsteriskAttributeName = table.Column(type: "nvarchar(max)", nullable: true), + KindOfLoadBlueAsteriskPracticName = table.Column(type: "nvarchar(max)", nullable: true), + UseInLearningProgress = table.Column(type: "bit", nullable: false), + UseInSite = table.Column(type: "bit", nullable: false), + DateCreate = table.Column(type: "datetime2", nullable: false), + DateDelete = table.Column(type: "datetime2", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_TimeNorms", x => x.Id); + table.ForeignKey( + name: "FK_TimeNorms_DisciplineBlocks_DisciplineBlockId", + column: x => x.DisciplineBlockId, + principalTable: "DisciplineBlocks", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AcademicPlanRecords", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + AcademicPlanId = table.Column(type: "uniqueidentifier", nullable: false), + DisciplineId = table.Column(type: "uniqueidentifier", nullable: false), + InDepartment = table.Column(type: "bit", nullable: false), + Semester = table.Column(type: "int", nullable: false), + Zet = table.Column(type: "int", nullable: false), + AcademicPlanRecordParentId = table.Column(type: "uniqueidentifier", nullable: true), + IsParent = table.Column(type: "bit", nullable: false), + IsFacultative = table.Column(type: "bit", nullable: false), + DateCreate = table.Column(type: "datetime2", nullable: false), + DateDelete = table.Column(type: "datetime2", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AcademicPlanRecords", x => x.Id); + table.ForeignKey( + name: "FK_AcademicPlanRecords_AcademicPlans_AcademicPlanId", + column: x => x.AcademicPlanId, + principalTable: "AcademicPlans", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_AcademicPlanRecords_Disciplines_DisciplineId", + column: x => x.DisciplineId, + principalTable: "Disciplines", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AcademicPlanRecordTimeNormHours", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + AcademicPlanRecordId = table.Column(type: "uniqueidentifier", nullable: false), + TimeNormId = table.Column(type: "uniqueidentifier", nullable: false), + PlanHours = table.Column(type: "decimal(18,2)", nullable: false), + DateCreate = table.Column(type: "datetime2", nullable: false), + DateDelete = table.Column(type: "datetime2", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AcademicPlanRecordTimeNormHours", x => x.Id); + table.ForeignKey( + name: "FK_AcademicPlanRecordTimeNormHours_AcademicPlanRecords_AcademicPlanRecordId", + column: x => x.AcademicPlanRecordId, + principalTable: "AcademicPlanRecords", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_AcademicPlanRecordTimeNormHours_TimeNorms_TimeNormId", + column: x => x.TimeNormId, + principalTable: "TimeNorms", + principalColumn: "Id", + onDelete: ReferentialAction.NoAction); + }); + + migrationBuilder.CreateIndex( + name: "IX_AcademicPlanRecords_AcademicPlanId_DisciplineId_Semester", + table: "AcademicPlanRecords", + columns: new[] { "AcademicPlanId", "DisciplineId", "Semester" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AcademicPlanRecords_DisciplineId", + table: "AcademicPlanRecords", + column: "DisciplineId"); + + migrationBuilder.CreateIndex( + name: "IX_AcademicPlanRecordTimeNormHours_AcademicPlanRecordId_TimeNormId", + table: "AcademicPlanRecordTimeNormHours", + columns: new[] { "AcademicPlanRecordId", "TimeNormId" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AcademicPlanRecordTimeNormHours_TimeNormId", + table: "AcademicPlanRecordTimeNormHours", + column: "TimeNormId"); + + migrationBuilder.CreateIndex( + name: "IX_AcademicPlans_EducationDirectionId_YearEntrance", + table: "AcademicPlans", + columns: new[] { "EducationDirectionId", "YearEntrance" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_TimeNorms_DisciplineBlockId", + table: "TimeNorms", + column: "DisciplineBlockId"); + + migrationBuilder.CreateIndex( + name: "IX_TimeNorms_TimeNormName", + table: "TimeNorms", + column: "TimeNormName", + unique: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AcademicPlanRecordTimeNormHours"); + + migrationBuilder.DropTable( + name: "AcademicPlanRecords"); + + migrationBuilder.DropTable( + name: "TimeNorms"); + + migrationBuilder.DropTable( + name: "AcademicPlans"); + } + } +} diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210406063922_UpdUniqueTimeNorm.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210406063922_UpdUniqueTimeNorm.Designer.cs new file mode 100644 index 0000000..0e97935 --- /dev/null +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210406063922_UpdUniqueTimeNorm.Designer.cs @@ -0,0 +1,1131 @@ +// +using System; +using DatabaseCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +namespace DatabaseCore.Migrations +{ + [DbContext(typeof(DatabaseContext))] + [Migration("20210406063922_UpdUniqueTimeNorm")] + partial class UpdUniqueTimeNorm + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("ProductVersion", "5.0.4") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EducationDirectionId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("YearEntrance") + .HasColumnType("datetime2"); + + b.Property("YearFinish") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.HasIndex("EducationDirectionId", "YearEntrance") + .IsUnique(); + + b.ToTable("AcademicPlans"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanId") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineId") + .HasColumnType("uniqueidentifier"); + + b.Property("InDepartment") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsFacultative") + .HasColumnType("bit"); + + b.Property("IsParent") + .HasColumnType("bit"); + + b.Property("Semester") + .HasColumnType("int"); + + b.Property("Zet") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineId"); + + b.HasIndex("AcademicPlanId", "DisciplineId", "Semester") + .IsUnique(); + + b.ToTable("AcademicPlanRecords"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PlanHours") + .HasColumnType("decimal(18,2)"); + + b.Property("TimeNormId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("TimeNormId"); + + b.HasIndex("AcademicPlanRecordId", "TimeNormId") + .IsUnique(); + + b.ToTable("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Capacity") + .HasColumnType("int"); + + b.Property("ClassroomType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("HaveProjector") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Number") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("SecurityCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Square") + .HasColumnType("decimal(18,2)"); + + b.Property("Title") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Classrooms"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisciplineBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DisciplineShortName") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineBlockId"); + + b.HasIndex("DisciplineName") + .IsUnique(); + + b.ToTable("Disciplines"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockOrder") + .HasColumnType("int"); + + b.Property("DisciplineBlockUseForGrouping") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Title") + .IsUnique(); + + b.ToTable("DisciplineBlocks"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Cipher") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Profile") + .HasColumnType("nvarchar(450)"); + + b.Property("Qualification") + .HasColumnType("int"); + + b.Property("ShortName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("LecturerId"); + + b.HasIndex("Title", "Profile") + .IsUnique() + .HasFilter("[Profile] IS NOT NULL"); + + b.ToTable("EducationDirections"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .HasColumnType("nvarchar(450)"); + + b.Property("MobileNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.HasIndex("FirstName", "LastName", "Patronymic") + .IsUnique() + .HasFilter("[FirstName] IS NOT NULL AND [LastName] IS NOT NULL AND [Patronymic] IS NOT NULL"); + + b.ToTable("Employees"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("Rate") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("PostId"); + + b.ToTable("EmployeePosts"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .HasColumnType("nvarchar(max)"); + + b.Property("Address") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("LecturerAcademicDegreeId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerAcademicRankId") + .HasColumnType("uniqueidentifier"); + + b.Property("MobileNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OnlyForPrivate") + .HasColumnType("bit"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicDegreeId"); + + b.HasIndex("LecturerAcademicRankId"); + + b.HasIndex("UserId"); + + b.HasIndex("FirstName", "LastName", "Patronymic") + .IsUnique() + .HasFilter("[Patronymic] IS NOT NULL"); + + b.ToTable("Lecturers"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicDegreeName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicDegreeName") + .IsUnique(); + + b.ToTable("LecturerAcademicDegrees"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicRankName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicRankName") + .IsUnique(); + + b.ToTable("LecturerAcademicRanks"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("Rate") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("LecturerId"); + + b.HasIndex("PostId"); + + b.ToTable("LecturerPosts"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Hours") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("PostName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("PostName") + .IsUnique() + .HasFilter("[PostName] IS NOT NULL"); + + b.ToTable("Posts"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("KindOfLoadAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskPracticName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TimeNormEducationDirectionQualification") + .HasColumnType("int"); + + b.Property("TimeNormName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("TimeNormOrder") + .HasColumnType("int"); + + b.Property("TimeNormShortName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("UseInLearningProgress") + .HasColumnType("bit"); + + b.Property("UseInSite") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineBlockId"); + + b.HasIndex("TimeNormName", "TimeNormShortName") + .IsUnique(); + + b.ToTable("TimeNorms"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RoleName") + .IsUnique(); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserName"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + { + b.HasOne("DatabaseCore.Models.Department.EducationDirection", "EducationDirection") + .WithMany("AcademicPlans") + .HasForeignKey("EducationDirectionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EducationDirection"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + { + b.HasOne("DatabaseCore.Models.Department.AcademicPlan", "AcademicPlan") + .WithMany("AcademicPlanRecords") + .HasForeignKey("AcademicPlanId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DatabaseCore.Models.Department.Discipline", "Discipline") + .WithMany("AcademicPlanRecords") + .HasForeignKey("DisciplineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AcademicPlan"); + + b.Navigation("Discipline"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.HasOne("DatabaseCore.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("AcademicPlanRecordId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DatabaseCore.Models.Department.TimeNorm", "TimeNorm") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("TimeNormId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AcademicPlanRecord"); + + b.Navigation("TimeNorm"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + { + b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + .WithMany("Classrooms") + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Employee"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + { + b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + .WithMany("Disciplines") + .HasForeignKey("DisciplineBlockId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineBlock"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + { + b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + .WithMany("EducationDirections") + .HasForeignKey("LecturerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Lecturer"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + { + b.HasOne("DatabaseCore.Models.Security.User", "User") + .WithMany("Employees") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + { + b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + .WithMany("EmployeePosts") + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DatabaseCore.Models.Department.Post", "Post") + .WithMany("EmployeePosts") + .HasForeignKey("PostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Employee"); + + b.Navigation("Post"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + { + b.HasOne("DatabaseCore.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") + .WithMany("Lecturers") + .HasForeignKey("LecturerAcademicDegreeId"); + + b.HasOne("DatabaseCore.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") + .WithMany("Lecturers") + .HasForeignKey("LecturerAcademicRankId"); + + b.HasOne("DatabaseCore.Models.Security.User", "User") + .WithMany("Lecturers") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("LecturerAcademicDegree"); + + b.Navigation("LecturerAcademicRank"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + { + b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + .WithMany("LecturerPosts") + .HasForeignKey("LecturerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DatabaseCore.Models.Department.Post", "Post") + .WithMany("LecturerPosts") + .HasForeignKey("PostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Lecturer"); + + b.Navigation("Post"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + { + b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + .WithMany("TimeNorms") + .HasForeignKey("DisciplineBlockId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineBlock"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + { + b.HasOne("DatabaseCore.Models.Security.Role", "Role") + .WithMany("Access") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + { + b.HasOne("DatabaseCore.Models.Security.Role", "Role") + .WithMany("UserRoles") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DatabaseCore.Models.Security.User", "User") + .WithMany("UserRoles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + { + b.Navigation("AcademicPlanRecords"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + { + b.Navigation("AcademicPlanRecords"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + { + b.Navigation("Disciplines"); + + b.Navigation("TimeNorms"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + { + b.Navigation("AcademicPlans"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + { + b.Navigation("Classrooms"); + + b.Navigation("EmployeePosts"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + { + b.Navigation("EducationDirections"); + + b.Navigation("LecturerPosts"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + { + b.Navigation("Lecturers"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + { + b.Navigation("Lecturers"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + { + b.Navigation("EmployeePosts"); + + b.Navigation("LecturerPosts"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + { + b.Navigation("Access"); + + b.Navigation("UserRoles"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + { + b.Navigation("Employees"); + + b.Navigation("Lecturers"); + + b.Navigation("UserRoles"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210406063922_UpdUniqueTimeNorm.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210406063922_UpdUniqueTimeNorm.cs new file mode 100644 index 0000000..2a12c3b --- /dev/null +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210406063922_UpdUniqueTimeNorm.cs @@ -0,0 +1,72 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace DatabaseCore.Migrations +{ + public partial class UpdUniqueTimeNorm : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_AcademicPlanRecordTimeNormHours_TimeNorms_TimeNormId", + table: "AcademicPlanRecordTimeNormHours"); + + migrationBuilder.DropIndex( + name: "IX_TimeNorms_TimeNormName", + table: "TimeNorms"); + + migrationBuilder.AlterColumn( + name: "TimeNormShortName", + table: "TimeNorms", + type: "nvarchar(450)", + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(max)"); + + migrationBuilder.CreateIndex( + name: "IX_TimeNorms_TimeNormName_TimeNormShortName", + table: "TimeNorms", + columns: new[] { "TimeNormName", "TimeNormShortName" }, + unique: true); + + migrationBuilder.AddForeignKey( + name: "FK_AcademicPlanRecordTimeNormHours_TimeNorms_TimeNormId", + table: "AcademicPlanRecordTimeNormHours", + column: "TimeNormId", + principalTable: "TimeNorms", + principalColumn: "Id", + onDelete: ReferentialAction.NoAction); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_AcademicPlanRecordTimeNormHours_TimeNorms_TimeNormId", + table: "AcademicPlanRecordTimeNormHours"); + + migrationBuilder.DropIndex( + name: "IX_TimeNorms_TimeNormName_TimeNormShortName", + table: "TimeNorms"); + + migrationBuilder.AlterColumn( + name: "TimeNormShortName", + table: "TimeNorms", + type: "nvarchar(max)", + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(450)"); + + migrationBuilder.CreateIndex( + name: "IX_TimeNorms_TimeNormName", + table: "TimeNorms", + column: "TimeNormName", + unique: true); + + migrationBuilder.AddForeignKey( + name: "FK_AcademicPlanRecordTimeNormHours_TimeNorms_TimeNormId", + table: "AcademicPlanRecordTimeNormHours", + column: "TimeNormId", + principalTable: "TimeNorms", + principalColumn: "Id"); + } + } +} diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210406064319_ChangeTypeInacademicPlan.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210406064319_ChangeTypeInacademicPlan.Designer.cs new file mode 100644 index 0000000..656cad2 --- /dev/null +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210406064319_ChangeTypeInacademicPlan.Designer.cs @@ -0,0 +1,1131 @@ +// +using System; +using DatabaseCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +namespace DatabaseCore.Migrations +{ + [DbContext(typeof(DatabaseContext))] + [Migration("20210406064319_ChangeTypeInacademicPlan")] + partial class ChangeTypeInacademicPlan + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("ProductVersion", "5.0.4") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EducationDirectionId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("YearEntrance") + .HasColumnType("int"); + + b.Property("YearFinish") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("EducationDirectionId", "YearEntrance") + .IsUnique(); + + b.ToTable("AcademicPlans"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanId") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineId") + .HasColumnType("uniqueidentifier"); + + b.Property("InDepartment") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsFacultative") + .HasColumnType("bit"); + + b.Property("IsParent") + .HasColumnType("bit"); + + b.Property("Semester") + .HasColumnType("int"); + + b.Property("Zet") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineId"); + + b.HasIndex("AcademicPlanId", "DisciplineId", "Semester") + .IsUnique(); + + b.ToTable("AcademicPlanRecords"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PlanHours") + .HasColumnType("decimal(18,2)"); + + b.Property("TimeNormId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("TimeNormId"); + + b.HasIndex("AcademicPlanRecordId", "TimeNormId") + .IsUnique(); + + b.ToTable("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Capacity") + .HasColumnType("int"); + + b.Property("ClassroomType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("HaveProjector") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Number") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("SecurityCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Square") + .HasColumnType("decimal(18,2)"); + + b.Property("Title") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Classrooms"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisciplineBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("DisciplineShortName") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineBlockId"); + + b.HasIndex("DisciplineName") + .IsUnique(); + + b.ToTable("Disciplines"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisciplineBlockOrder") + .HasColumnType("int"); + + b.Property("DisciplineBlockUseForGrouping") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Title") + .IsUnique(); + + b.ToTable("DisciplineBlocks"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Cipher") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Profile") + .HasColumnType("nvarchar(450)"); + + b.Property("Qualification") + .HasColumnType("int"); + + b.Property("ShortName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Title") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("LecturerId"); + + b.HasIndex("Title", "Profile") + .IsUnique() + .HasFilter("[Profile] IS NOT NULL"); + + b.ToTable("EducationDirections"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .HasColumnType("nvarchar(450)"); + + b.Property("MobileNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.HasIndex("FirstName", "LastName", "Patronymic") + .IsUnique() + .HasFilter("[FirstName] IS NOT NULL AND [LastName] IS NOT NULL AND [Patronymic] IS NOT NULL"); + + b.ToTable("Employees"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("Rate") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("PostId"); + + b.ToTable("EmployeePosts"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Abbreviation") + .HasColumnType("nvarchar(max)"); + + b.Property("Address") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateBirth") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("GroupElectricalSafety") + .HasColumnType("nvarchar(max)"); + + b.Property("HomeNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("LecturerAcademicDegreeId") + .HasColumnType("uniqueidentifier"); + + b.Property("LecturerAcademicRankId") + .HasColumnType("uniqueidentifier"); + + b.Property("MobileNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OnlyForPrivate") + .HasColumnType("bit"); + + b.Property("Patronymic") + .HasColumnType("nvarchar(450)"); + + b.Property("Photo") + .HasColumnType("varbinary(max)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicDegreeId"); + + b.HasIndex("LecturerAcademicRankId"); + + b.HasIndex("UserId"); + + b.HasIndex("FirstName", "LastName", "Patronymic") + .IsUnique() + .HasFilter("[Patronymic] IS NOT NULL"); + + b.ToTable("Lecturers"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicDegreeName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicDegreeName") + .IsUnique(); + + b.ToTable("LecturerAcademicDegrees"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerAcademicRankName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Order") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LecturerAcademicRankName") + .IsUnique(); + + b.ToTable("LecturerAcademicRanks"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsExternalCombination") + .HasColumnType("bit"); + + b.Property("IsInternalCombination") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostId") + .HasColumnType("uniqueidentifier"); + + b.Property("Rate") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("LecturerId"); + + b.HasIndex("PostId"); + + b.ToTable("LecturerPosts"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Hours") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("PostName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("PostName") + .IsUnique() + .HasFilter("[PostName] IS NOT NULL"); + + b.ToTable("Posts"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("KindOfLoadAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskPracticName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TimeNormEducationDirectionQualification") + .HasColumnType("int"); + + b.Property("TimeNormName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("TimeNormOrder") + .HasColumnType("int"); + + b.Property("TimeNormShortName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("UseInLearningProgress") + .HasColumnType("bit"); + + b.Property("UseInSite") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineBlockId"); + + b.HasIndex("TimeNormName", "TimeNormShortName") + .IsUnique(); + + b.ToTable("TimeNorms"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AccessOperation") + .HasColumnType("int"); + + b.Property("AccessType") + .HasColumnType("int"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("Accesses"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Key") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("EnviromentSettings"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("RolePriority") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RoleName") + .IsUnique(); + + b.ToTable("Roles"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Avatar") + .HasColumnType("varbinary(max)"); + + b.Property("CountAttempt") + .HasColumnType("int"); + + b.Property("DateBanned") + .HasColumnType("datetime2"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DateLastVisit") + .HasColumnType("datetime2"); + + b.Property("IsBanned") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserName"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserId"); + + b.ToTable("UserRoles"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + { + b.HasOne("DatabaseCore.Models.Department.EducationDirection", "EducationDirection") + .WithMany("AcademicPlans") + .HasForeignKey("EducationDirectionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EducationDirection"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + { + b.HasOne("DatabaseCore.Models.Department.AcademicPlan", "AcademicPlan") + .WithMany("AcademicPlanRecords") + .HasForeignKey("AcademicPlanId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DatabaseCore.Models.Department.Discipline", "Discipline") + .WithMany("AcademicPlanRecords") + .HasForeignKey("DisciplineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AcademicPlan"); + + b.Navigation("Discipline"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.HasOne("DatabaseCore.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("AcademicPlanRecordId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DatabaseCore.Models.Department.TimeNorm", "TimeNorm") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("TimeNormId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AcademicPlanRecord"); + + b.Navigation("TimeNorm"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => + { + b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + .WithMany("Classrooms") + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Employee"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + { + b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + .WithMany("Disciplines") + .HasForeignKey("DisciplineBlockId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineBlock"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + { + b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + .WithMany("EducationDirections") + .HasForeignKey("LecturerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Lecturer"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + { + b.HasOne("DatabaseCore.Models.Security.User", "User") + .WithMany("Employees") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.EmployeePost", b => + { + b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") + .WithMany("EmployeePosts") + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DatabaseCore.Models.Department.Post", "Post") + .WithMany("EmployeePosts") + .HasForeignKey("PostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Employee"); + + b.Navigation("Post"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + { + b.HasOne("DatabaseCore.Models.Department.LecturerAcademicDegree", "LecturerAcademicDegree") + .WithMany("Lecturers") + .HasForeignKey("LecturerAcademicDegreeId"); + + b.HasOne("DatabaseCore.Models.Department.LecturerAcademicRank", "LecturerAcademicRank") + .WithMany("Lecturers") + .HasForeignKey("LecturerAcademicRankId"); + + b.HasOne("DatabaseCore.Models.Security.User", "User") + .WithMany("Lecturers") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("LecturerAcademicDegree"); + + b.Navigation("LecturerAcademicRank"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.LecturerPost", b => + { + b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + .WithMany("LecturerPosts") + .HasForeignKey("LecturerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DatabaseCore.Models.Department.Post", "Post") + .WithMany("LecturerPosts") + .HasForeignKey("PostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Lecturer"); + + b.Navigation("Post"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + { + b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + .WithMany("TimeNorms") + .HasForeignKey("DisciplineBlockId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineBlock"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => + { + b.HasOne("DatabaseCore.Models.Security.Role", "Role") + .WithMany("Access") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b => + { + b.HasOne("DatabaseCore.Models.Security.Role", "Role") + .WithMany("UserRoles") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DatabaseCore.Models.Security.User", "User") + .WithMany("UserRoles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + { + b.Navigation("AcademicPlanRecords"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + { + b.Navigation("AcademicPlanRecords"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => + { + b.Navigation("Disciplines"); + + b.Navigation("TimeNorms"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + { + b.Navigation("AcademicPlans"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => + { + b.Navigation("Classrooms"); + + b.Navigation("EmployeePosts"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Lecturer", b => + { + b.Navigation("EducationDirections"); + + b.Navigation("LecturerPosts"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => + { + b.Navigation("Lecturers"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicRank", b => + { + b.Navigation("Lecturers"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Post", b => + { + b.Navigation("EmployeePosts"); + + b.Navigation("LecturerPosts"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => + { + b.Navigation("Access"); + + b.Navigation("UserRoles"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Security.User", b => + { + b.Navigation("Employees"); + + b.Navigation("Lecturers"); + + b.Navigation("UserRoles"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210406064319_ChangeTypeInacademicPlan.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210406064319_ChangeTypeInacademicPlan.cs new file mode 100644 index 0000000..da23bdf --- /dev/null +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210406064319_ChangeTypeInacademicPlan.cs @@ -0,0 +1,101 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace DatabaseCore.Migrations +{ + public partial class ChangeTypeInacademicPlan : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_AcademicPlanRecordTimeNormHours_TimeNorms_TimeNormId", + table: "AcademicPlanRecordTimeNormHours"); + + migrationBuilder.DropIndex( + name: "IX_AcademicPlans_EducationDirectionId_YearEntrance", + table: "AcademicPlans"); + + migrationBuilder.DropColumn( + name: "YearFinish", + table: "AcademicPlans"); + + migrationBuilder.DropColumn( + name: "YearEntrance", + table: "AcademicPlans"); + + migrationBuilder.AddColumn( + name: "YearFinish", + table: "AcademicPlans", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "YearEntrance", + table: "AcademicPlans", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddForeignKey( + name: "FK_AcademicPlanRecordTimeNormHours_TimeNorms_TimeNormId", + table: "AcademicPlanRecordTimeNormHours", + column: "TimeNormId", + principalTable: "TimeNorms", + principalColumn: "Id", + onDelete: ReferentialAction.NoAction); + + migrationBuilder.CreateIndex( + name: "IX_AcademicPlans_EducationDirectionId_YearEntrance", + table: "AcademicPlans", + columns: new[] { "EducationDirectionId", "YearEntrance" }, + unique: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_AcademicPlanRecordTimeNormHours_TimeNorms_TimeNormId", + table: "AcademicPlanRecordTimeNormHours"); + + migrationBuilder.DropIndex( + name: "IX_AcademicPlans_EducationDirectionId_YearEntrance", + table: "AcademicPlans"); + + migrationBuilder.DropColumn( + name: "YearFinish", + table: "AcademicPlans"); + + migrationBuilder.DropColumn( + name: "YearEntrance", + table: "AcademicPlans"); + + migrationBuilder.AddColumn( + name: "YearEntrance", + table: "AcademicPlans", + type: "datetime2", + nullable: false, + defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + + migrationBuilder.AddColumn( + name: "YearFinish", + table: "AcademicPlans", + type: "datetime2", + nullable: false, + defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + + migrationBuilder.AddForeignKey( + name: "FK_AcademicPlanRecordTimeNormHours_TimeNorms_TimeNormId", + table: "AcademicPlanRecordTimeNormHours", + column: "TimeNormId", + principalTable: "TimeNorms", + principalColumn: "Id"); + + migrationBuilder.CreateIndex( + name: "IX_AcademicPlans_EducationDirectionId_YearEntrance", + table: "AcademicPlans", + columns: new[] { "EducationDirectionId", "YearEntrance" }, + unique: true); + } + } +} diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/DatabaseContextModelSnapshot.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/DatabaseContextModelSnapshot.cs index 39f957f..4c24bb4 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/DatabaseContextModelSnapshot.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/DatabaseContextModelSnapshot.cs @@ -19,6 +19,118 @@ namespace DatabaseCore.Migrations .HasAnnotation("ProductVersion", "5.0.4") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EducationDirectionId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("YearEntrance") + .HasColumnType("int"); + + b.Property("YearFinish") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("EducationDirectionId", "YearEntrance") + .IsUnique(); + + b.ToTable("AcademicPlans"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanId") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineId") + .HasColumnType("uniqueidentifier"); + + b.Property("InDepartment") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsFacultative") + .HasColumnType("bit"); + + b.Property("IsParent") + .HasColumnType("bit"); + + b.Property("Semester") + .HasColumnType("int"); + + b.Property("Zet") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineId"); + + b.HasIndex("AcademicPlanId", "DisciplineId", "Semester") + .IsUnique(); + + b.ToTable("AcademicPlanRecords"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanRecordId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("PlanHours") + .HasColumnType("decimal(18,2)"); + + b.Property("TimeNormId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("TimeNormId"); + + b.HasIndex("AcademicPlanRecordId", "TimeNormId") + .IsUnique(); + + b.ToTable("AcademicPlanRecordTimeNormHours"); + }); + modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => { b.Property("Id") @@ -510,6 +622,69 @@ namespace DatabaseCore.Migrations b.ToTable("Posts"); }); + modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("DisciplineBlockId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("KindOfLoadAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskAttributeName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadBlueAsteriskPracticName") + .HasColumnType("nvarchar(max)"); + + b.Property("KindOfLoadName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TimeNormEducationDirectionQualification") + .HasColumnType("int"); + + b.Property("TimeNormName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("TimeNormOrder") + .HasColumnType("int"); + + b.Property("TimeNormShortName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("UseInLearningProgress") + .HasColumnType("bit"); + + b.Property("UseInSite") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("DisciplineBlockId"); + + b.HasIndex("TimeNormName", "TimeNormShortName") + .IsUnique(); + + b.ToTable("TimeNorms"); + }); + modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => { b.Property("Id") @@ -675,6 +850,55 @@ namespace DatabaseCore.Migrations b.ToTable("UserRoles"); }); + modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + { + b.HasOne("DatabaseCore.Models.Department.EducationDirection", "EducationDirection") + .WithMany("AcademicPlans") + .HasForeignKey("EducationDirectionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EducationDirection"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + { + b.HasOne("DatabaseCore.Models.Department.AcademicPlan", "AcademicPlan") + .WithMany("AcademicPlanRecords") + .HasForeignKey("AcademicPlanId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DatabaseCore.Models.Department.Discipline", "Discipline") + .WithMany("AcademicPlanRecords") + .HasForeignKey("DisciplineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AcademicPlan"); + + b.Navigation("Discipline"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecordTimeNormHour", b => + { + b.HasOne("DatabaseCore.Models.Department.AcademicPlanRecord", "AcademicPlanRecord") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("AcademicPlanRecordId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DatabaseCore.Models.Department.TimeNorm", "TimeNorm") + .WithMany("AcademicPlanRecordTimeNormHours") + .HasForeignKey("TimeNormId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("AcademicPlanRecord"); + + b.Navigation("TimeNorm"); + }); + modelBuilder.Entity("DatabaseCore.Models.Department.Classroom", b => { b.HasOne("DatabaseCore.Models.Department.Employee", "Employee") @@ -780,6 +1004,17 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); + modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + { + b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") + .WithMany("TimeNorms") + .HasForeignKey("DisciplineBlockId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DisciplineBlock"); + }); + modelBuilder.Entity("DatabaseCore.Models.Security.Access", b => { b.HasOne("DatabaseCore.Models.Security.Role", "Role") @@ -810,9 +1045,31 @@ namespace DatabaseCore.Migrations b.Navigation("User"); }); + modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => + { + b.Navigation("AcademicPlanRecords"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.Discipline", b => + { + b.Navigation("AcademicPlanRecords"); + }); + modelBuilder.Entity("DatabaseCore.Models.Department.DisciplineBlock", b => { b.Navigation("Disciplines"); + + b.Navigation("TimeNorms"); + }); + + modelBuilder.Entity("DatabaseCore.Models.Department.EducationDirection", b => + { + b.Navigation("AcademicPlans"); }); modelBuilder.Entity("DatabaseCore.Models.Department.Employee", b => @@ -846,6 +1103,11 @@ namespace DatabaseCore.Migrations b.Navigation("LecturerPosts"); }); + modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => + { + b.Navigation("AcademicPlanRecordTimeNormHours"); + }); + modelBuilder.Entity("DatabaseCore.Models.Security.Role", b => { b.Navigation("Access"); diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/AcademicPlan.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/AcademicPlan.cs new file mode 100644 index 0000000..da721d5 --- /dev/null +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/AcademicPlan.cs @@ -0,0 +1,47 @@ +using ModuleTools.Attributes; +using ModuleTools.Interfaces; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +namespace DatabaseCore.Models.Department +{ + /// + /// Класс, описывающий учебный план кафедры + /// + [DataContract] + [EntityDescription("AcademicPlan", "Учебный план кафедры")] + [EntityDependency("EducationDirection", "EducationDirectionId", "Направление, к которму относится учебный план")] + public class AcademicPlan : BaseEntity, IEntitySecurityExtenstion + { + [DataMember] + [Required(ErrorMessage = "required")] + [MapConfiguration("EducationDirectionId")] + public Guid EducationDirectionId { get; set; } + + [DataMember] + [Required(ErrorMessage = "required")] + [MapConfiguration("YearEntrance")] + public int YearEntrance { get; set; } + + [DataMember] + [Required(ErrorMessage = "required")] + [MapConfiguration("YearFinish")] + public int YearFinish { get; set; } + + //------------------------------------------------------------------------- + + public virtual EducationDirection EducationDirection { get; set; } + + //------------------------------------------------------------------------- + + [ForeignKey("AcademicPlanId")] + public virtual List AcademicPlanRecords { get; set; } + + //------------------------------------------------------------------------- + + public AcademicPlan SecurityCheck(AcademicPlan entity, bool allowFullData) => entity; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/AcademicPlanRecord.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/AcademicPlanRecord.cs new file mode 100644 index 0000000..50086fd --- /dev/null +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/AcademicPlanRecord.cs @@ -0,0 +1,72 @@ +using ModuleTools.Attributes; +using ModuleTools.Interfaces; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +namespace DatabaseCore.Models.Department +{ + /// + /// Класс, описывающий запись учебного плана кафедры + /// + [DataContract] + [EntityDescription("AcademicPlanRecord", "Запись учебного плана кафедры")] + [EntityDependency("AcademicPlan", "AcademicPlanId", "Учебный план, к которму относится запись")] + [EntityDependency("Discipline", "DisciplineId", "Дисциплина, которая указана в записи плана")] + public class AcademicPlanRecord : BaseEntity, IEntitySecurityExtenstion + { + [DataMember] + [Required(ErrorMessage = "required")] + [MapConfiguration("AcademicPlanId")] + public Guid AcademicPlanId { get; set; } + + [DataMember] + [Required(ErrorMessage = "required")] + [MapConfiguration("DisciplineId")] + public Guid DisciplineId { get; set; } + + [DataMember] + [Required(ErrorMessage = "required")] + [MapConfiguration("InDepartment")] + public bool InDepartment { get; set; } + + [DataMember] + [Required(ErrorMessage = "required")] + [MapConfiguration("Semester")] + public int Semester { get; set; } + + [DataMember] + [Required(ErrorMessage = "required")] + [MapConfiguration("Zet")] + public int Zet { get; set; } + + [DataMember] + [MapConfiguration("AcademicPlanRecordParentId")] + public Guid? AcademicPlanRecordParentId { get; set; } + + [DataMember] + [MapConfiguration("IsParent")] + public bool IsParent { get; set; } + + [DataMember] + [MapConfiguration("IsFacultative")] + public bool IsFacultative { get; set; } + + //------------------------------------------------------------------------- + + public virtual AcademicPlan AcademicPlan { get; set; } + + public virtual Discipline Discipline { get; set; } + + //------------------------------------------------------------------------- + + [ForeignKey("AcademicPlanRecordId")] + public virtual List AcademicPlanRecordTimeNormHours { get; set; } + + //------------------------------------------------------------------------- + + public AcademicPlanRecord SecurityCheck(AcademicPlanRecord entity, bool allowFullData) => entity; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/AcademicPlanRecordTimeNormHour.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/AcademicPlanRecordTimeNormHour.cs new file mode 100644 index 0000000..c885edc --- /dev/null +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/AcademicPlanRecordTimeNormHour.cs @@ -0,0 +1,45 @@ +using ModuleTools.Attributes; +using ModuleTools.Interfaces; +using System; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; + +namespace DatabaseCore.Models.Department +{ + /// + /// Класс, описывающий часы нагрузок записей учебных планов кафедры + /// + [DataContract] + [EntityDescription("AcademicPlanRecordTimeNormHour", "Часы нагрузки записи учебного плана")] + [EntityDependency("AcademicPlanRecord", "AcademicPlanRecordId", "Запись учебного плана, к которой относятся часы")] + [EntityDependency("TimeNorm", "TimeNormId", "Норма времени, к которой относятся часы")] + public class AcademicPlanRecordTimeNormHour : BaseEntity, IEntitySecurityExtenstion + { + [DataMember] + [Required(ErrorMessage = "required")] + [MapConfiguration("AcademicPlanRecordId")] + public Guid AcademicPlanRecordId { get; set; } + + [DataMember] + [Required(ErrorMessage = "required")] + [MapConfiguration("TimeNormId")] + public Guid TimeNormId { get; set; } + + [DataMember] + [Required(ErrorMessage = "required")] + [MapConfiguration("PlanHours")] + public decimal PlanHours { get; set; } + + //------------------------------------------------------------------------- + + public virtual AcademicPlanRecord AcademicPlanRecord { get; set; } + + public virtual TimeNorm TimeNorm { get; set; } + + //------------------------------------------------------------------------- + + //------------------------------------------------------------------------- + + public AcademicPlanRecordTimeNormHour SecurityCheck(AcademicPlanRecordTimeNormHour entity, bool allowFullData) => entity; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/Discipline.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/Discipline.cs index cd95d7e..7a9b046 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Department/Discipline.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/Discipline.cs @@ -1,7 +1,9 @@ using ModuleTools.Attributes; using ModuleTools.Interfaces; using System; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; using System.Runtime.Serialization; namespace DatabaseCore.Models.Department @@ -11,7 +13,7 @@ namespace DatabaseCore.Models.Department /// [DataContract] [EntityDescription("Discipline", "Дисципилна кафедры")] - [EntityDependency("DisciplineBlock", "EmployeeId", "Сотрудник, отвечающий за аудиторию")] + [EntityDependency("DisciplineBlock", "DisciplineBlockId", "Блок дисцпилн, к которому относится дисциплина")] public class Discipline : BaseEntity, IEntitySecurityExtenstion { [DataMember] @@ -41,6 +43,9 @@ namespace DatabaseCore.Models.Department //------------------------------------------------------------------------- + [ForeignKey("DisciplineId")] + public virtual List AcademicPlanRecords { get; set; } + //------------------------------------------------------------------------- public Discipline SecurityCheck(Discipline entity, bool allowFullData) => entity; diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/DisciplineBlock.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/DisciplineBlock.cs index 3dbae0a..448ff1b 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Department/DisciplineBlock.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/DisciplineBlock.cs @@ -38,6 +38,9 @@ namespace DatabaseCore.Models.Department [ForeignKey("DisciplineBlockId")] public virtual List Disciplines { get; set; } + [ForeignKey("DisciplineBlockId")] + public virtual List TimeNorms { get; set; } + //------------------------------------------------------------------------- public DisciplineBlock SecurityCheck(DisciplineBlock entity, bool allowFullData) => entity; diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/EducationDirection.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/EducationDirection.cs index fd6e689..9cc1aae 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Department/EducationDirection.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/EducationDirection.cs @@ -1,7 +1,9 @@ using ModuleTools.Attributes; using ModuleTools.Interfaces; using System; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; using System.Runtime.Serialization; namespace DatabaseCore.Models.Department @@ -49,10 +51,13 @@ namespace DatabaseCore.Models.Department public virtual Lecturer Lecturer { get; set; } - //------------------------------------------------------------------------- + //------------------------------------------------------------------------- - //------------------------------------------------------------------------- + [ForeignKey("EducationDirectionId")] + public virtual List AcademicPlans { get; set; } - public EducationDirection SecurityCheck(EducationDirection entity, bool allowFullData) => entity; + //------------------------------------------------------------------------- + + public EducationDirection SecurityCheck(EducationDirection entity, bool allowFullData) => entity; } } \ No newline at end of file diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/TimeNorm.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/TimeNorm.cs new file mode 100644 index 0000000..978a1e0 --- /dev/null +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/TimeNorm.cs @@ -0,0 +1,85 @@ +using ModuleTools.Attributes; +using ModuleTools.Interfaces; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Runtime.Serialization; + +namespace DatabaseCore.Models.Department +{ + /// + /// Класс, описывающий норму времени + /// + [DataContract] + [EntityDescription("TimeNorm", "Норма времени")] + [EntityDependency("DisciplineBlock", "DisciplineBlockId", "Блок дисцпилн, к которому относится норма")] + public class TimeNorm : BaseEntity, IEntitySecurityExtenstion + { + [DataMember] + [Required(ErrorMessage = "required")] + [MapConfiguration("DisciplineBlockId")] + public Guid DisciplineBlockId { get; set; } + + [DataMember] + [Required(ErrorMessage = "required")] + [MapConfiguration("TimeNormName")] + public string TimeNormName { get; set; } + + [DataMember] + [Required(ErrorMessage = "required")] + [MapConfiguration("TimeNormShortName")] + public string TimeNormShortName { get; set; } + + [DataMember] + [Required(ErrorMessage = "required")] + [MapConfiguration("TimeNormOrder")] + public int TimeNormOrder { get; set; } + + [DataMember] + [MapConfiguration("TimeNormEducationDirectionQualification")] + public int? TimeNormEducationDirectionQualification { get; set; } + + [DataMember] + [Required(ErrorMessage = "required")] + [MapConfiguration("KindOfLoadName")] + public string KindOfLoadName { get; set; } + + [DataMember] + [MapConfiguration("KindOfLoadAttributeName")] + public string KindOfLoadAttributeName { get; set; } + + [DataMember] + [MapConfiguration("KindOfLoadBlueAsteriskName")] + public string KindOfLoadBlueAsteriskName { get; set; } + + [DataMember] + [MapConfiguration("KindOfLoadBlueAsteriskAttributeName")] + public string KindOfLoadBlueAsteriskAttributeName { get; set; } + + [DataMember] + [MapConfiguration("KindOfLoadBlueAsteriskPracticName")] + public string KindOfLoadBlueAsteriskPracticName { get; set; } + + [DataMember] + [MapConfiguration("UseInLearningProgress")] + public bool UseInLearningProgress { get; set; } + + [DataMember] + [MapConfiguration("UseInSite")] + public bool UseInSite { get; set; } + + //------------------------------------------------------------------------- + + public virtual DisciplineBlock DisciplineBlock { get; set; } + + //------------------------------------------------------------------------- + + [ForeignKey("TimeNormId")] + public virtual List AcademicPlanRecordTimeNormHours { get; set; } + + //------------------------------------------------------------------------- + + public TimeNorm SecurityCheck(TimeNorm entity, bool allowFullData) => entity; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/DatabaseCore/Scripts/DepartmentMigrationScript.cs b/DepartmentPortal/Common/DatabaseCore/Scripts/DepartmentMigrationScript.cs index f124694..1298083 100644 --- a/DepartmentPortal/Common/DatabaseCore/Scripts/DepartmentMigrationScript.cs +++ b/DepartmentPortal/Common/DatabaseCore/Scripts/DepartmentMigrationScript.cs @@ -17,6 +17,14 @@ GO DELETE FROM [DepartmentDatabasePortal].[dbo].[Posts]; GO DELETE FROM [DepartmentDatabasePortal].[dbo].[Lecturers]; +GO +DELETE FROM [DepartmentDatabasePortal].[dbo].[TimeNorms]; +GO +DELETE FROM [DepartmentDatabasePortal].[dbo].[AcademicPlans]; +GO +DELETE FROM [DepartmentDatabasePortal].[dbo].[AcademicPlanRecords]; +GO +DELETE FROM [DepartmentDatabasePortal].[dbo].[AcademicPlanRecordTimeNormHours]; GO"; private static readonly string classroomsMigration = @@ -24,19 +32,24 @@ GO"; SELECT @employeeId = emp.[Id] FROM [DepartmentDatabasePortal].[dbo].[Employees] emp -INSERT INTO [DepartmentDatabasePortal].[dbo].[Classrooms]([Id],[Number],[EmployeeId],[ClassroomType],[Square],[Capacity],[HaveProjector],[SecurityCode],[DateCreate],[DateDelete],[IsDeleted]) +INSERT INTO [DepartmentDatabasePortal].[dbo].[Classrooms]([Id],[Number],[EmployeeId],[ClassroomType],[Square],[Capacity],[HaveProjector],[SecurityCode], +[DateCreate],[DateDelete],[IsDeleted]) SELECT [Id],[Number],@employeeId,[ClassroomType],1,[Capacity],0,'-',[DateCreate],[DateDelete],[IsDeleted] FROM [DepartmentDatabaseContext].[dbo].[Classrooms]"; private static readonly string disciplineBlockMigration = -@"INSERT INTO [DepartmentDatabasePortal].[dbo].[DisciplineBlocks]([Id],[Title],[DisciplineBlockUseForGrouping],[DisciplineBlockOrder],[DisciplineBlockBlueAsteriskName],[DateCreate],[DateDelete],[IsDeleted]) -SELECT [Id],[Title],[DisciplineBlockUseForGrouping],[DisciplineBlockOrder],[DisciplineBlockBlueAsteriskName],[DateCreate],[DateDelete],[IsDeleted] FROM [DepartmentDatabaseContext].[dbo].[DisciplineBlocks]"; +@"INSERT INTO [DepartmentDatabasePortal].[dbo].[DisciplineBlocks]([Id],[Title],[DisciplineBlockUseForGrouping],[DisciplineBlockOrder], +[DisciplineBlockBlueAsteriskName],[DateCreate],[DateDelete],[IsDeleted]) +SELECT [Id],[Title],[DisciplineBlockUseForGrouping],[DisciplineBlockOrder],[DisciplineBlockBlueAsteriskName],[DateCreate],[DateDelete],[IsDeleted] FROM +[DepartmentDatabaseContext].[dbo].[DisciplineBlocks]"; private static readonly string disciplineMigration = @"DELETE FROM [DepartmentDatabaseContext].[dbo].[Disciplines] WHERE [Id]='6CC684D5-900C-4278-AA43-0B83D0711C55' OR [Id]='A6598227-8449-4884-8290-13EABEC26924' OR [Id]='4581ADC8-5A15-4F95-A40D-1607856ACB5C' OR [Id]='9DA4D810-025A-4A03-81FD-293DEF52FA4B' -- дублт в дисципдинах -INSERT INTO [DepartmentDatabasePortal].[dbo].[Disciplines]([Id],[DisciplineBlockId],[DisciplineName],[DisciplineShortName],[Description],[DisciplineBlueAsteriskName],[DateCreate],[DateDelete],[IsDeleted]) -SELECT [Id],[DisciplineBlockId],[DisciplineName],[DisciplineShortName],[DisciplineDescription],[DisciplineBlueAsteriskName],[DateCreate],[DateDelete],[IsDeleted] FROM [DepartmentDatabaseContext].[dbo].[Disciplines]"; +INSERT INTO [DepartmentDatabasePortal].[dbo].[Disciplines]([Id],[DisciplineBlockId],[DisciplineName],[DisciplineShortName],[Description], +[DisciplineBlueAsteriskName],[DateCreate],[DateDelete],[IsDeleted]) +SELECT [Id],[DisciplineBlockId],[DisciplineName],[DisciplineShortName],[DisciplineDescription],[DisciplineBlueAsteriskName],[DateCreate],[DateDelete],[IsDeleted] +FROM [DepartmentDatabaseContext].[dbo].[Disciplines]"; private static readonly string postMigration = @"INSERT INTO [DepartmentDatabasePortal].[dbo].[Posts]([Id],[PostName],[Hours],[Order],[DateCreate],[DateDelete],[IsDeleted]) @@ -47,16 +60,51 @@ SELECT [Id],[StudyPostTitle],[Hours],1,[DateCreate],[DateDelete],[IsDeleted] FRO SELECT @userId = u.[Id] FROM [DepartmentDatabasePortal].[dbo].[Users] u WHERE u.[UserName]='admin' -INSERT INTO [DepartmentDatabasePortal].[dbo].[Lecturers]([Id],[UserId],[LastName],[FirstName],[Patronymic],[Abbreviation],[DateBirth],[Address],[Email],[MobileNumber],[HomeNumber],[Description],[Photo],[GroupElectricalSafety],[OnlyForPrivate],[DateCreate],[DateDelete],[IsDeleted]) -SELECT [Id],@userId,[LastName],[FirstName],[Patronymic],[Abbreviation],[DateBirth],[Address],[Email],[MobileNumber],[HomeNumber],[Description],[Photo],'I',[OnlyForPrivate],[DateCreate],[DateDelete],[IsDeleted] FROM [DepartmentDatabaseContext].[dbo].[Lecturers]"; +INSERT INTO [DepartmentDatabasePortal].[dbo].[Lecturers]([Id],[UserId],[LastName],[FirstName],[Patronymic],[Abbreviation],[DateBirth],[Address],[Email], +[MobileNumber],[HomeNumber],[Description],[Photo],[GroupElectricalSafety],[OnlyForPrivate],[DateCreate],[DateDelete],[IsDeleted]) +SELECT [Id],@userId,[LastName],[FirstName],[Patronymic],[Abbreviation],[DateBirth],[Address],[Email],[MobileNumber],[HomeNumber],[Description],[Photo],'I', +[OnlyForPrivate],[DateCreate],[DateDelete],[IsDeleted] FROM [DepartmentDatabaseContext].[dbo].[Lecturers]"; private static readonly string educationdirectionrMigration = @"DECLARE @lecturerId uniqueidentifier; SELECT @lecturerId = l.[Id] FROM [DepartmentDatabasePortal].[dbo].[Lecturers] l -INSERT INTO [DepartmentDatabasePortal].[dbo].[EducationDirections]([Id],[Cipher],[ShortName],[Title],[Profile],[Qualification],[LecturerId],[Description],[DateCreate],[DateDelete],[IsDeleted]) -SELECT [Id],[Cipher],[ShortName],[Title],[Profile],[Qualification],@lecturerId,[Description],[DateCreate],[DateDelete],[IsDeleted] FROM [DepartmentDatabaseContext].[dbo].[EducationDirections]"; +INSERT INTO [DepartmentDatabasePortal].[dbo].[EducationDirections]([Id],[Cipher],[ShortName],[Title],[Profile],[Qualification],[LecturerId],[Description], +[DateCreate],[DateDelete],[IsDeleted]) +SELECT [Id],[Cipher],[ShortName],[Title],[Profile],[Qualification],@lecturerId,[Description],[DateCreate],[DateDelete],[IsDeleted] FROM +[DepartmentDatabaseContext].[dbo].[EducationDirections]"; + + private static readonly string timeNormMigration = +@"INSERT INTO [DepartmentDatabasePortal].[dbo].[TimeNorms]([Id],[DisciplineBlockId],[TimeNormName],[TimeNormShortName] + ,[TimeNormOrder],[TimeNormEducationDirectionQualification],[KindOfLoadName],[KindOfLoadAttributeName],[KindOfLoadBlueAsteriskName] + ,[KindOfLoadBlueAsteriskAttributeName],[KindOfLoadBlueAsteriskPracticName],[UseInLearningProgress],[UseInSite],[DateCreate],[DateDelete],[IsDeleted]) +SELECT [Id],[DisciplineBlockId],[TimeNormName],[TimeNormShortName],[TimeNormOrder],[TimeNormEducationDirectionQualification],[KindOfLoadName] + ,[KindOfLoadAttributeName],[KindOfLoadBlueAsteriskName],[KindOfLoadBlueAsteriskAttributeName],[KindOfLoadBlueAsteriskPracticName] + ,[UseInLearningProgress],[UseInSite],[DateCreate],[DateDelete],[IsDeleted] FROM [DepartmentDatabaseContext].[dbo].[TimeNorms] WHERE +[AcademicYearId]='4FFC16B7-C1A5-47B1-B780-821ED70793DC'"; + + private static readonly string academicplanMigration = +@"INSERT INTO [DepartmentDatabasePortal].[dbo].[AcademicPlans]([Id],[EducationDirectionId],[YearEntrance],[YearFinish],[DateCreate],[DateDelete],[IsDeleted]) +SELECT [Id],[EducationDirectionId],2020 + ABS(CHECKSUM(NEWID()) % 100),2024,[DateCreate],[DateDelete],[IsDeleted] FROM [DepartmentDatabaseContext].[dbo].[AcademicPlans] WHERE +[AcademicYearId]='4FFC16B7-C1A5-47B1-B780-821ED70793DC'"; + + private static readonly string academicplanrecordsMigration = +@"INSERT INTO [DepartmentDatabasePortal].[dbo].[AcademicPlanRecords]([Id],[AcademicPlanId],[DisciplineId],[InDepartment],[Semester],[Zet] + ,[AcademicPlanRecordParentId],[IsParent],[IsFacultative],[DateCreate],[DateDelete],[IsDeleted]) +SELECT apr.[Id],apr.[AcademicPlanId],apr.[DisciplineId],apr.[InDepartment],apr.[Semester],apr.[Zet],apr.[AcademicPlanRecordParentId],apr.[IsParent],apr.[IsFacultative] + ,apr.[DateCreate],apr.[DateDelete],apr.[IsDeleted] FROM [DepartmentDatabaseContext].[dbo].[AcademicPlanRecords] apr +JOIN [DepartmentDatabaseContext].[dbo].[AcademicPlans] ap on apr.[AcademicPlanId]=ap.[Id] WHERE +ap.[AcademicYearId]='4FFC16B7-C1A5-47B1-B780-821ED70793DC'"; + + private static readonly string academicplanrecordhoursMigration = +@"INSERT INTO [DepartmentDatabasePortal].[dbo].[AcademicPlanRecordTimeNormHours]([Id],[AcademicPlanRecordId],[TimeNormId],[PlanHours],[DateCreate],[DateDelete], + [IsDeleted]) +SELECT apre.[Id],apre.[AcademicPlanRecordId],apre.[TimeNormId],apre.[PlanHours],apre.[DateCreate],apre.[DateDelete],apre.[IsDeleted] +FROM [DepartmentDatabaseContext].[dbo].[AcademicPlanRecordElements] apre +JOIN [DepartmentDatabaseContext].[dbo].[AcademicPlanRecords] apr on apre.[AcademicPlanRecordId]=apr.[Id] +JOIN [DepartmentDatabaseContext].[dbo].[AcademicPlans] ap on apr.[AcademicPlanId]=ap.[Id] WHERE +ap.[AcademicYearId]='4FFC16B7-C1A5-47B1-B780-821ED70793DC'"; /// /// Перенос данных по безопасности @@ -72,6 +120,10 @@ SELECT [Id],[Cipher],[ShortName],[Title],[Profile],[Qualification],@lecturerId,[ context.Database.ExecuteSqlRaw(postMigration, null); context.Database.ExecuteSqlRaw(lecturerMigration, null); context.Database.ExecuteSqlRaw(educationdirectionrMigration, null); + context.Database.ExecuteSqlRaw(timeNormMigration, null); + context.Database.ExecuteSqlRaw(academicplanMigration, null); + context.Database.ExecuteSqlRaw(academicplanrecordsMigration, null); + context.Database.ExecuteSqlRaw(academicplanrecordhoursMigration, null); } } } \ No newline at end of file diff --git a/DepartmentPortal/Common/DesktopTools/BaseControls/BaseControlEnum.cs b/DepartmentPortal/Common/DesktopTools/BaseControls/BaseControlEnum.cs index 57f9896..50deb7c 100644 --- a/DepartmentPortal/Common/DesktopTools/BaseControls/BaseControlEnum.cs +++ b/DepartmentPortal/Common/DesktopTools/BaseControls/BaseControlEnum.cs @@ -31,6 +31,10 @@ namespace DesktopTools.BaseControls }; panelControl.Controls.Add(checkBoxNullable); } + if (enumType.Name.StartsWith("Nullable")) + { + enumType = Nullable.GetUnderlyingType(enumType); + } comboBox.Items.Clear(); foreach (var val in Enum.GetValues(enumType)) diff --git a/DepartmentPortal/Common/DesktopTools/MainControls/GenericControlEntityList.cs b/DepartmentPortal/Common/DesktopTools/MainControls/GenericControlEntityList.cs index 632d200..54661b9 100644 --- a/DepartmentPortal/Common/DesktopTools/MainControls/GenericControlEntityList.cs +++ b/DepartmentPortal/Common/DesktopTools/MainControls/GenericControlEntityList.cs @@ -431,6 +431,11 @@ namespace DesktopTools.Controls } } await Task.Run(() => data = _businessLogic.GetList(model)); + if (data == null && _businessLogic.Errors.Count > 0) + { + DialogHelper.MessageException(_businessLogic.Errors, $"{Title}. Ошибки при получении данных"); + return; + } toolStripLabelCountPages.Text = $"из {data?.MaxCount}"; } catch (Exception ex) diff --git a/DepartmentPortal/Common/ModuleTools/BusinessLogics/Mapper.cs b/DepartmentPortal/Common/ModuleTools/BusinessLogics/Mapper.cs index 46b7151..6ad3dd2 100644 --- a/DepartmentPortal/Common/ModuleTools/BusinessLogics/Mapper.cs +++ b/DepartmentPortal/Common/ModuleTools/BusinessLogics/Mapper.cs @@ -94,6 +94,14 @@ namespace ModuleTools.BusinessLogics } if ((haveRigth && !customAttribute.AllowCopyWithoutRigth) || customAttribute.AllowCopyWithoutRigth) { + if (property.PropertyType.Name.StartsWith("Nullable")) + { + if (Nullable.GetUnderlyingType(property.PropertyType).IsEnum) + { + property.SetValue(newObject, Enum.Parse(Nullable.GetUnderlyingType(property.PropertyType), value.ToString())); + continue; + } + } property.SetValue(newObject, value); } } diff --git a/DepartmentPortal/Common/ModuleTools/Enums/AccessOperation.cs b/DepartmentPortal/Common/ModuleTools/Enums/AccessOperation.cs index cb8ac9e..5dd341a 100644 --- a/DepartmentPortal/Common/ModuleTools/Enums/AccessOperation.cs +++ b/DepartmentPortal/Common/ModuleTools/Enums/AccessOperation.cs @@ -26,18 +26,22 @@ #region База Кафедра = 100, - Должности = 101, // + должности + Должности = 101, - Сотрудники = 102, // + должности + Сотрудники = 102, Аудитории = 103, Дисциплины = 104, // + Блоки дисциплин - Преподаватели = 105, // + должности, звания + Преподаватели = 105, // + звания НаправленияОбучений = 106, + НормыВремени = 107, + + УчебныеПланы = 108, + Группы = 105, // Студенты = 106, @@ -48,8 +52,6 @@ // Меню Учебный процесс Учебный_процесс = 150, - Учебные_планы = 120, - Виды_нагрузок = 121, Учебные_года = 122, @@ -58,8 +60,6 @@ Контингент = 123, - Нормы_времени = 124, - Расчет_штатов = 125, Расчасовки = 127, diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/BindingModels/AcademicPlanBindingModels.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/BindingModels/AcademicPlanBindingModels.cs new file mode 100644 index 0000000..6620697 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/BindingModels/AcademicPlanBindingModels.cs @@ -0,0 +1,33 @@ +using ModuleTools.Attributes; +using ModuleTools.BindingModels; +using System; +using System.ComponentModel.DataAnnotations; + +namespace DepartmentBusinessLogic.BindingModels +{ + /// + /// Получение учебного года + /// + public class AcademicPlanGetBindingModel : GetBindingModel + { + public Guid? EducationDirectionId { get; set; } + } + + /// + /// Сохранение учебного года + /// + public class AcademicPlanSetBindingModel : SetBindingModel + { + [Required(ErrorMessage = "required")] + [MapConfiguration("EducationDirectionId")] + public Guid EducationDirectionId { get; set; } + + [Required(ErrorMessage = "required")] + [MapConfiguration("YearEntrance")] + public int YearEntrance { get; set; } + + [Required(ErrorMessage = "required")] + [MapConfiguration("YearFinish")] + public int YearFinish { get; set; } + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/BindingModels/AcademicPlanRecordBindingModels.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/BindingModels/AcademicPlanRecordBindingModels.cs new file mode 100644 index 0000000..c05a5d0 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/BindingModels/AcademicPlanRecordBindingModels.cs @@ -0,0 +1,61 @@ +using DepartmentBusinessLogic.Enums; +using ModuleTools.Attributes; +using ModuleTools.BindingModels; +using System; +using System.ComponentModel.DataAnnotations; + +namespace DepartmentBusinessLogic.BindingModels +{ + /// + /// Получение записи учебного плана + /// + public class AcademicPlanRecordGetBindingModel : GetBindingModel + { + public Guid? AcademicPlanId { get; set; } + + public Guid? DisciplineId { get; set; } + + public Semester? Semester { get; set; } + } + + /// + /// Сохранение записи учебного плана + /// + public class AcademicPlanRecordSetBindingModel : SetBindingModel + { + [Required(ErrorMessage = "required")] + [MapConfiguration("AcademicPlanId")] + public Guid AcademicPlanId { get; set; } + + [Required(ErrorMessage = "required")] + [MapConfiguration("DisciplineId")] + public Guid DisciplineId { get; set; } + + [Required(ErrorMessage = "required")] + [MapConfiguration("InDepartment")] + public bool InDepartment { get; set; } + + [Required(ErrorMessage = "required")] + [MapConfiguration("Semester")] + public Semester Semester { get; set; } + + [Required(ErrorMessage = "required")] + [MapConfiguration("Zet")] + public int Zet { get; set; } + + [MapConfiguration("AcademicPlanRecordParentId")] + public Guid? AcademicPlanRecordParentId { get; set; } + + /// + /// Является родительской для дисциплин по выбору + /// + [MapConfiguration("IsParent")] + public bool IsParent { get; set; } + + /// + /// Является факультативной дисциплиной + /// + [MapConfiguration("IsFacultative")] + public bool IsFacultative { get; set; } + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/BindingModels/AcademicPlanRecordTimeNormHourBindingModels.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/BindingModels/AcademicPlanRecordTimeNormHourBindingModels.cs new file mode 100644 index 0000000..ef1e1ab --- /dev/null +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/BindingModels/AcademicPlanRecordTimeNormHourBindingModels.cs @@ -0,0 +1,35 @@ +using ModuleTools.Attributes; +using ModuleTools.BindingModels; +using System; +using System.ComponentModel.DataAnnotations; + +namespace DepartmentBusinessLogic.BindingModels +{ + /// + /// Получение часов по норме времени для записи учебного плана + /// + public class AcademicPlanRecordTimeNormHourGetBindingModel : GetBindingModel + { + public Guid? AcademicPlanRecordId { get; set; } + + public Guid? TimeNormId { get; set; } + } + + /// + /// Сохранение часов по норме времени для записи учебного плана + /// + public class AcademicPlanRecordTimeNormHourSetBindingModel : SetBindingModel + { + [Required(ErrorMessage = "required")] + [MapConfiguration("AcademicPlanRecordId")] + public Guid AcademicPlanRecordId { get; set; } + + [Required(ErrorMessage = "required")] + [MapConfiguration("TimeNormId")] + public Guid TimeNormId { get; set; } + + [Required(ErrorMessage = "required")] + [MapConfiguration("PlanHours")] + public decimal PlanHours { get; set; } + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/BindingModels/TimeNormBindingModels.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/BindingModels/TimeNormBindingModels.cs new file mode 100644 index 0000000..54b58d4 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/BindingModels/TimeNormBindingModels.cs @@ -0,0 +1,73 @@ +using DepartmentBusinessLogic.Enums; +using ModuleTools.Attributes; +using ModuleTools.BindingModels; +using System; +using System.ComponentModel.DataAnnotations; + +namespace DepartmentBusinessLogic.BindingModels +{ + /// + /// Получение нормы времени + /// + public class TimeNormGetBindingModel : GetBindingModel + { + public Guid? DisciplineBlockId { get; set; } + } + + /// + /// Сохранение нормы времени + /// + public class TimeNormSetBindingModel : SetBindingModel + { + [Required(ErrorMessage = "required")] + [MapConfiguration("DisciplineBlockId")] + public Guid DisciplineBlockId { get; set; } + + [Required(ErrorMessage = "required")] + [MapConfiguration("TimeNormName")] + public string TimeNormName { get; set; } + + [Required(ErrorMessage = "required")] + [MapConfiguration("TimeNormShortName")] + public string TimeNormShortName { get; set; } + + [Required(ErrorMessage = "required")] + [MapConfiguration("TimeNormOrder")] + public int TimeNormOrder { get; set; } + + [MapConfiguration("TimeNormEducationDirectionQualification")] + public EducationDirectionQualification? TimeNormEducationDirectionQualification { get; set; } + + [Required(ErrorMessage = "required")] + [MapConfiguration("KindOfLoadName")] + public string KindOfLoadName { get; set; } + + [MapConfiguration("KindOfLoadAttributeName")] + public string KindOfLoadAttributeName { get; set; } + + [MapConfiguration("KindOfLoadBlueAsteriskName")] + public string KindOfLoadBlueAsteriskName { get; set; } + + [MapConfiguration("KindOfLoadBlueAsteriskAttributeName")] + public string KindOfLoadBlueAsteriskAttributeName { get; set; } + + [MapConfiguration("KindOfLoadBlueAsteriskPracticName")] + public string KindOfLoadBlueAsteriskPracticName { get; set; } + + [MapConfiguration("UseInLearningProgress")] + public bool UseInLearningProgress { get; set; } + + [MapConfiguration("UseInSite")] + public bool UseInSite { get; set; } + + /// + /// Код вида работ в справочнике видов работ в новой версии планов, чтобы потом искать работу в строках плана + /// + public string KindOfLoadBlueAsteriskCode { get; set; } + + /// + /// Код вида практики в справочнике видов практик в новой версии планов, чтобы потом искать практику в строках плана + /// + public string KindOfLoadBlueAsteriskPracticCode { get; set; } + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/BusinessLogics/AcademicPlanBusinessLogic.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/BusinessLogics/AcademicPlanBusinessLogic.cs new file mode 100644 index 0000000..b74b495 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/BusinessLogics/AcademicPlanBusinessLogic.cs @@ -0,0 +1,16 @@ +using DepartmentBusinessLogic.BindingModels; +using DepartmentBusinessLogic.Interfaces; +using DepartmentBusinessLogic.ViewModels; +using ModuleTools.BusinessLogics; +using ModuleTools.Enums; + +namespace DepartmentBusinessLogic.BusinessLogics +{ + /// + /// Логика работы с учебными планами + /// + public class AcademicPlanBusinessLogic : GenericBusinessLogic + { + public AcademicPlanBusinessLogic(IAcademicPlanService service) : base(service, "Учебные Планы", AccessOperation.УчебныеПланы) { } + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/BusinessLogics/AcademicPlanRecordBusinessLogic.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/BusinessLogics/AcademicPlanRecordBusinessLogic.cs new file mode 100644 index 0000000..043fd99 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/BusinessLogics/AcademicPlanRecordBusinessLogic.cs @@ -0,0 +1,16 @@ +using DepartmentBusinessLogic.BindingModels; +using DepartmentBusinessLogic.Interfaces; +using DepartmentBusinessLogic.ViewModels; +using ModuleTools.BusinessLogics; +using ModuleTools.Enums; + +namespace DepartmentBusinessLogic.BusinessLogics +{ + /// + /// Логика работы с записями учебного плана + /// + public class AcademicPlanRecordBusinessLogic : GenericBusinessLogic + { + public AcademicPlanRecordBusinessLogic(IAcademicPlanRecordService service) : base(service, "Записи Учебных Планов", AccessOperation.УчебныеПланы) { } + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/BusinessLogics/AcademicPlanRecordTimeNormHourBusinessLogic.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/BusinessLogics/AcademicPlanRecordTimeNormHourBusinessLogic.cs new file mode 100644 index 0000000..943086d --- /dev/null +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/BusinessLogics/AcademicPlanRecordTimeNormHourBusinessLogic.cs @@ -0,0 +1,16 @@ +using DepartmentBusinessLogic.BindingModels; +using DepartmentBusinessLogic.Interfaces; +using DepartmentBusinessLogic.ViewModels; +using ModuleTools.BusinessLogics; +using ModuleTools.Enums; + +namespace DepartmentBusinessLogic.BusinessLogics +{ + /// + /// Логика работы с часами нагрузок записей учебных планов + /// + public class AcademicPlanRecordTimeNormHourBusinessLogic : GenericBusinessLogic + { + public AcademicPlanRecordTimeNormHourBusinessLogic(IAcademicPlanRecordTimeNormHourService service) : base(service, "Часы Нагрузок Записей Учебных Планов", AccessOperation.УчебныеПланы) { } + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/BusinessLogics/TimeNormBusinessLogic.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/BusinessLogics/TimeNormBusinessLogic.cs new file mode 100644 index 0000000..4353cca --- /dev/null +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/BusinessLogics/TimeNormBusinessLogic.cs @@ -0,0 +1,16 @@ +using DepartmentBusinessLogic.BindingModels; +using DepartmentBusinessLogic.Interfaces; +using DepartmentBusinessLogic.ViewModels; +using ModuleTools.BusinessLogics; +using ModuleTools.Enums; + +namespace DepartmentBusinessLogic.BusinessLogics +{ + /// + /// Логика работы с нормами времени + /// + public class TimeNormBusinessLogic : GenericBusinessLogic + { + public TimeNormBusinessLogic(ITimeNormService service) : base(service, "Нормы Времени", AccessOperation.НормыВремени) { } + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/Enums/Semester.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/Enums/Semester.cs new file mode 100644 index 0000000..4a65fb2 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/Enums/Semester.cs @@ -0,0 +1,24 @@ +namespace DepartmentBusinessLogic.Enums +{ + /// + /// Семестр обучения + /// + public enum Semester + { + Первый = 1, + + Второй = 2, + + Третий = 3, + + Четвертый = 4, + + Пятый = 5, + + Шестой = 6, + + Седьмой = 7, + + Восьмой = 8 + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/Interfaces/IAcademicPlanRecordService.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/Interfaces/IAcademicPlanRecordService.cs new file mode 100644 index 0000000..f0e0495 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/Interfaces/IAcademicPlanRecordService.cs @@ -0,0 +1,10 @@ +using DepartmentBusinessLogic.BindingModels; +using ModuleTools.Interfaces; + +namespace DepartmentBusinessLogic.Interfaces +{ + /// + /// Хранение записей учебного плана + /// + public interface IAcademicPlanRecordService : IGenerticEntityService { } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/Interfaces/IAcademicPlanRecordTimeNormHourService.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/Interfaces/IAcademicPlanRecordTimeNormHourService.cs new file mode 100644 index 0000000..e968ffb --- /dev/null +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/Interfaces/IAcademicPlanRecordTimeNormHourService.cs @@ -0,0 +1,10 @@ +using DepartmentBusinessLogic.BindingModels; +using ModuleTools.Interfaces; + +namespace DepartmentBusinessLogic.Interfaces +{ + /// + /// Хранение часов нагрузки записи чебного плана + /// + public interface IAcademicPlanRecordTimeNormHourService : IGenerticEntityService { } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/Interfaces/IAcademicPlanService.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/Interfaces/IAcademicPlanService.cs new file mode 100644 index 0000000..ad67e5b --- /dev/null +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/Interfaces/IAcademicPlanService.cs @@ -0,0 +1,10 @@ +using DepartmentBusinessLogic.BindingModels; +using ModuleTools.Interfaces; + +namespace DepartmentBusinessLogic.Interfaces +{ + /// + /// Хранение учебных планов + /// + public interface IAcademicPlanService : IGenerticEntityService { } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/Interfaces/ITimeNormService.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/Interfaces/ITimeNormService.cs new file mode 100644 index 0000000..9b6a134 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/Interfaces/ITimeNormService.cs @@ -0,0 +1,10 @@ +using DepartmentBusinessLogic.BindingModels; +using ModuleTools.Interfaces; + +namespace DepartmentBusinessLogic.Interfaces +{ + /// + /// Хранение норм времени + /// + public interface ITimeNormService : IGenerticEntityService { } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/AcademicPlanRecordTimeNormHourViewModels.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/AcademicPlanRecordTimeNormHourViewModels.cs new file mode 100644 index 0000000..8a11ebd --- /dev/null +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/AcademicPlanRecordTimeNormHourViewModels.cs @@ -0,0 +1,49 @@ +using DepartmentBusinessLogic.Enums; +using ModuleTools.Attributes; +using ModuleTools.Enums; +using ModuleTools.ViewModels; +using System; + +namespace DepartmentBusinessLogic.ViewModels +{ + /// + /// Список часов по нагрузке для записи учебного плана + /// + public class AcademicPlanRecordTimeNormHourListViewModel : ListViewModel { } + + /// + /// Элемент часов по нагрузке для записи учебного плана + /// + [ViewModelControlElementClass()] + public class AcademicPlanRecordTimeNormHourViewModel : ElementViewModel + { + [ViewModelControlElementProperty("Запись учебного плана", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlAcademicPlanRecordList, DepartmentWindowsDesktop")] + [MapConfiguration("AcademicPlanRecordId")] + public Guid AcademicPlanRecordId { get; set; } + + [ViewModelControlListProperty("Дисциплина")] + [MapConfiguration("AcademicPlanRecord.Discipline.DisciplineName", IsDifficle = true)] + public string DisciplineName { get; set; } + + [MapConfiguration("AcademicPlanRecord.Semester", IsDifficle = true)] + public Semester Semester { get; set; } + + [ViewModelControlListProperty("Семестр", ColumnWidth = 80)] + public string SemesterTitle => Semester.ToString("G"); + + [ViewModelControlElementProperty("Норма времени", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlTimeNormList, DepartmentWindowsDesktop")] + [MapConfiguration("TimeNormId")] + public Guid TimeNormId { get; set; } + + [ViewModelControlListProperty("Норма времени")] + [MapConfiguration("TimeNorm.TimeNormName", IsDifficle = true)] + public string TimeNormName { get; set; } + + [ViewModelControlListProperty("Часы", ColumnWidth = 80)] + [ViewModelControlElementProperty("Часы", ControlType.ControlDecimal, MustHaveValue = true)] + [MapConfiguration("PlanHours")] + public decimal PlanHours { get; set; } + + public override string ToString() => $"{DisciplineName}({Semester}) - {TimeNormName}"; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/AcademicPlanRecordViewModels.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/AcademicPlanRecordViewModels.cs new file mode 100644 index 0000000..83f3545 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/AcademicPlanRecordViewModels.cs @@ -0,0 +1,79 @@ +using DepartmentBusinessLogic.Enums; +using ModuleTools.Attributes; +using ModuleTools.Enums; +using ModuleTools.ViewModels; +using System; + +namespace DepartmentBusinessLogic.ViewModels +{ + /// + /// Список аудиторий + /// + public class AcademicPlanRecordListViewModel : ListViewModel { } + + /// + /// Элемент аудитории + /// + [ViewModelControlElementClass(HaveDependenceEntities = true, Width = 800, Height = 500)] + [ViewModelControlElementDependenceEntity(Title = "Часы по нагрузкам", Order = 1, ParentPropertyName = "AcademicPlanRecordId", + ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlAcademicPlanRecordTimeNormHourList, DepartmentWindowsDesktop")] + public class AcademicPlanRecordViewModel : ElementViewModel + { + [ViewModelControlElementProperty("Учебный план", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlAcademicPlanList, DepartmentWindowsDesktop")] + [MapConfiguration("AcademicPlanId")] + public Guid AcademicPlanId { get; set; } + + [ViewModelControlElementProperty("Дисциплина", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlDisciplineList, DepartmentWindowsDesktop")] + [MapConfiguration("DisciplineId")] + public Guid DisciplineId { get; set; } + + [ViewModelControlListProperty("Дисциплина")] + [MapConfiguration("Discipline.DisciplineName", IsDifficle = true)] + public string DisciplineName { get; set; } + + [ViewModelControlElementProperty("Преподается на кафедре", ControlType.ControlBool, MustHaveValue = true)] + [MapConfiguration("InDepartment")] + public bool InDepartment { get; set; } + + [ViewModelControlListProperty("На кафедре", ColumnWidth = 80)] + public string InDepartmentValue => InDepartment ? "Да" : "Нет"; + + [ViewModelControlElementProperty("Семестр", ControlType.ControlEnum, MustHaveValue = true)] + [MapConfiguration("Semester")] + public Semester Semester { get; set; } + + [ViewModelControlListProperty("Семестр", ColumnWidth = 80)] + public string SemesterTitle => Semester.ToString("G"); + + [ViewModelControlListProperty("Зет", ColumnWidth = 60)] + [ViewModelControlElementProperty("Зет", ControlType.ControlInt, MustHaveValue = true)] + [MapConfiguration("Zet")] + public int Zet { get; set; } + + [ViewModelControlElementProperty("Родитель", ControlType.ControlGuid, MustHaveValue = false, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlAcademicPlanRecordList, DepartmentWindowsDesktop")] + [MapConfiguration("AcademicPlanRecordParentId")] + public Guid? AcademicPlanRecordParentId { get; set; } + + [ViewModelControlElementProperty("Является родительской", ControlType.ControlBool, MustHaveValue = true)] + [MapConfiguration("IsParent")] + public bool IsParent { get; set; } + + [ViewModelControlListProperty("ДВ", ColumnWidth = 50)] + public string IsParentValue => IsParent ? "Да" : "Нет"; + + [ViewModelControlListProperty("По выбору", ColumnWidth = 80)] + public string IsChildValue => AcademicPlanRecordParentId.HasValue ? "Да" : "Нет"; + + /// + /// Является факультативной дисциплиной + /// + [ViewModelControlElementProperty("Является факультативной", ControlType.ControlBool, MustHaveValue = true)] + [MapConfiguration("IsFacultative")] + public bool IsFacultative { get; set; } + + [ViewModelControlListProperty("Факульт", ColumnWidth = 80)] + public string IsFacultativeValue => IsFacultative ? "Да" : "Нет"; + + public override string ToString() => $"{DisciplineName} - {SemesterTitle} семестр"; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/AcademicPlanViewModels.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/AcademicPlanViewModels.cs new file mode 100644 index 0000000..ad8e626 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/AcademicPlanViewModels.cs @@ -0,0 +1,41 @@ +using ModuleTools.Attributes; +using ModuleTools.Enums; +using ModuleTools.ViewModels; +using System; + +namespace DepartmentBusinessLogic.ViewModels +{ + /// + /// Список учбеных планов + /// + public class AcademicPlanListViewModel : ListViewModel { } + + /// + /// Элемент учебного плана + /// + [ViewModelControlElementClass(HaveDependenceEntities = true, Width = 800, Height = 500)] + [ViewModelControlElementDependenceEntity(Title = "Записи плана", Order = 1, ParentPropertyName = "AcademicPlanId", + ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlAcademicPlanRecordList, DepartmentWindowsDesktop")] + public class AcademicPlanViewModel : ElementViewModel + { + [ViewModelControlElementProperty("Направление", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlEducationDirectionList, DepartmentWindowsDesktop")] + [MapConfiguration("EducationDirectionId")] + public Guid EducationDirectionId { get; set; } + + [ViewModelControlListProperty("Направление")] + [MapConfiguration("EducationDirection.Cipher", IsDifficle = true)] + public string EducationDirectionCipher { get; set; } + + [ViewModelControlListProperty("Дата начала", ColumnWidth = 120)] + [ViewModelControlElementProperty("Дата начала", ControlType.ControlString, MustHaveValue = true)] + [MapConfiguration("YearEntrance")] + public int YearEntrance { get; set; } + + [ViewModelControlListProperty("Дата окончания", ColumnWidth = 120)] + [ViewModelControlElementProperty("Дата окончания", ControlType.ControlString, MustHaveValue = true)] + [MapConfiguration("YearFinish")] + public int YearFinish { get; set; } + + public override string ToString() =>$"{EducationDirectionCipher}: {YearEntrance}-{YearFinish}"; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/DisciplineBlockViewModels.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/DisciplineBlockViewModels.cs index cd41773..7df2f70 100644 --- a/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/DisciplineBlockViewModels.cs +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/DisciplineBlockViewModels.cs @@ -15,6 +15,8 @@ namespace DepartmentBusinessLogic.ViewModels [ViewModelControlElementClass(HaveDependenceEntities = true, Width = 800, Height = 500)] [ViewModelControlElementDependenceEntity(Title = "Дисципилны", Order = 1, ParentPropertyName = "DisciplineBlockId", ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlDisciplineList, DepartmentWindowsDesktop")] + [ViewModelControlElementDependenceEntity(Title = "Нормы времени", Order = 1, ParentPropertyName = "DisciplineBlockId", + ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlTimeNormList, DepartmentWindowsDesktop")] public class DisciplineBlockViewModel : ElementViewModel { [ViewModelControlListProperty("Название блока")] diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/DisciplineViewModels.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/DisciplineViewModels.cs index 0dbf7d7..502e72c 100644 --- a/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/DisciplineViewModels.cs +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/DisciplineViewModels.cs @@ -13,7 +13,9 @@ namespace DepartmentBusinessLogic.ViewModels /// /// Элемент дисциплина /// - [ViewModelControlElementClass()] + [ViewModelControlElementClass(HaveDependenceEntities = true, Width = 800, Height = 500)] + [ViewModelControlElementDependenceEntity(Title = "Записи учебного плана", Order = 1, ParentPropertyName = "DisciplineId", + ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlAcademicPlanRecordList, DepartmentWindowsDesktop")] public class DisciplineViewModel : ElementViewModel { [ViewModelControlElementProperty("Блок дисциплин", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlDisciplineBlockList, DepartmentWindowsDesktop")] diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/EducationDirectionViewModels.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/EducationDirectionViewModels.cs index 870cfbf..dc0ca17 100644 --- a/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/EducationDirectionViewModels.cs +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/EducationDirectionViewModels.cs @@ -14,7 +14,9 @@ namespace DepartmentBusinessLogic.ViewModels /// /// Элемент направления обучения /// - [ViewModelControlElementClass()] + [ViewModelControlElementClass(HaveDependenceEntities = true, Width = 800, Height = 500)] + [ViewModelControlElementDependenceEntity(Title = "Учебные планы", Order = 1, ParentPropertyName = "EducationDirectionId", + ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlAcademicPlanList, DepartmentWindowsDesktop")] public class EducationDirectionViewModel : ElementViewModel { [ViewModelControlListProperty("Шифр", ColumnWidth = 80)] diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/LecturerEmployeePostViewModels.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/LecturerPostViewModels.cs similarity index 100% rename from DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/LecturerEmployeePostViewModels.cs rename to DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/LecturerPostViewModels.cs diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/TimeNormViewModels.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/TimeNormViewModels.cs new file mode 100644 index 0000000..d88ea00 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/TimeNormViewModels.cs @@ -0,0 +1,79 @@ +using DepartmentBusinessLogic.Enums; +using ModuleTools.Attributes; +using ModuleTools.Enums; +using ModuleTools.ViewModels; +using System; + +namespace DepartmentBusinessLogic.ViewModels +{ + /// + /// Список норм времени + /// + public class TimeNormListViewModel : ListViewModel { } + + /// + /// Элемент нормы времени + /// + [ViewModelControlElementClass(HaveDependenceEntities = true, Width = 800, Height = 500)] + [ViewModelControlElementDependenceEntity(Title = "Нагрузки в планах", Order = 1, ParentPropertyName = "TimeNormId", + ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlAcademicPlanRecordTimeNormHourList, DepartmentWindowsDesktop")] + public class TimeNormViewModel : ElementViewModel + { + [ViewModelControlElementProperty("Блок дисциплин", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlDisciplineBlockList, DepartmentWindowsDesktop")] + [MapConfiguration("DisciplineBlockId")] + public Guid DisciplineBlockId { get; set; } + + [ViewModelControlListProperty("Название")] + [ViewModelControlElementProperty("Название", ControlType.ControlString, MustHaveValue = true)] + [MapConfiguration("TimeNormName")] + public string TimeNormName { get; set; } + + [ViewModelControlListProperty("Сокращение", ColumnWidth = 100)] + [ViewModelControlElementProperty("Сокращение", ControlType.ControlString, MustHaveValue = true)] + [MapConfiguration("TimeNormShortName")] + public string TimeNormShortName { get; set; } + + [ViewModelControlListProperty("Порядок", ColumnWidth = 100)] + [ViewModelControlElementProperty("Порядок", ControlType.ControlInt, MustHaveValue = true)] + [MapConfiguration("TimeNormOrder")] + public int TimeNormOrder { get; set; } + + [ViewModelControlElementProperty("Обучение", ControlType.ControlEnum, MustHaveValue = false)] + [MapConfiguration("TimeNormEducationDirectionQualification")] + public EducationDirectionQualification? TimeNormEducationDirectionQualification { get; set; } + + [ViewModelControlListProperty("Обучение", ColumnWidth = 100)] + public string TimeNormEducationDirectionQualificationTitle => TimeNormEducationDirectionQualification?.ToString("G") ?? string.Empty; + + [ViewModelControlListProperty("Тип нагрузки", ColumnWidth = 300)] + [ViewModelControlElementProperty("Тип нагрузки", ControlType.ControlString)] + [MapConfiguration("KindOfLoadName")] + public string KindOfLoadName { get; set; } + + [ViewModelControlElementProperty("Атрибут для поиска в старой версии", ControlType.ControlString)] + [MapConfiguration("KindOfLoadAttributeName")] + public string KindOfLoadAttributeName { get; set; } + + [ViewModelControlElementProperty("Название нагрузки в справочнике видов работ", ControlType.ControlString)] + [MapConfiguration("KindOfLoadBlueAsteriskName")] + public string KindOfLoadBlueAsteriskName { get; set; } + + [ViewModelControlElementProperty("Название нагрузки в справочнике видов работ", ControlType.ControlString)] + [MapConfiguration("KindOfLoadBlueAsteriskAttributeName")] + public string KindOfLoadBlueAsteriskAttributeName { get; set; } + + [ViewModelControlElementProperty("Название атрибута по которму извлекать часы", ControlType.ControlString)] + [MapConfiguration("KindOfLoadBlueAsteriskPracticName")] + public string KindOfLoadBlueAsteriskPracticName { get; set; } + + [ViewModelControlElementProperty("Учитывается в учебной нагрузке", ControlType.ControlBool, MustHaveValue = true)] + [MapConfiguration("UseInLearningProgress")] + public bool UseInLearningProgress { get; set; } + + [ViewModelControlElementProperty("Выводить для сайта", ControlType.ControlBool, MustHaveValue = true)] + [MapConfiguration("UseInSite")] + public bool UseInSite { get; set; } + + public override string ToString() => TimeNormName; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/DepartmentImplementationExtensions.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/DepartmentImplementationExtensions.cs index bd91ac3..f119776 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/DepartmentImplementationExtensions.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/DepartmentImplementationExtensions.cs @@ -25,6 +25,12 @@ namespace DepartmentDatabaseImplementation DependencyManager.Instance.RegisterType(); DependencyManager.Instance.RegisterType(); + + DependencyManager.Instance.RegisterType(); + + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); + DependencyManager.Instance.RegisterType(); } } } \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/AcademicPlanRecordService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/AcademicPlanRecordService.cs new file mode 100644 index 0000000..098c169 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/AcademicPlanRecordService.cs @@ -0,0 +1,61 @@ +using DatabaseCore; +using DatabaseCore.Models.Department; +using DepartmentBusinessLogic.BindingModels; +using DepartmentBusinessLogic.Interfaces; +using DepartmentBusinessLogic.ViewModels; +using Microsoft.EntityFrameworkCore; +using ModuleTools.Models; +using System; +using System.Linq; + +namespace DepartmentDatabaseImplementation.Implementations +{ + /// + /// Реализация IAcademicPlanRecordService + /// + public class AcademicPlanRecordService : + AbstractGenerticEntityService, + IAcademicPlanRecordService + { + protected override OperationResultModel AdditionalCheckingWhenAdding(DbContext context, AcademicPlanRecordSetBindingModel model) => OperationResultModel.Success(null); + + protected override OperationResultModel AdditionalCheckingWhenDeleting(DbContext context, AcademicPlanRecord entity, AcademicPlanRecordGetBindingModel model) => OperationResultModel.Success(null); + + protected override IQueryable AdditionalCheckingWhenReadingList(IQueryable query, AcademicPlanRecordGetBindingModel model) + { + if (model.AcademicPlanId.HasValue) + { + query = query.Where(x => x.AcademicPlanId == model.AcademicPlanId.Value); + } + if (model.DisciplineId.HasValue) + { + query = query.Where(x => x.DisciplineId == model.DisciplineId.Value); + } + if (model.Semester.HasValue) + { + query = query.Where(x => x.Semester == (int)model.Semester.Value); + } + return query; + } + + protected override OperationResultModel AdditionalCheckingWhenUpdateing(DbContext context, AcademicPlanRecordSetBindingModel model) => OperationResultModel.Success(null); + + protected override void AdditionalDeleting(DbContext context, AcademicPlanRecord entity, AcademicPlanRecordGetBindingModel model) + { + var hours = context.Set().Where(x => x.AcademicPlanRecordId == model.Id); + foreach (var hour in hours) + { + hour.IsDeleted = true; + hour.DateDelete = DateTime.Now; + } + context.SaveChanges(); + } + + protected override AcademicPlanRecord GetUniqueEntity(AcademicPlanRecordSetBindingModel model, DbContext context) => context.Set().FirstOrDefault(x => x.AcademicPlanId == model.AcademicPlanId && x.DisciplineId == model.DisciplineId && x.Semester == (int)model.Semester && x.Id != model.Id); + + protected override IQueryable IncludingWhenReading(IQueryable query) => query.Include(x => x.AcademicPlan).Include(x => x.Discipline); + + protected override IQueryable OrderingWhenReading(IQueryable query) => + query.OrderBy(x => x.AcademicPlanId).ThenBy(x => x.Semester).ThenBy(x => x.AcademicPlanRecordParentId.HasValue || x.IsParent).ThenBy(x => x.AcademicPlanRecordParentId.HasValue).ThenBy(x => x.Discipline.DisciplineName); + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/AcademicPlanRecordTimeNormHourService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/AcademicPlanRecordTimeNormHourService.cs new file mode 100644 index 0000000..2bad659 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/AcademicPlanRecordTimeNormHourService.cs @@ -0,0 +1,46 @@ +using DatabaseCore; +using DatabaseCore.Models.Department; +using DepartmentBusinessLogic.BindingModels; +using DepartmentBusinessLogic.Interfaces; +using DepartmentBusinessLogic.ViewModels; +using Microsoft.EntityFrameworkCore; +using ModuleTools.Models; +using System.Linq; + +namespace DepartmentDatabaseImplementation.Implementations +{ + /// + /// Реализация IAcademicPlanRecordTimeNormHourService + /// + public class AcademicPlanRecordTimeNormHourService : + AbstractGenerticEntityService, + IAcademicPlanRecordTimeNormHourService + { + protected override OperationResultModel AdditionalCheckingWhenAdding(DbContext context, AcademicPlanRecordTimeNormHourSetBindingModel model) => OperationResultModel.Success(null); + + protected override OperationResultModel AdditionalCheckingWhenDeleting(DbContext context, AcademicPlanRecordTimeNormHour entity, AcademicPlanRecordTimeNormHourGetBindingModel model) => OperationResultModel.Success(null); + + protected override IQueryable AdditionalCheckingWhenReadingList(IQueryable query, AcademicPlanRecordTimeNormHourGetBindingModel model) + { + if (model.AcademicPlanRecordId.HasValue) + { + query = query.Where(x => x.AcademicPlanRecordId == model.AcademicPlanRecordId.Value); + } + if (model.TimeNormId.HasValue) + { + query = query.Where(x => x.TimeNormId == model.TimeNormId.Value); + } + return query; + } + + protected override OperationResultModel AdditionalCheckingWhenUpdateing(DbContext context, AcademicPlanRecordTimeNormHourSetBindingModel model) => OperationResultModel.Success(null); + + protected override void AdditionalDeleting(DbContext context, AcademicPlanRecordTimeNormHour entity, AcademicPlanRecordTimeNormHourGetBindingModel model) { } + + protected override AcademicPlanRecordTimeNormHour GetUniqueEntity(AcademicPlanRecordTimeNormHourSetBindingModel model, DbContext context) => context.Set().FirstOrDefault(x => x.AcademicPlanRecordId == model.AcademicPlanRecordId && x.TimeNormId == model.TimeNormId && x.Id != model.Id); + + protected override IQueryable IncludingWhenReading(IQueryable query) => query.Include(x => x.AcademicPlanRecord).Include(x => x.AcademicPlanRecord.Discipline).Include(x => x.TimeNorm); + + protected override IQueryable OrderingWhenReading(IQueryable query) => query.OrderBy(x => x.AcademicPlanRecord.Semester).ThenBy(x => x.AcademicPlanRecord.Discipline.DisciplineName).ThenBy(x => x.TimeNorm.TimeNormOrder); + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/AcademicPlanService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/AcademicPlanService.cs new file mode 100644 index 0000000..592fb1c --- /dev/null +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/AcademicPlanService.cs @@ -0,0 +1,60 @@ +using DatabaseCore; +using DatabaseCore.Models.Department; +using DepartmentBusinessLogic.BindingModels; +using DepartmentBusinessLogic.Interfaces; +using DepartmentBusinessLogic.ViewModels; +using Microsoft.EntityFrameworkCore; +using ModuleTools.Models; +using System; +using System.Linq; + +namespace DepartmentDatabaseImplementation.Implementations +{ + /// + /// Реализация IAcademicPlanService + /// + public class AcademicPlanService : + AbstractGenerticEntityService, + IAcademicPlanService + { + protected override OperationResultModel AdditionalCheckingWhenAdding(DbContext context, AcademicPlanSetBindingModel model) => OperationResultModel.Success(null); + + protected override OperationResultModel AdditionalCheckingWhenDeleting(DbContext context, AcademicPlan entity, AcademicPlanGetBindingModel model) => OperationResultModel.Success(null); + + protected override IQueryable AdditionalCheckingWhenReadingList(IQueryable query, AcademicPlanGetBindingModel model) + { + if (model.EducationDirectionId.HasValue) + { + query = query.Where(x => x.EducationDirectionId == model.EducationDirectionId.Value); + } + return query; + } + + protected override OperationResultModel AdditionalCheckingWhenUpdateing(DbContext context, AcademicPlanSetBindingModel model) => OperationResultModel.Success(null); + + protected override void AdditionalDeleting(DbContext context, AcademicPlan entity, AcademicPlanGetBindingModel model) + { + var records = context.Set().Where(x => x.AcademicPlanId == model.Id); + foreach (var record in records) + { + var hours = context.Set().Where(x => x.AcademicPlanRecordId == record.Id); + foreach (var hour in hours) + { + hour.IsDeleted = true; + hour.DateDelete = DateTime.Now; + } + context.SaveChanges(); + + record.IsDeleted = true; + record.DateDelete = DateTime.Now; + } + context.SaveChanges(); + } + + protected override AcademicPlan GetUniqueEntity(AcademicPlanSetBindingModel model, DbContext context) => context.Set().FirstOrDefault(x => x.EducationDirectionId == model.EducationDirectionId && x.YearEntrance == model.YearEntrance && x.Id != model.Id); + + protected override IQueryable IncludingWhenReading(IQueryable query) => query.Include(x => x.EducationDirection); + + protected override IQueryable OrderingWhenReading(IQueryable query) => query.OrderBy(x => x.EducationDirection.Cipher).ThenBy(x => x.YearEntrance); + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/DisciplineBlockService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/DisciplineBlockService.cs index 620e46a..6b62199 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/DisciplineBlockService.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/DisciplineBlockService.cs @@ -25,6 +25,10 @@ namespace DepartmentDatabaseImplementation.Implementations { return OperationResultModel.Error("Error:", "Есть дисциплины, относящиеся к этому блоку", ResultServiceStatusCode.ExsistItem); } + if (context.Set().Any(x => x.DisciplineBlockId == model.Id && !x.IsDeleted)) + { + return OperationResultModel.Error("Error:", "Есть нормы времени, относящиеся к этому блоку", ResultServiceStatusCode.ExsistItem); + } return OperationResultModel.Success(null); } diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/DisciplineService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/DisciplineService.cs index 1269465..d2f5b1d 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/DisciplineService.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/DisciplineService.cs @@ -4,6 +4,7 @@ using DepartmentBusinessLogic.BindingModels; using DepartmentBusinessLogic.Interfaces; using DepartmentBusinessLogic.ViewModels; using Microsoft.EntityFrameworkCore; +using ModuleTools.Enums; using ModuleTools.Extensions; using ModuleTools.Models; using System.Linq; @@ -19,7 +20,14 @@ namespace DepartmentDatabaseImplementation.Implementations { protected override OperationResultModel AdditionalCheckingWhenAdding(DbContext context, DisciplineSetBindingModel model) => OperationResultModel.Success(null); - protected override OperationResultModel AdditionalCheckingWhenDeleting(DbContext context, Discipline entity, DisciplineGetBindingModel model) => OperationResultModel.Success(null); + protected override OperationResultModel AdditionalCheckingWhenDeleting(DbContext context, Discipline entity, DisciplineGetBindingModel model) + { + if (context.Set().Any(x => x.DisciplineId == model.Id && !x.IsDeleted)) + { + return OperationResultModel.Error("Error:", "Есть записи учебного плана, относящиеся к этой дисциплине", ResultServiceStatusCode.ExsistItem); + } + return OperationResultModel.Success(null); + } protected override IQueryable AdditionalCheckingWhenReadingList(IQueryable query, DisciplineGetBindingModel model) { diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/EducationDirectionService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/EducationDirectionService.cs index cd6eb7a..8a3d410 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/EducationDirectionService.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/EducationDirectionService.cs @@ -4,6 +4,7 @@ using DepartmentBusinessLogic.BindingModels; using DepartmentBusinessLogic.Interfaces; using DepartmentBusinessLogic.ViewModels; using Microsoft.EntityFrameworkCore; +using ModuleTools.Enums; using ModuleTools.Models; using System; using System.Linq; @@ -19,7 +20,14 @@ namespace DepartmentDatabaseImplementation.Implementations { protected override OperationResultModel AdditionalCheckingWhenAdding(DbContext context, EducationDirectionSetBindingModel model) => OperationResultModel.Success(null); - protected override OperationResultModel AdditionalCheckingWhenDeleting(DbContext context, EducationDirection entity, EducationDirectionGetBindingModel model) => OperationResultModel.Success(null); + protected override OperationResultModel AdditionalCheckingWhenDeleting(DbContext context, EducationDirection entity, EducationDirectionGetBindingModel model) + { + if (context.Set().Any(x => x.EducationDirectionId == model.Id && !x.IsDeleted)) + { + return OperationResultModel.Error("Error:", "Есть учебные планы, относящиеся к этому направлению", ResultServiceStatusCode.ExsistItem); + } + return OperationResultModel.Success(null); + } protected override IQueryable AdditionalCheckingWhenReadingList(IQueryable query, EducationDirectionGetBindingModel model) { diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/PostService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/PostService.cs index 9fa9170..0883ea9 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/PostService.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/PostService.cs @@ -11,7 +11,7 @@ using System.Linq; namespace DepartmentDatabaseImplementation.Implementations { /// - /// Реализация IEmployeePostService + /// Реализация IPostService /// public class PostService : AbstractGenerticEntityService, diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/TimeNormService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/TimeNormService.cs new file mode 100644 index 0000000..9c8cfbb --- /dev/null +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/TimeNormService.cs @@ -0,0 +1,45 @@ +using DatabaseCore; +using DatabaseCore.Models.Department; +using DepartmentBusinessLogic.BindingModels; +using DepartmentBusinessLogic.Interfaces; +using DepartmentBusinessLogic.ViewModels; +using Microsoft.EntityFrameworkCore; +using ModuleTools.Models; +using System.Linq; + +namespace DepartmentDatabaseImplementation.Implementations +{ + /// + /// Реализация ITimeNormService + /// + public class TimeNormService : + AbstractGenerticEntityService, + ITimeNormService + { + protected override OperationResultModel AdditionalCheckingWhenAdding(DbContext context, TimeNormSetBindingModel model) => OperationResultModel.Success(null); + + protected override OperationResultModel AdditionalCheckingWhenDeleting(DbContext context, TimeNorm entity, TimeNormGetBindingModel model) + { + return OperationResultModel.Success(null); + } + + protected override IQueryable AdditionalCheckingWhenReadingList(IQueryable query, TimeNormGetBindingModel model) + { + if (model.DisciplineBlockId.HasValue) + { + query = query.Where(x => x.DisciplineBlockId == model.DisciplineBlockId.Value); + } + return query; + } + + protected override OperationResultModel AdditionalCheckingWhenUpdateing(DbContext context, TimeNormSetBindingModel model) => OperationResultModel.Success(null); + + protected override void AdditionalDeleting(DbContext context, TimeNorm entity, TimeNormGetBindingModel model) { } + + protected override TimeNorm GetUniqueEntity(TimeNormSetBindingModel model, DbContext context) => context.Set().FirstOrDefault(x => x.TimeNormName == model.TimeNormName && x.TimeNormShortName == model.TimeNormShortName && x.Id != model.Id); + + protected override IQueryable IncludingWhenReading(IQueryable query) => query.Include(x => x.DisciplineBlock); + + protected override IQueryable OrderingWhenReading(IQueryable query) => query.OrderBy(x => x.TimeNormOrder); + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/DepartmentWindowDesktopExtension.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/DepartmentWindowDesktopExtension.cs index 2787a45..d76fc6b 100644 --- a/DepartmentPortal/Department/DepartmentWindowsDesktop/DepartmentWindowDesktopExtension.cs +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/DepartmentWindowDesktopExtension.cs @@ -40,7 +40,9 @@ namespace DepartmentWindowsDesktop new ControlLecturerAcademicDegreeList(), new ControlLecturerAcademicRankList(), new ControlLecturerList(), - new ControlEducationDirectionList() + new ControlEducationDirectionList(), + new ControlTimeNormList(), + new ControlAcademicPlanList() }; foreach (var cntrl in _controls) diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlan/ControlAcademicPlanElement.Designer.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlan/ControlAcademicPlanElement.Designer.cs new file mode 100644 index 0000000..e7544bc --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlan/ControlAcademicPlanElement.Designer.cs @@ -0,0 +1,33 @@ + +namespace DepartmentWindowsDesktop.EntityControls +{ + partial class ControlAcademicPlanElement + { + /// + /// Освободить все используемые ресурсы. + /// + /// истинно, если управляемый ресурс должен быть удален; иначе ложно. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Код, автоматически созданный конструктором компонентов + + /// + /// Требуемый метод для поддержки конструктора — не изменяйте + /// содержимое этого метода с помощью редактора кода. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + } + + #endregion + } +} diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlan/ControlAcademicPlanElement.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlan/ControlAcademicPlanElement.cs new file mode 100644 index 0000000..da81eee --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlan/ControlAcademicPlanElement.cs @@ -0,0 +1,27 @@ +using DepartmentBusinessLogic.BindingModels; +using DepartmentBusinessLogic.BusinessLogics; +using DepartmentBusinessLogic.ViewModels; +using DesktopTools.Controls; +using DesktopTools.Interfaces; +using System; + +namespace DepartmentWindowsDesktop.EntityControls +{ + /// + /// Реализация контрола для учебного плана + /// + public partial class ControlAcademicPlanElement : + GenericControlEntityElement, + IGenericControlEntityElement + { + public ControlAcademicPlanElement() + { + InitializeComponent(); + Title = "Учебный план"; + ControlId = new Guid("bdba8fca-4c38-49cf-89b0-4906c4aa7aa3"); + _genericControlViewEntityElement = this; + } + + public IControl GetInstanceGenericControl() => new ControlAcademicPlanElement() { ControlId = Guid.NewGuid() }; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlan/ControlAcademicPlanElement.resx b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlan/ControlAcademicPlanElement.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlan/ControlAcademicPlanElement.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlan/ControlAcademicPlanList.Designer.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlan/ControlAcademicPlanList.Designer.cs new file mode 100644 index 0000000..e06971e --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlan/ControlAcademicPlanList.Designer.cs @@ -0,0 +1,33 @@ + +namespace DepartmentWindowsDesktop.EntityControls +{ + partial class ControlAcademicPlanList + { + /// + /// Освободить все используемые ресурсы. + /// + /// истинно, если управляемый ресурс должен быть удален; иначе ложно. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Код, автоматически созданный конструктором компонентов + + /// + /// Требуемый метод для поддержки конструктора — не изменяйте + /// содержимое этого метода с помощью редактора кода. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + } + + #endregion + } +} diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlan/ControlAcademicPlanList.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlan/ControlAcademicPlanList.cs new file mode 100644 index 0000000..a862058 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlan/ControlAcademicPlanList.cs @@ -0,0 +1,42 @@ +using DepartmentBusinessLogic.BindingModels; +using DepartmentBusinessLogic.BusinessLogics; +using DepartmentBusinessLogic.ViewModels; +using DesktopTools.Controls; +using DesktopTools.Enums; +using DesktopTools.Interfaces; +using DesktopTools.Models; +using ModuleTools.Enums; +using System; +using System.Collections.Generic; + +namespace DepartmentWindowsDesktop.EntityControls +{ + /// + /// Реализация контрола для списка учебных планов + /// + public partial class ControlAcademicPlanList : + GenericControlEntityList, + IGenericControlEntityList + { + public ControlAcademicPlanList() + { + InitializeComponent(); + Title = "Учебнве планы"; + ControlId = new Guid("144d098c-ff55-4786-ae63-3105a92990cd"); + AccessOperation = AccessOperation.УчебныеПланы; + ControlViewEntityElement = new ControlAcademicPlanElement(); + _genericControlViewEntityList = this; + } + + public IControl GetInstanceGenericControl() => new ControlAcademicPlanList() { ControlId = Guid.NewGuid() }; + + public ControlViewEntityListConfiguration GetConfigControl() => new() + { + PaginationOn = false, + HideToolStripButton = new List + { + ToolStripButtonListNames.toolStripButtonSearch + } + }; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlan/ControlAcademicPlanList.resx b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlan/ControlAcademicPlanList.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlan/ControlAcademicPlanList.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecord/ControlAcademicPlanRecordElement.Designer.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecord/ControlAcademicPlanRecordElement.Designer.cs new file mode 100644 index 0000000..61a2232 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecord/ControlAcademicPlanRecordElement.Designer.cs @@ -0,0 +1,33 @@ + +namespace DepartmentWindowsDesktop.EntityControls +{ + partial class ControlAcademicPlanRecordElement + { + /// + /// Освободить все используемые ресурсы. + /// + /// истинно, если управляемый ресурс должен быть удален; иначе ложно. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Код, автоматически созданный конструктором компонентов + + /// + /// Требуемый метод для поддержки конструктора — не изменяйте + /// содержимое этого метода с помощью редактора кода. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + } + + #endregion + } +} diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecord/ControlAcademicPlanRecordElement.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecord/ControlAcademicPlanRecordElement.cs new file mode 100644 index 0000000..aa04dd5 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecord/ControlAcademicPlanRecordElement.cs @@ -0,0 +1,27 @@ +using DepartmentBusinessLogic.BindingModels; +using DepartmentBusinessLogic.BusinessLogics; +using DepartmentBusinessLogic.ViewModels; +using DesktopTools.Controls; +using DesktopTools.Interfaces; +using System; + +namespace DepartmentWindowsDesktop.EntityControls +{ + /// + /// Реализация контрола для записи учебного плана + /// + public partial class ControlAcademicPlanRecordElement : + GenericControlEntityElement, + IGenericControlEntityElement + { + public ControlAcademicPlanRecordElement() + { + InitializeComponent(); + Title = "Запись учебного планаs"; + ControlId = new Guid("0b6a43e8-c9a6-42c0-a3f3-f7e75b16d2f4"); + _genericControlViewEntityElement = this; + } + + public IControl GetInstanceGenericControl() => new ControlAcademicPlanRecordElement() { ControlId = Guid.NewGuid() }; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecord/ControlAcademicPlanRecordElement.resx b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecord/ControlAcademicPlanRecordElement.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecord/ControlAcademicPlanRecordElement.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecord/ControlAcademicPlanRecordList.Designer.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecord/ControlAcademicPlanRecordList.Designer.cs new file mode 100644 index 0000000..5567b1d --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecord/ControlAcademicPlanRecordList.Designer.cs @@ -0,0 +1,33 @@ + +namespace DepartmentWindowsDesktop.EntityControls +{ + partial class ControlAcademicPlanRecordList + { + /// + /// Освободить все используемые ресурсы. + /// + /// истинно, если управляемый ресурс должен быть удален; иначе ложно. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Код, автоматически созданный конструктором компонентов + + /// + /// Требуемый метод для поддержки конструктора — не изменяйте + /// содержимое этого метода с помощью редактора кода. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + } + + #endregion + } +} diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecord/ControlAcademicPlanRecordList.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecord/ControlAcademicPlanRecordList.cs new file mode 100644 index 0000000..919dc26 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecord/ControlAcademicPlanRecordList.cs @@ -0,0 +1,51 @@ +using DepartmentBusinessLogic.BindingModels; +using DepartmentBusinessLogic.BusinessLogics; +using DepartmentBusinessLogic.Enums; +using DepartmentBusinessLogic.ViewModels; +using DesktopTools.Controls; +using DesktopTools.Enums; +using DesktopTools.Interfaces; +using DesktopTools.Models; +using ModuleTools.Enums; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; + +namespace DepartmentWindowsDesktop.EntityControls +{ + /// + /// Реализация контрола для записей учебного плана + /// + public partial class ControlAcademicPlanRecordList : + GenericControlEntityList, + IGenericControlEntityList + { + public ControlAcademicPlanRecordList() + { + InitializeComponent(); + Title = "Записи учебного плана"; + ControlId = new Guid("6513cc00-4ac1-4420-b941-dcd199faecad"); + AccessOperation = AccessOperation.Аудитории; + ControlViewEntityElement = new ControlAcademicPlanRecordElement(); + _genericControlViewEntityList = this; + } + + public IControl GetInstanceGenericControl() => new ControlAcademicPlanRecordList() { ControlId = Guid.NewGuid() }; + + public ControlViewEntityListConfiguration GetConfigControl() => new() + { + PaginationOn = true, + PageNamesForPagination = Enum.GetValues(typeof(Semester)).OfType().ToList().Select(x => + new PageNamesForPaginationModel + { + Key = x, + Value = x.ToString() + })?.ToList(), + HideToolStripButton = new List + { + ToolStripButtonListNames.toolStripButtonSearch + } + }; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecord/ControlAcademicPlanRecordList.resx b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecord/ControlAcademicPlanRecordList.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecord/ControlAcademicPlanRecordList.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecordTimeNormHour/ControlAcademicPlanRecordTimeNormHourElement.Designer.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecordTimeNormHour/ControlAcademicPlanRecordTimeNormHourElement.Designer.cs new file mode 100644 index 0000000..fd6c7b0 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecordTimeNormHour/ControlAcademicPlanRecordTimeNormHourElement.Designer.cs @@ -0,0 +1,33 @@ + +namespace DepartmentWindowsDesktop.EntityControls +{ + partial class ControlAcademicPlanRecordTimeNormHourElement + { + /// + /// Освободить все используемые ресурсы. + /// + /// истинно, если управляемый ресурс должен быть удален; иначе ложно. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Код, автоматически созданный конструктором компонентов + + /// + /// Требуемый метод для поддержки конструктора — не изменяйте + /// содержимое этого метода с помощью редактора кода. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + } + + #endregion + } +} diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecordTimeNormHour/ControlAcademicPlanRecordTimeNormHourElement.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecordTimeNormHour/ControlAcademicPlanRecordTimeNormHourElement.cs new file mode 100644 index 0000000..9ff327f --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecordTimeNormHour/ControlAcademicPlanRecordTimeNormHourElement.cs @@ -0,0 +1,27 @@ +using DepartmentBusinessLogic.BindingModels; +using DepartmentBusinessLogic.BusinessLogics; +using DepartmentBusinessLogic.ViewModels; +using DesktopTools.Controls; +using DesktopTools.Interfaces; +using System; + +namespace DepartmentWindowsDesktop.EntityControls +{ + /// + /// Реализация контрола для часов нагрузки записи учебного плана + /// + public partial class ControlAcademicPlanRecordTimeNormHourElement : + GenericControlEntityElement, + IGenericControlEntityElement + { + public ControlAcademicPlanRecordTimeNormHourElement() + { + InitializeComponent(); + Title = "Часы нагрузки записи учебного плана"; + ControlId = new Guid("3c2d4cca-2b04-4207-96ff-3ffa7f9b5584"); + _genericControlViewEntityElement = this; + } + + public IControl GetInstanceGenericControl() => new ControlAcademicPlanRecordTimeNormHourElement() { ControlId = Guid.NewGuid() }; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecordTimeNormHour/ControlAcademicPlanRecordTimeNormHourElement.resx b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecordTimeNormHour/ControlAcademicPlanRecordTimeNormHourElement.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecordTimeNormHour/ControlAcademicPlanRecordTimeNormHourElement.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecordTimeNormHour/ControlAcademicPlanRecordTimeNormHourList.Designer.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecordTimeNormHour/ControlAcademicPlanRecordTimeNormHourList.Designer.cs new file mode 100644 index 0000000..6dbd92c --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecordTimeNormHour/ControlAcademicPlanRecordTimeNormHourList.Designer.cs @@ -0,0 +1,38 @@ + +namespace DepartmentWindowsDesktop.EntityControls +{ + partial class ControlAcademicPlanRecordTimeNormHourList + { + /// + /// Обязательная переменная конструктора. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Освободить все используемые ресурсы. + /// + /// истинно, если управляемый ресурс должен быть удален; иначе ложно. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Код, автоматически созданный конструктором компонентов + + /// + /// Требуемый метод для поддержки конструктора — не изменяйте + /// содержимое этого метода с помощью редактора кода. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + } + + #endregion + } +} diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecordTimeNormHour/ControlAcademicPlanRecordTimeNormHourList.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecordTimeNormHour/ControlAcademicPlanRecordTimeNormHourList.cs new file mode 100644 index 0000000..2fa9afb --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecordTimeNormHour/ControlAcademicPlanRecordTimeNormHourList.cs @@ -0,0 +1,39 @@ +using DepartmentBusinessLogic.BindingModels; +using DepartmentBusinessLogic.BusinessLogics; +using DepartmentBusinessLogic.ViewModels; +using DesktopTools.Controls; +using DesktopTools.Enums; +using DesktopTools.Interfaces; +using DesktopTools.Models; +using ModuleTools.Enums; +using System; +using System.Collections.Generic; + +namespace DepartmentWindowsDesktop.EntityControls +{ + public partial class ControlAcademicPlanRecordTimeNormHourList : + GenericControlEntityList, + IGenericControlEntityList + { + public ControlAcademicPlanRecordTimeNormHourList() + { + InitializeComponent(); + Title = "Часы нагрузок записи учебного плана"; + ControlId = new Guid("c23a7c9c-af28-4d59-b378-50f59678a7f7"); + AccessOperation = AccessOperation.УчебныеПланы; + ControlViewEntityElement = new ControlAcademicPlanRecordTimeNormHourElement(); + _genericControlViewEntityList = this; + } + + public IControl GetInstanceGenericControl() => new ControlAcademicPlanRecordTimeNormHourList() { ControlId = Guid.NewGuid() }; + + public ControlViewEntityListConfiguration GetConfigControl() => new() + { + PaginationOn = false, + HideToolStripButton = new List + { + ToolStripButtonListNames.toolStripButtonSearch + } + }; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecordTimeNormHour/ControlAcademicPlanRecordTimeNormHourList.resx b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecordTimeNormHour/ControlAcademicPlanRecordTimeNormHourList.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/AcademicPlanRecordTimeNormHour/ControlAcademicPlanRecordTimeNormHourList.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/TimeNorm/ControlTimeNormElement.Designer.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/TimeNorm/ControlTimeNormElement.Designer.cs new file mode 100644 index 0000000..12028c3 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/TimeNorm/ControlTimeNormElement.Designer.cs @@ -0,0 +1,33 @@ + +namespace DepartmentWindowsDesktop.EntityControls +{ + partial class ControlTimeNormElement + { + /// + /// Освободить все используемые ресурсы. + /// + /// истинно, если управляемый ресурс должен быть удален; иначе ложно. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Код, автоматически созданный конструктором компонентов + + /// + /// Требуемый метод для поддержки конструктора — не изменяйте + /// содержимое этого метода с помощью редактора кода. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + } + + #endregion + } +} diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/TimeNorm/ControlTimeNormElement.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/TimeNorm/ControlTimeNormElement.cs new file mode 100644 index 0000000..c8cbe2d --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/TimeNorm/ControlTimeNormElement.cs @@ -0,0 +1,27 @@ +using DepartmentBusinessLogic.BindingModels; +using DepartmentBusinessLogic.BusinessLogics; +using DepartmentBusinessLogic.ViewModels; +using DesktopTools.Controls; +using DesktopTools.Interfaces; +using System; + +namespace DepartmentWindowsDesktop.EntityControls +{ + /// + /// Реализация контрола для нормы времени + /// + public partial class ControlTimeNormElement : + GenericControlEntityElement, + IGenericControlEntityElement + { + public ControlTimeNormElement() + { + InitializeComponent(); + Title = "Норма времени"; + ControlId = new Guid("17e65fa1-e809-45fe-b21c-dbd2ecd53194"); + _genericControlViewEntityElement = this; + } + + public IControl GetInstanceGenericControl() => new ControlTimeNormElement() { ControlId = Guid.NewGuid() }; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/TimeNorm/ControlTimeNormElement.resx b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/TimeNorm/ControlTimeNormElement.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/TimeNorm/ControlTimeNormElement.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/TimeNorm/ControlTimeNormList.Designer.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/TimeNorm/ControlTimeNormList.Designer.cs new file mode 100644 index 0000000..752279e --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/TimeNorm/ControlTimeNormList.Designer.cs @@ -0,0 +1,33 @@ + +namespace DepartmentWindowsDesktop.EntityControls +{ + partial class ControlTimeNormList + { + /// + /// Освободить все используемые ресурсы. + /// + /// истинно, если управляемый ресурс должен быть удален; иначе ложно. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Код, автоматически созданный конструктором компонентов + + /// + /// Требуемый метод для поддержки конструктора — не изменяйте + /// содержимое этого метода с помощью редактора кода. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + } + + #endregion + } +} diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/TimeNorm/ControlTimeNormList.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/TimeNorm/ControlTimeNormList.cs new file mode 100644 index 0000000..bed2a18 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/TimeNorm/ControlTimeNormList.cs @@ -0,0 +1,42 @@ +using DepartmentBusinessLogic.BindingModels; +using DepartmentBusinessLogic.BusinessLogics; +using DepartmentBusinessLogic.ViewModels; +using DesktopTools.Controls; +using DesktopTools.Enums; +using DesktopTools.Interfaces; +using DesktopTools.Models; +using ModuleTools.Enums; +using System; +using System.Collections.Generic; + +namespace DepartmentWindowsDesktop.EntityControls +{ + /// + /// Реализация контрола для списка норм времени + /// + public partial class ControlTimeNormList : + GenericControlEntityList, + IGenericControlEntityList + { + public ControlTimeNormList() + { + InitializeComponent(); + Title = "Нормы времени"; + ControlId = new Guid("973e071f-b47a-4eef-bec6-6cbc63ecb5f5"); + AccessOperation = AccessOperation.НормыВремени; + ControlViewEntityElement = new ControlTimeNormElement(); + _genericControlViewEntityList = this; + } + + public IControl GetInstanceGenericControl() => new ControlTimeNormList() { ControlId = Guid.NewGuid() }; + + public ControlViewEntityListConfiguration GetConfigControl() => new() + { + PaginationOn = false, + HideToolStripButton = new List + { + ToolStripButtonListNames.toolStripButtonSearch + } + }; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/TimeNorm/ControlTimeNormList.resx b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/TimeNorm/ControlTimeNormList.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/TimeNorm/ControlTimeNormList.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file