diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/EmployeeEmployeePostViewModels.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/EmployeeEmployeePostViewModels.cs index edac2ae..7ea58da 100644 --- a/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/EmployeeEmployeePostViewModels.cs +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/EmployeeEmployeePostViewModels.cs @@ -17,15 +17,15 @@ namespace DepartmentBusinessLogic.ViewModels public class EmployeeEmployeePostViewModel : ElementViewModel { [MapConfiguration("EmployeeId", AllowCopyWithoutRigth = false)] - // [ViewModelControlElementProperty("Сотрудник", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "SecurityWindowsDesktop.EntityControls.ControlUserList, SecurityWindowsDesktop")] - public Guid EmployeeId { get; set; } + [ViewModelControlElementProperty("Сотрудник", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlEmployeeList, DepartmentWindowsDesktop")] + public Guid EmployeeId { get; set; } [ViewModelControlListProperty("Сотрудник")] [MapConfiguration("Employee.LastName", IsDifficle = true)] public string EmployeeName { get; set; } [MapConfiguration("EmployeePostId")] - //[ViewModelControlElementProperty("Должность", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "SecurityWindowsDesktop.EntityControls.ControlRoleList, SecurityWindowsDesktop")] + [ViewModelControlElementProperty("Должность", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlEmployeePostList, DepartmentWindowsDesktop")] public Guid EmployeePostId { get; set; } [ViewModelControlListProperty("Должность")] @@ -33,7 +33,7 @@ namespace DepartmentBusinessLogic.ViewModels public string EmployeePostName { get; set; } [ViewModelControlListProperty("Ставка", 80)] - [ViewModelControlElementProperty("Ставка", ControlType.ControlDecimal, MustHaveValue = true)] + [ViewModelControlElementProperty("Ставка", ControlType.ControlDecimal, DecimalPlaces = 1, MustHaveValue = true)] [MapConfiguration("Rate")] public decimal Rate { get; set; } diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/EmployeePostViewModels.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/EmployeePostViewModels.cs index 2624e80..8610d7f 100644 --- a/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/EmployeePostViewModels.cs +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/EmployeePostViewModels.cs @@ -13,11 +13,11 @@ namespace DepartmentBusinessLogic.ViewModels /// Элемент ролей /// [ViewModelControlElementClass(HaveDependenceEntities = true, Width = 800, Height = 500)] - //[ViewModelControlElementDependenceEntity(Title = "Сотрудники", Order = 1, ParentPropertyName = "EmployeePostId", - // ControlTypeObject = "SecurityWindowsDesktop.EntityControls.ControlRoleUserList, SecurityWindowsDesktop")] + [ViewModelControlElementDependenceEntity(Title = "Сотрудники", Order = 1, ParentPropertyName = "EmployeePostId", + ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlEmployeePostEmployeeList, DepartmentWindowsDesktop")] public class EmployeePostViewModel : ElementViewModel { - [ViewModelControlListProperty("Название должность")] + [ViewModelControlListProperty("Название должности")] [ViewModelControlElementProperty("Название должность", ControlType.ControlString, MustHaveValue = true)] [MapConfiguration("EmployeePostName")] public string EmployeePostName { get; set; } diff --git a/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/EmployeeViewModels.cs b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/EmployeeViewModels.cs index 4b1b3b4..fe469f2 100644 --- a/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/EmployeeViewModels.cs +++ b/DepartmentPortal/Department/DepartmentBusinessLogic/ViewModels/EmployeeViewModels.cs @@ -14,63 +14,64 @@ namespace DepartmentBusinessLogic.ViewModels /// /// Элемент сотрудник /// - [ViewModelControlElementClass(HaveDependenceEntities = true, Width = 800, Height = 500)] - //[ViewModelControlElementDependenceEntity(Title = "Сотрудники", Order = 1, ParentPropertyName = "EmployeePostId", - // ControlTypeObject = "SecurityWindowsDesktop.EntityControls.ControlRoleUserList, SecurityWindowsDesktop")] + [ViewModelControlElementClass(HaveDependenceEntities = true, Width = 800, Height = 700)] + [ViewModelControlElementDependenceEntity(Title = "Должности", Order = 1, ParentPropertyName = "EmployeeId", + ControlTypeObject = "DepartmentWindowsDesktop.EntityControls.ControlEmployeeEmployeePostList, DepartmentWindowsDesktop")] public class EmployeeViewModel : ElementViewModel { + [ViewModelControlElementProperty("Пользователь", ControlType.ControlGuid, MustHaveValue = true, ReadOnly = false, ControlTypeObject = "SecurityWindowsDesktop.EntityControls.ControlUserList, SecurityWindowsDesktop")] [MapConfiguration("UserId")] public Guid UserId { get; set; } - [ViewModelControlListProperty("Имя")] - [ViewModelControlElementProperty("Имя", ControlType.ControlString, MustHaveValue = true)] - [MapConfiguration("FirstName")] - public string FirstName { get; set; } - [ViewModelControlListProperty("Фамилия")] [ViewModelControlElementProperty("Фамилия", ControlType.ControlString, MustHaveValue = true)] [MapConfiguration("LastName")] public string LastName { get; set; } + [ViewModelControlListProperty("Имя")] + [ViewModelControlElementProperty("Имя", ControlType.ControlString, MustHaveValue = true)] + [MapConfiguration("FirstName")] + public string FirstName { get; set; } + [ViewModelControlListProperty("Отчество")] [ViewModelControlElementProperty("Отчество", ControlType.ControlString, MustHaveValue = true)] [MapConfiguration("Patronymic")] public string Patronymic { get; set; } - [ViewModelControlListProperty("Отчество")] - [ViewModelControlElementProperty("Отчество", ControlType.ControlDateTime, MustHaveValue = true )] + [ViewModelControlListProperty("Дата рожд.", 100)] + [ViewModelControlElementProperty("Дата рожд.", ControlType.ControlDateTime, MustHaveValue = true )] [MapConfiguration("DateBirth", AllowCopyWithoutRigth = false)] public DateTime DateBirth { get; set; } - [ViewModelControlListProperty("Адрес")] + [ViewModelControlListProperty("Адрес", 90)] [ViewModelControlElementProperty("Адрес", ControlType.ControlString, MustHaveValue = true)] [MapConfiguration("Address", AllowCopyWithoutRigth = false)] public string Address { get; set; } - [ViewModelControlListProperty("Эл. почта")] + [ViewModelControlListProperty("Эл. почта", 90)] [ViewModelControlElementProperty("Эл. почта", ControlType.ControlString, MustHaveValue = true)] [MapConfiguration("Email", AllowCopyWithoutRigth = false)] public string Email { get; set; } - [ViewModelControlListProperty("Моб. номер")] + [ViewModelControlListProperty("Моб. номер", 100)] [ViewModelControlElementProperty("Моб. номер", ControlType.ControlString, MustHaveValue = true)] [MapConfiguration("MobileNumber", AllowCopyWithoutRigth = false)] public string MobileNumber { get; set; } - [ViewModelControlListProperty("Дом. номер")] - [ViewModelControlElementProperty("Дом. номер", ControlType.ControlString, MustHaveValue = true)] + [ViewModelControlListProperty("Дом. номер", 100)] + [ViewModelControlElementProperty("Дом. номер", ControlType.ControlString)] [MapConfiguration("HomeNumber", AllowCopyWithoutRigth = false)] public string HomeNumber { get; set; } - [ViewModelControlElementProperty("Описание", ControlType.ControlText, MustHaveValue = true)] + [ViewModelControlElementProperty("Описание", ControlType.ControlText)] [MapConfiguration("Description")] public string Description { get; set; } - [ViewModelControlElementProperty("Фото", ControlType.ControlImage, MustHaveValue = true)] + [ViewModelControlElementProperty("Фото", ControlType.ControlImage, Width = 200, Height = 200)] [MapConfiguration("Photo")] public byte[] Photo { get; set; } - [ViewModelControlListProperty("Группа эл.безоп")] + [ViewModelControlListProperty("Гр. эл.без.", 90)] [ViewModelControlElementProperty("Группа эл.безоп", ControlType.ControlString, MustHaveValue = true)] [MapConfiguration("GroupElectricalSafety")] public string GroupElectricalSafety { get; set; } diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/EmployeeEmployeePostService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/EmployeeEmployeePostService.cs index 5d9b80a..6f37d23 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/EmployeeEmployeePostService.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/EmployeeEmployeePostService.cs @@ -33,6 +33,7 @@ namespace DepartmentDatabaseImplementation.Implementations { if (exsistEntity.IsDeleted) { + exsistEntity = Mapper.MapToClass(model, exsistEntity, true); exsistEntity.IsDeleted = false; context.SaveChanges(); return OperationResultModel.Success(Mapper.MapToClass(exsistEntity, true)); diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/EmployeePostService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/EmployeePostService.cs index 220f81c..57ea3e2 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/EmployeePostService.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/EmployeePostService.cs @@ -32,6 +32,7 @@ namespace DepartmentDatabaseImplementation.Implementations { if (exsistEntity.IsDeleted) { + exsistEntity = Mapper.MapToClass(model, exsistEntity, true); exsistEntity.IsDeleted = false; context.SaveChanges(); return OperationResultModel.Success(Mapper.MapToClass(exsistEntity, true)); diff --git a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/EmployeeService.cs b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/EmployeeService.cs index dd34db9..6c78441 100644 --- a/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/EmployeeService.cs +++ b/DepartmentPortal/Department/DepartmentDatabaseImplementation.csproj/Implementations/EmployeeService.cs @@ -33,6 +33,7 @@ namespace DepartmentDatabaseImplementation.Implementations { if (exsistEntity.IsDeleted) { + exsistEntity = Mapper.MapToClass(model, exsistEntity, true); exsistEntity.IsDeleted = false; context.SaveChanges(); return OperationResultModel.Success(Mapper.MapToClass(exsistEntity, true)); diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/DepartmentWindowDesktopExtension.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/DepartmentWindowDesktopExtension.cs new file mode 100644 index 0000000..94fc22a --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/DepartmentWindowDesktopExtension.cs @@ -0,0 +1,61 @@ +using DepartmentWindowsDesktop.EntityControls; +using DesktopTools.Interfaces; +using DesktopTools.Models; +using ModuleTools.BindingModels; +using ModuleTools.BusinessLogics; +using ModuleTools.Enums; +using ModuleTools.Interfaces; +using ModuleTools.Models; +using System.Collections.Generic; + +namespace DepartmentWindowsDesktop +{ + public class DepartmentWindowDesktopExtension : IWindowDesktopExtension + { + public List GetListControlEntityList() + { + var manager = DependencyManager.Instance.Resolve(); + if (manager == null) + { + return null; + } + + if (!manager.CheckAccess(new SecurityManagerCheckAccessModel(new AccessBindingModel { UserIdForAccess = manager.User }, + AccessOperation.Кафедра, AccessType.View, "Кафедра"))) + { + return null; + } + + var list = new List + { + new WindowDesktopExtensionControlModel { Title = "Кафедра" } + }; + List _controls = new() + { + new ControlEmployeePostList(), + new ControlEmployeeList() + }; + + foreach (var cntrl in _controls) + { + if (manager.CheckAccess(new SecurityManagerCheckAccessModel(new AccessBindingModel { UserIdForAccess = manager.User }, + cntrl.AccessOperation, AccessType.View, cntrl.Title))) + { + list.Add(new WindowDesktopExtensionControlModel + { + Id = cntrl.ControlId, + Title = cntrl.Title, + Control = cntrl + }); + } + } + + return list; + } + + public List GetListControlSpecialList() + { + return null; + } + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/DepartmentWindowsDesktop.csproj b/DepartmentPortal/Department/DepartmentWindowsDesktop/DepartmentWindowsDesktop.csproj new file mode 100644 index 0000000..cfe8c8b --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/DepartmentWindowsDesktop.csproj @@ -0,0 +1,17 @@ + + + + net5.0-windows + true + + + + + + + + + + + + diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeeElement.Designer.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeeElement.Designer.cs new file mode 100644 index 0000000..49da47f --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeeElement.Designer.cs @@ -0,0 +1,33 @@ + +namespace DepartmentWindowsDesktop.EntityControls +{ + partial class ControlEmployeeElement + { + /// + /// Освободить все используемые ресурсы. + /// + /// истинно, если управляемый ресурс должен быть удален; иначе ложно. + 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/ControlEmployeeElement.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeeElement.cs new file mode 100644 index 0000000..7ce71f4 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeeElement.cs @@ -0,0 +1,24 @@ +using DepartmentBusinessLogic.BindingModels; +using DepartmentBusinessLogic.BusinessLogics; +using DepartmentBusinessLogic.ViewModels; +using DesktopTools.Controls; +using DesktopTools.Interfaces; +using System; + +namespace DepartmentWindowsDesktop.EntityControls +{ + public partial class ControlEmployeeElement : + GenericControlEntityElement, + IGenericControlEntityElement + { + public ControlEmployeeElement() + { + InitializeComponent(); + Title = "Сотрудник"; + ControlId = new Guid("9aadbb72-dde5-483f-9bba-021127b42c49"); + _genericControlViewEntityElement = this; + } + + public IControl GetInstanceGenericControl() => new ControlEmployeeElement() { ControlId = Guid.NewGuid() }; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeeEmployeePostElement.Designer.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeeEmployeePostElement.Designer.cs new file mode 100644 index 0000000..8108cb3 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeeEmployeePostElement.Designer.cs @@ -0,0 +1,33 @@ + +namespace DepartmentWindowsDesktop.EntityControls +{ + partial class ControlEmployeeEmployeePostElement + { + /// + /// Освободить все используемые ресурсы. + /// + /// истинно, если управляемый ресурс должен быть удален; иначе ложно. + 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/ControlEmployeeEmployeePostElement.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeeEmployeePostElement.cs new file mode 100644 index 0000000..8af5368 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeeEmployeePostElement.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 ControlEmployeeEmployeePostElement : + GenericControlEntityElement, + IGenericControlEntityElement + { + public ControlEmployeeEmployeePostElement() + { + InitializeComponent(); + Title = "Связи сотрудников с должностями"; + ControlId = new Guid("bdc9a6ef-968c-4d8e-bc19-aa15485cc855"); + _genericControlViewEntityElement = this; + } + + public IControl GetInstanceGenericControl() => new ControlEmployeeEmployeePostElement() { ControlId = Guid.NewGuid() }; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeeEmployeePostElement.resx b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeeEmployeePostElement.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeeEmployeePostElement.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/ControlEmployeeEmployeePostList.Designer.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeeEmployeePostList.Designer.cs new file mode 100644 index 0000000..9f4200c --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeeEmployeePostList.Designer.cs @@ -0,0 +1,33 @@ + +namespace DepartmentWindowsDesktop.EntityControls +{ + partial class ControlEmployeeEmployeePostList + { + /// + /// Освободить все используемые ресурсы. + /// + /// истинно, если управляемый ресурс должен быть удален; иначе ложно. + 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/ControlEmployeeEmployeePostList.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeeEmployeePostList.cs new file mode 100644 index 0000000..d2a625e --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeeEmployeePostList.cs @@ -0,0 +1,51 @@ +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 ControlEmployeeEmployeePostList : + GenericControlEntityList, + IGenericControlEntityList + { + public ControlEmployeeEmployeePostList() + { + InitializeComponent(); + Title = "Связи сотрудников с должностями"; + ControlId = new Guid("5d8ef8a4-8f76-4333-97a6-0beee5be8999"); + AccessOperation = AccessOperation.Сотрудники; + ControlViewEntityElement = new ControlEmployeeEmployeePostElement(); + _genericControlViewEntityList = this; + } + + public IControl GetInstanceGenericControl() => new ControlEmployeeEmployeePostList() { ControlId = Guid.NewGuid() }; + + public ControlViewEntityListConfiguration GetConfigControl() => new() + { + PaginationOn = false, + HideToolStripButton = new List + { + ToolStripButtonListNames.toolStripButtonUpd, + ToolStripButtonListNames.toolStripButtonSearch + } + }; + + public EmployeeEmployeePostListViewModel GetDataForControl() => throw new NotImplementedException(); + + public EmployeeEmployeePostListViewModel GetDataFromParentForControl(Guid id) => _businessLogic.GetList(new EmployeeEmployeePostGetBindingModel { EmployeeId = id }); + + public EmployeeEmployeePostListViewModel GetDataWithPageNameForControl(string key) => throw new NotImplementedException(); + + public EmployeeEmployeePostListViewModel GetDataWithPageNumberForControl(int page, int count) => throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeeEmployeePostList.resx b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeeEmployeePostList.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeeEmployeePostList.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/ControlEmployeeList.Designer.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeeList.Designer.cs new file mode 100644 index 0000000..62e23fc --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeeList.Designer.cs @@ -0,0 +1,33 @@ + +namespace DepartmentWindowsDesktop.EntityControls +{ + partial class ControlEmployeeList + { + /// + /// Освободить все используемые ресурсы. + /// + /// истинно, если управляемый ресурс должен быть удален; иначе ложно. + 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/ControlEmployeeList.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeeList.cs new file mode 100644 index 0000000..42e0c5d --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeeList.cs @@ -0,0 +1,47 @@ +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 ControlEmployeeList : + GenericControlEntityList, + IGenericControlEntityList + { + public ControlEmployeeList() + { + InitializeComponent(); + Title = "Сотрудники"; + ControlId = new Guid("22806450-62ad-479f-8ee7-dc1d9a90b6cf"); + AccessOperation = AccessOperation.Сотрудники; + ControlViewEntityElement = new ControlEmployeeElement(); + _genericControlViewEntityList = this; + } + + public IControl GetInstanceGenericControl() => new ControlEmployeeList() { ControlId = Guid.NewGuid() }; + + public ControlViewEntityListConfiguration GetConfigControl() => new() + { + PaginationOn = false, + HideToolStripButton = new List + { + ToolStripButtonListNames.toolStripButtonSearch + } + }; + + public EmployeeListViewModel GetDataForControl() => _businessLogic.GetList(new EmployeeGetBindingModel()); + + public EmployeeListViewModel GetDataFromParentForControl(Guid id) => throw new NotImplementedException(); + + public EmployeeListViewModel GetDataWithPageNameForControl(string key) => throw new NotImplementedException(); + + public EmployeeListViewModel GetDataWithPageNumberForControl(int page, int count) => throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeeList.resx b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeeList.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeeList.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/ControlEmployeePostElement.Designer.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeePostElement.Designer.cs new file mode 100644 index 0000000..9b2f03d --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeePostElement.Designer.cs @@ -0,0 +1,33 @@ + +namespace DepartmentWindowsDesktop.EntityControls +{ + partial class ControlEmployeePostElement + { + /// + /// Освободить все используемые ресурсы. + /// + /// истинно, если управляемый ресурс должен быть удален; иначе ложно. + 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/ControlEmployeePostElement.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeePostElement.cs new file mode 100644 index 0000000..c59e69f --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeePostElement.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 ControlEmployeePostElement : + GenericControlEntityElement, + IGenericControlEntityElement + { + public ControlEmployeePostElement() + { + InitializeComponent(); + Title = "Должность"; + ControlId = new Guid("25700525-7765-46c3-bbbf-a842f31bd898"); + _genericControlViewEntityElement = this; + } + + public IControl GetInstanceGenericControl() => new ControlEmployeePostElement() { ControlId = Guid.NewGuid() }; + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeePostElement.resx b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeePostElement.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeePostElement.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/ControlEmployeePostEmployeeList.Designer.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeePostEmployeeList.Designer.cs new file mode 100644 index 0000000..dca9032 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeePostEmployeeList.Designer.cs @@ -0,0 +1,33 @@ + +namespace DepartmentWindowsDesktop.EntityControls +{ + partial class ControlEmployeePostEmployeeList + { + /// + /// Освободить все используемые ресурсы. + /// + /// истинно, если управляемый ресурс должен быть удален; иначе ложно. + 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/ControlEmployeePostEmployeeList.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeePostEmployeeList.cs new file mode 100644 index 0000000..16bfbc4 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeePostEmployeeList.cs @@ -0,0 +1,51 @@ +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 ControlEmployeePostEmployeeList : + GenericControlEntityList, + IGenericControlEntityList + { + public ControlEmployeePostEmployeeList() + { + InitializeComponent(); + Title = "Связи сотрудников с должностями"; + ControlId = new Guid("59a917ee-7366-4c97-8a56-42eb86cff99c"); + AccessOperation = AccessOperation.Сотрудники; + ControlViewEntityElement = new ControlEmployeeEmployeePostElement(); + _genericControlViewEntityList = this; + } + + public IControl GetInstanceGenericControl() => new ControlEmployeePostEmployeeList() { ControlId = Guid.NewGuid() }; + + public ControlViewEntityListConfiguration GetConfigControl() => new() + { + PaginationOn = false, + HideToolStripButton = new List + { + ToolStripButtonListNames.toolStripButtonUpd, + ToolStripButtonListNames.toolStripButtonSearch + } + }; + + public EmployeeEmployeePostListViewModel GetDataForControl() => throw new NotImplementedException(); + + public EmployeeEmployeePostListViewModel GetDataFromParentForControl(Guid id) => _businessLogic.GetList(new EmployeeEmployeePostGetBindingModel { EmployeePostId = id }); + + public EmployeeEmployeePostListViewModel GetDataWithPageNameForControl(string key) => throw new NotImplementedException(); + + public EmployeeEmployeePostListViewModel GetDataWithPageNumberForControl(int page, int count) => throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeePostEmployeeList.resx b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeePostEmployeeList.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeePostEmployeeList.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/ControlEmployeePostList.Designer.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeePostList.Designer.cs new file mode 100644 index 0000000..93144f8 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeePostList.Designer.cs @@ -0,0 +1,33 @@ + +namespace DepartmentWindowsDesktop.EntityControls +{ + partial class ControlEmployeePostList + { + /// + /// Освободить все используемые ресурсы. + /// + /// истинно, если управляемый ресурс должен быть удален; иначе ложно. + 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/ControlEmployeePostList.cs b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeePostList.cs new file mode 100644 index 0000000..e047234 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeePostList.cs @@ -0,0 +1,50 @@ +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 ControlEmployeePostList : + GenericControlEntityList, + IGenericControlEntityList + { + public ControlEmployeePostList() + { + InitializeComponent(); + Title = "Должности сотрудников"; + ControlId = new Guid("643f2ec7-9e77-4b8a-8074-5a7915fa16c0"); + AccessOperation = AccessOperation.Сотрудники; + ControlViewEntityElement = new ControlEmployeePostElement(); + _genericControlViewEntityList = this; + } + + public IControl GetInstanceGenericControl() => new ControlEmployeePostList() { ControlId = Guid.NewGuid() }; + + public ControlViewEntityListConfiguration GetConfigControl() => new() + { + PaginationOn = false, + HideToolStripButton = new List + { + ToolStripButtonListNames.toolStripButtonSearch + } + }; + + public EmployeePostListViewModel GetDataForControl() => _businessLogic.GetList(new EmployeePostGetBindingModel()); + + public EmployeePostListViewModel GetDataFromParentForControl(Guid id) => throw new NotImplementedException(); + + public EmployeePostListViewModel GetDataWithPageNameForControl(string key) => throw new NotImplementedException(); + + public EmployeePostListViewModel GetDataWithPageNumberForControl(int page, int count) => throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeePostList.resx b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeePostList.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/DepartmentPortal/Department/DepartmentWindowsDesktop/EntityControls/ControlEmployeePostList.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/DepartmentPortal.sln b/DepartmentPortal/DepartmentPortal.sln index 8dfa719..8e646f0 100644 --- a/DepartmentPortal/DepartmentPortal.sln +++ b/DepartmentPortal/DepartmentPortal.sln @@ -27,6 +27,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DepartmentBusinessLogic", " EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DepartmentDatabaseImplementation", "Department\DepartmentDatabaseImplementation.csproj\DepartmentDatabaseImplementation.csproj", "{1A9E20FE-6324-4839-A3AD-5726305122A5}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DepartmentWindowsDesktop", "Department\DepartmentWindowsDesktop\DepartmentWindowsDesktop.csproj", "{8E12DE14-0D83-48D8-964D-8B2BB06DB129}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -69,6 +71,10 @@ Global {1A9E20FE-6324-4839-A3AD-5726305122A5}.Debug|Any CPU.Build.0 = Debug|Any CPU {1A9E20FE-6324-4839-A3AD-5726305122A5}.Release|Any CPU.ActiveCfg = Release|Any CPU {1A9E20FE-6324-4839-A3AD-5726305122A5}.Release|Any CPU.Build.0 = Release|Any CPU + {8E12DE14-0D83-48D8-964D-8B2BB06DB129}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E12DE14-0D83-48D8-964D-8B2BB06DB129}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E12DE14-0D83-48D8-964D-8B2BB06DB129}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E12DE14-0D83-48D8-964D-8B2BB06DB129}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -82,6 +88,7 @@ Global {84CD6D9F-9B38-4392-B8A5-4FD32CF54BEC} = {6F154F8D-3437-45EE-9D89-02B96BDF3E8E} {69B94DB1-D1BE-4905-81AC-A5D49D0C9719} = {A19E7709-6AD8-4E9B-B3AB-4339C67D9F39} {1A9E20FE-6324-4839-A3AD-5726305122A5} = {A19E7709-6AD8-4E9B-B3AB-4339C67D9F39} + {8E12DE14-0D83-48D8-964D-8B2BB06DB129} = {A19E7709-6AD8-4E9B-B3AB-4339C67D9F39} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {FBA0CB49-EF2D-4538-9D00-FCEDA24879A9}