From d5319759e22e24ffd8bd5c6591cadbe62b636d3c Mon Sep 17 00:00:00 2001 From: kotcheshir73 Date: Mon, 12 Apr 2021 10:01:42 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D0=B3=D1=80=D1=83=D0=BF=D0=BF=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Common/DatabaseCore/DatabaseContext.cs | 3 + ...0210412051258_AddStudentGroups.Designer.cs | 1187 +++++++++++++++++ .../20210412051258_AddStudentGroups.cs | 81 ++ .../DatabaseContextModelSnapshot.cs | 57 + .../Models/Department/AcademicPlan.cs | 3 + .../Models/Department/Lecturer.cs | 3 + .../Models/Department/StudentGroup.cs | 49 + .../BaseControls/BaseControlDecimal.cs | 6 +- .../BaseControls/BaseControlInt.cs | 6 +- ...iewModelControlElementPropertyAttribute.cs | 4 +- .../ModuleTools/Enums/AccessOperation.cs | 2 +- .../StudentGroupBindingModels.cs | 38 + .../StudentGroupBusinessLogic.cs | 16 + .../Interfaces/IStudentGroupService.cs | 10 + .../ViewModels/AcademicPlanViewModels.cs | 6 + .../ViewModels/LecturerViewModels.cs | 2 + .../ViewModels/StudentGroupViewModels.cs | 61 + .../DepartmentImplementationExtensions.cs | 2 + .../Implementations/AcademicPlanService.cs | 9 +- .../Implementations/LecturerService.cs | 4 + .../Implementations/StudentGroupService.cs | 50 + .../DepartmentWindowDesktopExtension.cs | 3 +- .../ControlStudentGroupElement.Designer.cs | 33 + .../ControlStudentGroupElement.cs | 30 + .../ControlStudentGroupElement.resx | 120 ++ .../ControlStudentGroupList.Designer.cs | 33 + .../StudentGroup/ControlStudentGroupList.cs | 42 + .../StudentGroup/ControlStudentGroupList.resx | 120 ++ 28 files changed, 1969 insertions(+), 11 deletions(-) create mode 100644 DepartmentPortal/Common/DatabaseCore/Migrations/20210412051258_AddStudentGroups.Designer.cs create mode 100644 DepartmentPortal/Common/DatabaseCore/Migrations/20210412051258_AddStudentGroups.cs create mode 100644 DepartmentPortal/Common/DatabaseCore/Models/Department/StudentGroup.cs create mode 100644 DepartmentPortal/Department/DepartmentBusinessLogic/BindingModels/StudentGroupBindingModels.cs create mode 100644 DepartmentPortal/Department/DepartmentBusinessLogic/BusinessLogics/StudentGroupBusinessLogic.cs create mode 100644 DepartmentPortal/Department/DepartmentBusinessLogic/Interfaces/IStudentGroupService.cs create mode 100644 DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/StudentGroupViewModels.cs create mode 100644 DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/StudentGroupService.cs create mode 100644 DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/StudentGroup/ControlStudentGroupElement.Designer.cs create mode 100644 DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/StudentGroup/ControlStudentGroupElement.cs create mode 100644 DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/StudentGroup/ControlStudentGroupElement.resx create mode 100644 DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/StudentGroup/ControlStudentGroupList.Designer.cs create mode 100644 DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/StudentGroup/ControlStudentGroupList.cs create mode 100644 DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/StudentGroup/ControlStudentGroupList.resx diff --git a/DepartmentPortal/Common/DatabaseCore/DatabaseContext.cs b/DepartmentPortal/Common/DatabaseCore/DatabaseContext.cs index bd1a15f..c9d192c 100644 --- a/DepartmentPortal/Common/DatabaseCore/DatabaseContext.cs +++ b/DepartmentPortal/Common/DatabaseCore/DatabaseContext.cs @@ -57,6 +57,8 @@ namespace DatabaseCore modelBuilder.Entity().HasIndex(d => new { d.AcademicPlanId, d.DisciplineId, d.Semester }).IsUnique(); modelBuilder.Entity().HasIndex(d => new { d.AcademicPlanRecordId, d.TimeNormId }).IsUnique(); + + modelBuilder.Entity().HasIndex(d => new { d.AcademicPlanId, d.EnrollmentYear, d.GroupNumber }).IsUnique(); } #region Security @@ -83,6 +85,7 @@ namespace DatabaseCore public virtual DbSet AcademicPlans { set; get; } public virtual DbSet AcademicPlanRecords { set; get; } public virtual DbSet AcademicPlanRecordTimeNormHours { set; get; } + public virtual DbSet StudentGroups { set; get; } #endregion } } \ No newline at end of file diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/20210412051258_AddStudentGroups.Designer.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210412051258_AddStudentGroups.Designer.cs new file mode 100644 index 0000000..c274f1d --- /dev/null +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210412051258_AddStudentGroups.Designer.cs @@ -0,0 +1,1187 @@ +// +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("20210412051258_AddStudentGroups")] + partial class AddStudentGroups + { + 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() + .HasFilter("[EducationDirectionId] IS NOT NULL"); + + 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.StudentGroup", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EnrollmentYear") + .HasColumnType("int"); + + b.Property("GroupNumber") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("LecturerId"); + + b.HasIndex("AcademicPlanId", "EnrollmentYear", "GroupNumber") + .IsUnique(); + + b.ToTable("StudentGroups"); + }); + + 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"); + + 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.StudentGroup", b => + { + b.HasOne("DatabaseCore.Models.Department.AcademicPlan", "AcademicPlan") + .WithMany("StudentGroups") + .HasForeignKey("AcademicPlanId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + .WithMany("StudentGroups") + .HasForeignKey("LecturerId"); + + b.Navigation("AcademicPlan"); + + b.Navigation("Lecturer"); + }); + + 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"); + + b.Navigation("StudentGroups"); + }); + + 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"); + + b.Navigation("StudentGroups"); + }); + + 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/20210412051258_AddStudentGroups.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/20210412051258_AddStudentGroups.cs new file mode 100644 index 0000000..e873850 --- /dev/null +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/20210412051258_AddStudentGroups.cs @@ -0,0 +1,81 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace DatabaseCore.Migrations +{ + public partial class AddStudentGroups : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_AcademicPlanRecordTimeNormHours_TimeNorms_TimeNormId", + table: "AcademicPlanRecordTimeNormHours"); + + migrationBuilder.CreateTable( + name: "StudentGroups", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + AcademicPlanId = table.Column(type: "uniqueidentifier", nullable: false), + GroupNumber = table.Column(type: "int", nullable: false), + EnrollmentYear = table.Column(type: "int", nullable: false), + LecturerId = table.Column(type: "uniqueidentifier", nullable: true), + 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_StudentGroups", x => x.Id); + table.ForeignKey( + name: "FK_StudentGroups_AcademicPlans_AcademicPlanId", + column: x => x.AcademicPlanId, + principalTable: "AcademicPlans", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_StudentGroups_Lecturers_LecturerId", + column: x => x.LecturerId, + principalTable: "Lecturers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateIndex( + name: "IX_StudentGroups_AcademicPlanId_EnrollmentYear_GroupNumber", + table: "StudentGroups", + columns: new[] { "AcademicPlanId", "EnrollmentYear", "GroupNumber" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_StudentGroups_LecturerId", + table: "StudentGroups", + column: "LecturerId"); + + 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.DropTable( + name: "StudentGroups"); + + migrationBuilder.AddForeignKey( + name: "FK_AcademicPlanRecordTimeNormHours_TimeNorms_TimeNormId", + table: "AcademicPlanRecordTimeNormHours", + column: "TimeNormId", + principalTable: "TimeNorms", + principalColumn: "Id"); + } + } +} diff --git a/DepartmentPortal/Common/DatabaseCore/Migrations/DatabaseContextModelSnapshot.cs b/DepartmentPortal/Common/DatabaseCore/Migrations/DatabaseContextModelSnapshot.cs index 5e02c27..b508c1a 100644 --- a/DepartmentPortal/Common/DatabaseCore/Migrations/DatabaseContextModelSnapshot.cs +++ b/DepartmentPortal/Common/DatabaseCore/Migrations/DatabaseContextModelSnapshot.cs @@ -623,6 +623,42 @@ namespace DatabaseCore.Migrations b.ToTable("Posts"); }); + modelBuilder.Entity("DatabaseCore.Models.Department.StudentGroup", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("AcademicPlanId") + .HasColumnType("uniqueidentifier"); + + b.Property("DateCreate") + .HasColumnType("datetime2"); + + b.Property("DateDelete") + .HasColumnType("datetime2"); + + b.Property("EnrollmentYear") + .HasColumnType("int"); + + b.Property("GroupNumber") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LecturerId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("LecturerId"); + + b.HasIndex("AcademicPlanId", "EnrollmentYear", "GroupNumber") + .IsUnique(); + + b.ToTable("StudentGroups"); + }); + modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => { b.Property("Id") @@ -1003,6 +1039,23 @@ namespace DatabaseCore.Migrations b.Navigation("Post"); }); + modelBuilder.Entity("DatabaseCore.Models.Department.StudentGroup", b => + { + b.HasOne("DatabaseCore.Models.Department.AcademicPlan", "AcademicPlan") + .WithMany("StudentGroups") + .HasForeignKey("AcademicPlanId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("DatabaseCore.Models.Department.Lecturer", "Lecturer") + .WithMany("StudentGroups") + .HasForeignKey("LecturerId"); + + b.Navigation("AcademicPlan"); + + b.Navigation("Lecturer"); + }); + modelBuilder.Entity("DatabaseCore.Models.Department.TimeNorm", b => { b.HasOne("DatabaseCore.Models.Department.DisciplineBlock", "DisciplineBlock") @@ -1047,6 +1100,8 @@ namespace DatabaseCore.Migrations modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlan", b => { b.Navigation("AcademicPlanRecords"); + + b.Navigation("StudentGroups"); }); modelBuilder.Entity("DatabaseCore.Models.Department.AcademicPlanRecord", b => @@ -1083,6 +1138,8 @@ namespace DatabaseCore.Migrations b.Navigation("EducationDirections"); b.Navigation("LecturerPosts"); + + b.Navigation("StudentGroups"); }); modelBuilder.Entity("DatabaseCore.Models.Department.LecturerAcademicDegree", b => diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/AcademicPlan.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/AcademicPlan.cs index ce74418..c497798 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Department/AcademicPlan.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/AcademicPlan.cs @@ -39,6 +39,9 @@ namespace DatabaseCore.Models.Department [ForeignKey("AcademicPlanId")] public virtual List AcademicPlanRecords { get; set; } + [ForeignKey("AcademicPlanId")] + public virtual List StudentGroups { get; set; } + //------------------------------------------------------------------------- public AcademicPlan SecurityCheck(AcademicPlan entity, bool allowFullData) => entity; diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/Lecturer.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/Lecturer.cs index 383806f..ce3298e 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Department/Lecturer.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/Lecturer.cs @@ -106,6 +106,9 @@ namespace DatabaseCore.Models.Department [ForeignKey("LecturerId")] public virtual List EducationDirections { get; set; } + [ForeignKey("LecturerId")] + public virtual List StudentGroups { get; set; } + //------------------------------------------------------------------------- public Lecturer SecurityCheck(Lecturer entity, bool allowFullData) diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/StudentGroup.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/StudentGroup.cs new file mode 100644 index 0000000..9fb29f6 --- /dev/null +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/StudentGroup.cs @@ -0,0 +1,49 @@ +using ModuleTools.Attributes; +using ModuleTools.Interfaces; +using System; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; + +namespace DatabaseCore.Models.Department +{ + /// + /// Класс, описывающий учебную группу кафедры + /// + [DataContract] + [EntityDescription("StudentGroup", "Учебная группа кафедры")] + [EntityDependency("AcademicPlan", "AcademicPlanId", "Учебный план, по которму учится группа")] + [EntityDependency("Lecturer", "LecturerId", "Куратор группы")] + public class StudentGroup : BaseEntity, IEntitySecurityExtenstion + { + [DataMember] + [Required(ErrorMessage = "required")] + [MapConfiguration("AcademicPlanId")] + public Guid AcademicPlanId { get; set; } + + [DataMember] + [Required(ErrorMessage = "required")] + [MapConfiguration("GroupNumber")] + public int GroupNumber { get; set; } + + [DataMember] + [Required(ErrorMessage = "required")] + [MapConfiguration("EnrollmentYear")] + public int EnrollmentYear { get; set; } + + [DataMember] + [MapConfiguration("LecturerId")] + public Guid? LecturerId { get; set; } + + //------------------------------------------------------------------------- + + public virtual AcademicPlan AcademicPlan { get; set; } + + public virtual Lecturer Lecturer { get; set; } + + //------------------------------------------------------------------------- + + //------------------------------------------------------------------------- + + public StudentGroup SecurityCheck(StudentGroup entity, bool allowFullData) => entity; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Common/DesktopTools/BaseControls/BaseControlDecimal.cs b/DepartmentPortal/Common/DesktopTools/BaseControls/BaseControlDecimal.cs index 13a48ef..5aff5f8 100644 --- a/DepartmentPortal/Common/DesktopTools/BaseControls/BaseControlDecimal.cs +++ b/DepartmentPortal/Common/DesktopTools/BaseControls/BaseControlDecimal.cs @@ -18,7 +18,7 @@ namespace DesktopTools.BaseControls /// /// /// - public BaseControlDecimal(string propertyName, bool mustFilling, bool readOnly, decimal minValue, decimal maxValue, int decimalPlaces) : base(propertyName, mustFilling, readOnly) + public BaseControlDecimal(string propertyName, bool mustFilling, bool readOnly, double minValue, double maxValue, int decimalPlaces) : base(propertyName, mustFilling, readOnly) { InitializeComponent(); _baseControl = this; @@ -26,11 +26,11 @@ namespace DesktopTools.BaseControls numericUpDown.ValueChanged += (object sender, EventArgs e) => { CallOnValueChangeEvent(); }; if (minValue != 0) { - numericUpDown.Minimum = minValue; + numericUpDown.Minimum = (decimal)minValue; } if (maxValue != 0) { - numericUpDown.Maximum = maxValue; + numericUpDown.Maximum = (decimal)maxValue; } if (decimalPlaces != 0) { diff --git a/DepartmentPortal/Common/DesktopTools/BaseControls/BaseControlInt.cs b/DepartmentPortal/Common/DesktopTools/BaseControls/BaseControlInt.cs index f9fd357..baa1d7b 100644 --- a/DepartmentPortal/Common/DesktopTools/BaseControls/BaseControlInt.cs +++ b/DepartmentPortal/Common/DesktopTools/BaseControls/BaseControlInt.cs @@ -17,7 +17,7 @@ namespace DesktopTools.BaseControls /// /// /// - public BaseControlInt(string propertyName, bool mustFilling, bool readOnly, decimal minValue, decimal maxValue) : base(propertyName, mustFilling, readOnly) + public BaseControlInt(string propertyName, bool mustFilling, bool readOnly, double minValue, double maxValue) : base(propertyName, mustFilling, readOnly) { InitializeComponent(); _baseControl = this; @@ -25,11 +25,11 @@ namespace DesktopTools.BaseControls numericUpDown.ValueChanged += (object sender, EventArgs e) => { CallOnValueChangeEvent(); }; if (minValue != 0) { - numericUpDown.Minimum = minValue; + numericUpDown.Minimum = (decimal)minValue; } if (maxValue != 0) { - numericUpDown.Maximum = maxValue; + numericUpDown.Maximum = (decimal)maxValue; } panelControl.Controls.Add(numericUpDown); diff --git a/DepartmentPortal/Common/ModuleTools/Attributes/ViewModelControlElementPropertyAttribute.cs b/DepartmentPortal/Common/ModuleTools/Attributes/ViewModelControlElementPropertyAttribute.cs index c2562a9..871057f 100644 --- a/DepartmentPortal/Common/ModuleTools/Attributes/ViewModelControlElementPropertyAttribute.cs +++ b/DepartmentPortal/Common/ModuleTools/Attributes/ViewModelControlElementPropertyAttribute.cs @@ -48,12 +48,12 @@ namespace ModuleTools.Attributes /// /// Минимальное значение для числового параметра /// - public decimal MinValue { get; set; } = 0; + public double MinValue { get; set; } = 0; /// /// Максимальное значение для числового параметра /// - public decimal MaxValue { get; set; } = 0; + public double MaxValue { get; set; } = 0; /// /// Количество знаков после запятой diff --git a/DepartmentPortal/Common/ModuleTools/Enums/AccessOperation.cs b/DepartmentPortal/Common/ModuleTools/Enums/AccessOperation.cs index 5dd341a..44ae8b0 100644 --- a/DepartmentPortal/Common/ModuleTools/Enums/AccessOperation.cs +++ b/DepartmentPortal/Common/ModuleTools/Enums/AccessOperation.cs @@ -42,7 +42,7 @@ УчебныеПланы = 108, - Группы = 105, // + УчебныеГруппы = 109, Студенты = 106, diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/BindingModels/StudentGroupBindingModels.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/BindingModels/StudentGroupBindingModels.cs new file mode 100644 index 0000000..a6b8330 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/BindingModels/StudentGroupBindingModels.cs @@ -0,0 +1,38 @@ +using ModuleTools.Attributes; +using ModuleTools.BindingModels; +using System; +using System.ComponentModel.DataAnnotations; + +namespace DepartmentBusinessLogic.BindingModels +{ + /// + /// Получение студенческой группы + /// + public class StudentGroupGetBindingModel : GetBindingModel + { + public Guid? AcademicPlanId { get; set; } + + public Guid? LecturerId { get; set; } + } + + /// + /// Сохранение студенческой группы + /// + public class StudentGroupSetBindingModel : SetBindingModel + { + [Required(ErrorMessage = "required")] + [MapConfiguration("AcademicPlanId")] + public Guid AcademicPlanId { get; set; } + + [Required(ErrorMessage = "required")] + [MapConfiguration("GroupNumber")] + public int GroupNumber { get; set; } + + [Required(ErrorMessage = "required")] + [MapConfiguration("EnrollmentYear")] + public int EnrollmentYear { get; set; } + + [MapConfiguration("LecturerId")] + public Guid? LecturerId { get; set; } + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/BusinessLogics/StudentGroupBusinessLogic.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/BusinessLogics/StudentGroupBusinessLogic.cs new file mode 100644 index 0000000..6653bde --- /dev/null +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/BusinessLogics/StudentGroupBusinessLogic.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 StudentGroupBusinessLogic : GenericBusinessLogic + { + public StudentGroupBusinessLogic(IStudentGroupService service) : base(service, "Учебные Группы", AccessOperation.УчебныеГруппы) { } + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/Interfaces/IStudentGroupService.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/Interfaces/IStudentGroupService.cs new file mode 100644 index 0000000..48ea5ed --- /dev/null +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/Interfaces/IStudentGroupService.cs @@ -0,0 +1,10 @@ +using DepartmentBusinessLogic.BindingModels; +using ModuleTools.Interfaces; + +namespace DepartmentBusinessLogic.Interfaces +{ + /// + /// Хранение учебных групп + /// + public interface IStudentGroupService : IGenerticEntityService { } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/AcademicPlanViewModels.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/AcademicPlanViewModels.cs index d7b872d..b1a7b39 100644 --- a/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/AcademicPlanViewModels.cs +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/AcademicPlanViewModels.cs @@ -16,6 +16,8 @@ namespace DepartmentBusinessLogic.ViewModels [ViewModelControlElementClass(HaveDependenceEntities = true, Width = 1200, Height = 800)] [ViewModelControlElementDependenceEntity(Title = "Записи плана", Order = 1, ParentPropertyName = "AcademicPlanId", ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlAcademicPlanRecordList, DepartmentWindowsDesktop")] + [ViewModelControlElementDependenceEntity(Title = "Группы", Order = 2, ParentPropertyName = "AcademicPlanId", + ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlStudentGroupList, DepartmentWindowsDesktop")] public class AcademicPlanViewModel : ElementViewModel { [ViewModelControlElementProperty("Направление", ControlType.ControlGuid, MustHaveValue = false, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlEducationDirectionList, DepartmentWindowsDesktop")] @@ -26,6 +28,10 @@ namespace DepartmentBusinessLogic.ViewModels [MapConfiguration("EducationDirection.Cipher", IsDifficle = true)] public string EducationDirectionCipher { get; set; } + [ViewModelControlListProperty("Профиль")] + [MapConfiguration("EducationDirection.Profile", IsDifficle = true)] + public string EducationDirectionProfile { get; set; } + [ViewModelControlListProperty("Дата начала", ColumnWidth = 120)] [ViewModelControlElementProperty("Дата начала", ControlType.ControlInt, MustHaveValue = true)] [MapConfiguration("YearEntrance")] diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/LecturerViewModels.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/LecturerViewModels.cs index f8b57bb..42053cc 100644 --- a/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/LecturerViewModels.cs +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/LecturerViewModels.cs @@ -19,6 +19,8 @@ namespace DepartmentBusinessLogic.ViewModels ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlLecturerPostList, DepartmentWindowsDesktop")] [ViewModelControlElementDependenceEntity(Title = "Напрвления обучения", Order = 2, ParentPropertyName = "LecturerId", ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlEducationDirectionList, DepartmentWindowsDesktop")] + [ViewModelControlElementDependenceEntity(Title = "Кураторство групп", Order = 3, ParentPropertyName = "LecturerId", + ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlStudentGroupList, DepartmentWindowsDesktop")] public class LecturerViewModel : ElementViewModel { [ViewModelControlElementProperty("Пользователь", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "SecurityWindowsDesktop.EntityControls.ControlUserList, SecurityWindowsDesktop")] diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/StudentGroupViewModels.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/StudentGroupViewModels.cs new file mode 100644 index 0000000..12ce7f0 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/StudentGroupViewModels.cs @@ -0,0 +1,61 @@ +using ModuleTools.Attributes; +using ModuleTools.Enums; +using ModuleTools.Extensions; +using ModuleTools.ViewModels; +using System; + +namespace DepartmentBusinessLogic.ViewModels +{ + /// + /// Список дисциплин + /// + public class StudentGroupListViewModel : ListViewModel { } + + /// + /// Элемент дисциплина + /// + [ViewModelControlElementClass(HaveDependenceEntities = true, Width = 800, Height = 500)] + //[ViewModelControlElementDependenceEntity(Title = "Записи учебного плана", Order = 1, ParentPropertyName = "DisciplineId", + // ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlAcademicPlanRecordList, DepartmentWindowsDesktop")] + public class StudentGroupViewModel : ElementViewModel + { + [ViewModelControlElementProperty("Учебный план", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlAcademicPlanList, DepartmentWindowsDesktop")] + [MapConfiguration("AcademicPlanId")] + public Guid AcademicPlanId { get; set; } + + [ViewModelControlListProperty("Шифр")] + [MapConfiguration("AcademicPlan.EducationDirection.Cipher", IsDifficle = true)] + public string AcademicPlanEducationDirectionCipher { get; set; } + + [MapConfiguration("AcademicPlan.EducationDirection.ShortName", IsDifficle = true)] + public string AcademicPlanEducationDirectionShortName { get; set; } + + [ViewModelControlListProperty("Номер группы")] + [ViewModelControlElementProperty("Номер группы", ControlType.ControlInt, MustHaveValue = true, MinValue = 1, MaxValue = 4)] + [MapConfiguration("GroupNumber")] + public int GroupNumber { get; set; } + + [ViewModelControlListProperty("Год зачисления")] + [ViewModelControlElementProperty("Год зачисления", ControlType.ControlInt, MustHaveValue = true)] + [MapConfiguration("EnrollmentYear")] + public int EnrollmentYear { get; set; } + + [ViewModelControlElementProperty("Куратор", ControlType.ControlGuid, MustHaveValue = false, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlLecturerList, DepartmentWindowsDesktop")] + [MapConfiguration("LecturerId")] + public Guid? CuratorId { get; set; } + + [MapConfiguration("Lecturer.LastName", IsDifficle = true)] + public string LecturerLastName { get; set; } + + [MapConfiguration("Lecturer.FirstName", IsDifficle = true)] + public string LecturerFirstName { get; set; } + + [MapConfiguration("Lecturer.Patronymic", IsDifficle = true)] + public string LecturerPatronymic { get; set; } + + [ViewModelControlListProperty("Куратор")] + public string Lecturer => $"{LecturerLastName}{(LecturerFirstName.IsNotEmpty() ? $" {LecturerFirstName[0]}." : string.Empty)}{(LecturerPatronymic.IsNotEmpty() ? $"{LecturerPatronymic[0]}." : string.Empty)}"; + + public override string ToString() => $"{AcademicPlanEducationDirectionShortName}-{GroupNumber}"; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/DepartmentImplementationExtensions.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/DepartmentImplementationExtensions.cs index f119776..28f4cf9 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/DepartmentImplementationExtensions.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/DepartmentImplementationExtensions.cs @@ -31,6 +31,8 @@ namespace DepartmentDatabaseImplementation 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/AcademicPlanService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/AcademicPlanService.cs index 514616d..697d8a9 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/AcademicPlanService.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/AcademicPlanService.cs @@ -27,7 +27,14 @@ namespace DepartmentDatabaseImplementation.Implementations { 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 OperationResultModel AdditionalCheckingWhenDeleting(DbContext context, AcademicPlan entity, AcademicPlanGetBindingModel model) + { + if (context.Set().Any(x => x.AcademicPlanId == model.Id && !x.IsDeleted)) + { + return OperationResultModel.Error("Error:", "Есть учебные группы, относящиеся к этому учебному плану", ResultServiceStatusCode.ExsistItem); + } + return OperationResultModel.Success(null); + } protected override IQueryable AdditionalCheckingWhenReadingList(IQueryable query, AcademicPlanGetBindingModel model) { diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/LecturerService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/LecturerService.cs index d2f8cc0..71436cd 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/LecturerService.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/LecturerService.cs @@ -30,6 +30,10 @@ namespace DepartmentDatabaseImplementation.Implementations { return OperationResultModel.Error("Error:", "Есть направления обучения, у которых этот преподаватель указан руководителем", ResultServiceStatusCode.ExsistItem); } + if (context.Set().Any(x => x.LecturerId == model.Id && !x.IsDeleted)) + { + return OperationResultModel.Error("Error:", "Есть учебные группы, у которых этот преподаватель числится как куратор", ResultServiceStatusCode.ExsistItem); + } return OperationResultModel.Success(null); ; } diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/StudentGroupService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/StudentGroupService.cs new file mode 100644 index 0000000..c346aa0 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/StudentGroupService.cs @@ -0,0 +1,50 @@ +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 +{ + /// + /// Реализация IStudentGroupService + /// + public class StudentGroupService : + AbstractGenerticEntityService, + IStudentGroupService + { + protected override OperationResultModel AdditionalCheckingWhenAdding(DbContext context, StudentGroupSetBindingModel model) => OperationResultModel.Success(null); + + protected override OperationResultModel AdditionalCheckingWhenDeleting(DbContext context, StudentGroup entity, StudentGroupGetBindingModel model) + { + + return OperationResultModel.Success(null); + } + + protected override IQueryable AdditionalCheckingWhenReadingList(IQueryable query, StudentGroupGetBindingModel model) + { + if (model.AcademicPlanId.HasValue) + { + query = query.Where(x => x.AcademicPlanId == model.AcademicPlanId.Value); + } + if (model.LecturerId.HasValue) + { + query = query.Where(x => x.LecturerId == model.LecturerId.Value); + } + return query; + } + + protected override OperationResultModel AdditionalCheckingWhenUpdateing(DbContext context, StudentGroupSetBindingModel model) => OperationResultModel.Success(null); + + protected override void AdditionalDeleting(DbContext context, StudentGroup entity, StudentGroupGetBindingModel model) { } + + protected override StudentGroup GetUniqueEntity(StudentGroupSetBindingModel model, DbContext context) => context.Set().FirstOrDefault(x => x.AcademicPlanId == model.AcademicPlanId && x.EnrollmentYear == model.EnrollmentYear && x.GroupNumber == model.GroupNumber && x.Id != model.Id); + + protected override IQueryable IncludingWhenReading(IQueryable query) => query.Include(x => x.AcademicPlan).Include(x => x.Lecturer); + + protected override IQueryable OrderingWhenReading(IQueryable query) => query.OrderBy(x => x.EnrollmentYear).ThenBy(x => x.GroupNumber); + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/DepartmentWindowDesktopExtension.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/DepartmentWindowDesktopExtension.cs index d76fc6b..0b48221 100644 --- a/DepartmentPortal/Department/DepartmentWindowsDesktop/DepartmentWindowDesktopExtension.cs +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/DepartmentWindowDesktopExtension.cs @@ -42,7 +42,8 @@ namespace DepartmentWindowsDesktop new ControlLecturerList(), new ControlEducationDirectionList(), new ControlTimeNormList(), - new ControlAcademicPlanList() + new ControlAcademicPlanList(), + new ControlStudentGroupList() }; foreach (var cntrl in _controls) diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/StudentGroup/ControlStudentGroupElement.Designer.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/StudentGroup/ControlStudentGroupElement.Designer.cs new file mode 100644 index 0000000..eb9bf17 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/StudentGroup/ControlStudentGroupElement.Designer.cs @@ -0,0 +1,33 @@ + +namespace DepartmentWindowsDesktop.EntityControls +{ + partial class ControlStudentGroupElement + { + /// + /// Освободить все используемые ресурсы. + /// + /// истинно, если управляемый ресурс должен быть удален; иначе ложно. + 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/StudentGroup/ControlStudentGroupElement.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/StudentGroup/ControlStudentGroupElement.cs new file mode 100644 index 0000000..4658fe3 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/StudentGroup/ControlStudentGroupElement.cs @@ -0,0 +1,30 @@ +using DepartmentBusinessLogic.BindingModels; +using DepartmentBusinessLogic.BusinessLogics; +using DepartmentBusinessLogic.ViewModels; +using DesktopTools.Controls; +using DesktopTools.Interfaces; +using DesktopTools.Models; +using System; + +namespace DepartmentWindowsDesktop.EntityControls +{ + /// + /// Реализация контрола для учебной группы + /// + public partial class ControlStudentGroupElement : + GenericControlEntityElement, + IGenericControlEntityElement + { + public ControlStudentGroupElement() + { + InitializeComponent(); + Title = "Учебная группа"; + ControlId = new Guid("949d6004-b10e-4e9b-8cc4-21a7c31e599a"); + _genericControlViewEntityElement = this; + } + + public IControl GetInstanceGenericControl() => new ControlStudentGroupElement() { ControlId = Guid.NewGuid() }; + + public ControlViewEntityElementConfiguration GetConfigControl() => new(); + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/StudentGroup/ControlStudentGroupElement.resx b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/StudentGroup/ControlStudentGroupElement.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/StudentGroup/ControlStudentGroupElement.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/StudentGroup/ControlStudentGroupList.Designer.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/StudentGroup/ControlStudentGroupList.Designer.cs new file mode 100644 index 0000000..b419448 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/StudentGroup/ControlStudentGroupList.Designer.cs @@ -0,0 +1,33 @@ + +namespace DepartmentWindowsDesktop.EntityControls +{ + partial class ControlStudentGroupList + { + /// + /// Освободить все используемые ресурсы. + /// + /// истинно, если управляемый ресурс должен быть удален; иначе ложно. + 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/StudentGroup/ControlStudentGroupList.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/StudentGroup/ControlStudentGroupList.cs new file mode 100644 index 0000000..f7d04ef --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/StudentGroup/ControlStudentGroupList.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 ControlStudentGroupList : + GenericControlEntityList, + IGenericControlEntityList + { + public ControlStudentGroupList() + { + InitializeComponent(); + Title = "Учебные группы"; + ControlId = new Guid("453666ff-511e-4751-887f-0fec5c1e95c8"); + AccessOperation = AccessOperation.УчебныеГруппы; + ControlViewEntityElement = new ControlStudentGroupElement(); + _genericControlViewEntityList = this; + } + + public IControl GetInstanceGenericControl() => new ControlStudentGroupList() { 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/StudentGroup/ControlStudentGroupList.resx b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/StudentGroup/ControlStudentGroupList.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/StudentGroup/ControlStudentGroupList.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