From 9d68f318462c0c0ec86c037d136bbeb338b1f14b Mon Sep 17 00:00:00 2001 From: kotcheshir73 Date: Sat, 3 Apr 2021 14:27:30 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20=D0=BF?= =?UTF-8?q?=D0=BE=20=D1=80=D0=B5=D0=B7=D1=83=D0=BB=D1=8C=D1=82=D0=B0=D1=82?= =?UTF-8?q?=D0=BC=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Common/DatabaseCore/Models/Department/Classroom.cs | 1 + .../ViewModels/ClassroomViewModels.cs | 4 ++++ .../Implementations/EmployeePostService.cs | 2 +- .../Implementations/UserService.cs | 6 ++++++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/DepartmentPortal/Common/DatabaseCore/Models/Department/Classroom.cs b/DepartmentPortal/Common/DatabaseCore/Models/Department/Classroom.cs index e2152cc..d298dd7 100644 --- a/DepartmentPortal/Common/DatabaseCore/Models/Department/Classroom.cs +++ b/DepartmentPortal/Common/DatabaseCore/Models/Department/Classroom.cs @@ -10,6 +10,7 @@ namespace DatabaseCore.Models.Department /// [DataContract] [EntityDescription("Classroom", "Аудитрия кафедры")] + [EntityDependency("Employee", "EmployeeId", "Сотрудник, отвечающий за аудиторию")] public class Classroom : BaseEntity, IEntitySecurityExtenstion { [DataMember] diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/ClassroomViewModels.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/ClassroomViewModels.cs index e15e0e9..800f80c 100644 --- a/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/ClassroomViewModels.cs +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/ClassroomViewModels.cs @@ -52,6 +52,7 @@ namespace DepartmentBusinessLogic.ViewModels [MapConfiguration("Capacity")] public int Capacity { get; set; } + [ViewModelControlListProperty("Код безоп.", ColumnWidth = 100)] [ViewModelControlElementProperty("Код безоп.", ControlType.ControlString, MustHaveValue = true)] [MapConfiguration("SecurityCode")] public string SecurityCode { get; set; } @@ -60,6 +61,9 @@ namespace DepartmentBusinessLogic.ViewModels [MapConfiguration("HaveProjector")] public bool HaveProjector { get; set; } + [ViewModelControlListProperty("Есть проектор", ColumnWidth = 80)] + public string IsHaveProjector => HaveProjector ? "Да" : "Нет"; + [ViewModelControlElementProperty("Описание", ControlType.ControlText)] [MapConfiguration("Description")] public string Description { get; set; } diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/EmployeePostService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/EmployeePostService.cs index 57ea3e2..d3a2ccd 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/EmployeePostService.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/EmployeePostService.cs @@ -101,7 +101,7 @@ namespace DepartmentDatabaseImplementation.Implementations var query = context.EmployeePosts.Where(x => !x.IsDeleted).AsQueryable(); - query = query.OrderBy(x => x.EmployeePostName); + query = query.OrderBy(x => x.Order); if (model.PageNumber.HasValue && model.PageSize.HasValue) { diff --git a/DepartmentPortal/Security/SecurityDatabaseImplementation/Implementations/UserService.cs b/DepartmentPortal/Security/SecurityDatabaseImplementation/Implementations/UserService.cs index 4eb933d..9e99680 100644 --- a/DepartmentPortal/Security/SecurityDatabaseImplementation/Implementations/UserService.cs +++ b/DepartmentPortal/Security/SecurityDatabaseImplementation/Implementations/UserService.cs @@ -21,6 +21,12 @@ namespace SecurityDatabaseImplementation.Implementations { using var context = DatabaseManager.GetContext; + if (model.Password.IsEmpty()) + { + model.Password = "qwerty"; + } + model.Password = SecurityManager.GetPasswordHash(model.Password); + var exsistEntity = context.Users.FirstOrDefault(x => x.UserName == model.Login); if (exsistEntity == null) {