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) {