diff --git a/PrecastConcretePlant/ImplementationExtensions/PrecastConcretePlantContracts.dll b/PrecastConcretePlant/ImplementationExtensions/PrecastConcretePlantContracts.dll index 73606a1..77bfdc7 100644 Binary files a/PrecastConcretePlant/ImplementationExtensions/PrecastConcretePlantContracts.dll and b/PrecastConcretePlant/ImplementationExtensions/PrecastConcretePlantContracts.dll differ diff --git a/PrecastConcretePlant/ImplementationExtensions/PrecastConcretePlantDataModels.dll b/PrecastConcretePlant/ImplementationExtensions/PrecastConcretePlantDataModels.dll index 3adb759..5021ec7 100644 Binary files a/PrecastConcretePlant/ImplementationExtensions/PrecastConcretePlantDataModels.dll and b/PrecastConcretePlant/ImplementationExtensions/PrecastConcretePlantDataModels.dll differ diff --git a/PrecastConcretePlant/ImplementationExtensions/PrecastConcretePlantDatabaseImplement.dll b/PrecastConcretePlant/ImplementationExtensions/PrecastConcretePlantDatabaseImplement.dll index 6509fa1..a8063fb 100644 Binary files a/PrecastConcretePlant/ImplementationExtensions/PrecastConcretePlantDatabaseImplement.dll and b/PrecastConcretePlant/ImplementationExtensions/PrecastConcretePlantDatabaseImplement.dll differ diff --git a/PrecastConcretePlant/ImplementationExtensions/PrecastConcretePlantFileImplement.dll b/PrecastConcretePlant/ImplementationExtensions/PrecastConcretePlantFileImplement.dll index 5539ef4..30f1d39 100644 Binary files a/PrecastConcretePlant/ImplementationExtensions/PrecastConcretePlantFileImplement.dll and b/PrecastConcretePlant/ImplementationExtensions/PrecastConcretePlantFileImplement.dll differ diff --git a/PrecastConcretePlant/ImplementationExtensions/PrecastConcretePlantListImplement.dll b/PrecastConcretePlant/ImplementationExtensions/PrecastConcretePlantListImplement.dll index 966b7db..d24417c 100644 Binary files a/PrecastConcretePlant/ImplementationExtensions/PrecastConcretePlantListImplement.dll and b/PrecastConcretePlant/ImplementationExtensions/PrecastConcretePlantListImplement.dll differ diff --git a/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/BusinessLogic/BackUpLogic.cs b/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/BusinessLogic/BackUpLogic.cs index e27cb12..f3870f3 100644 --- a/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/BusinessLogic/BackUpLogic.cs +++ b/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/BusinessLogic/BackUpLogic.cs @@ -50,7 +50,6 @@ namespace PrecastConcretePlantBusinessLogic.BusinessLogic { File.Delete(fileName); } - // берем метод для сохранения _logger.LogDebug("Get assembly"); var typeIId = typeof(IId); var assembly = typeIId.Assembly; @@ -71,14 +70,11 @@ namespace PrecastConcretePlantBusinessLogic.BusinessLogic throw new InvalidOperationException($"Не найден класс-модель для {type.Name}"); } _logger.LogDebug("Call SaveToFile method for {name} type", type.Name); - // вызываем метод на выполнение method?.MakeGenericMethod(modelType).Invoke(this, new object[] { model.FolderName }); } } _logger.LogDebug("Create zip and remove folder"); - // архивируем ZipFile.CreateFromDirectory(model.FolderName, fileName); - // удаляем папку dirInfo.Delete(true); } catch (Exception) @@ -86,7 +82,6 @@ namespace PrecastConcretePlantBusinessLogic.BusinessLogic throw; } } - private void SaveToFile(string folderName) where T : class, new() { var records = _backUpInfo.GetList(); diff --git a/PrecastConcretePlant/PrecastConcretePlantContracts/DI/DependencyManager.cs b/PrecastConcretePlant/PrecastConcretePlantContracts/DI/DependencyManager.cs index f5c1394..067e517 100644 --- a/PrecastConcretePlant/PrecastConcretePlantContracts/DI/DependencyManager.cs +++ b/PrecastConcretePlant/PrecastConcretePlantContracts/DI/DependencyManager.cs @@ -21,7 +21,6 @@ namespace PrecastConcretePlantContracts.DI } public static DependencyManager Instance { get { if (_manager == null) { lock (_locjObject) { _manager = new DependencyManager(); } } return _manager; } } - public static void InitDependency() { var ext = ServiceProviderLoader.GetImplementationExtensions(); @@ -29,7 +28,6 @@ namespace PrecastConcretePlantContracts.DI { throw new ArgumentNullException("Отсутствуют компоненты для загрузки зависимостей по модулям"); } - // регистрируем зависимости ext.RegisterServices(); } diff --git a/PrecastConcretePlant/PrecastConcretePlantDatabaseImplement/DatabaseImplementationExtension.cs b/PrecastConcretePlant/PrecastConcretePlantDatabaseImplement/DatabaseImplementationExtension.cs index 6139359..020e32c 100644 --- a/PrecastConcretePlant/PrecastConcretePlantDatabaseImplement/DatabaseImplementationExtension.cs +++ b/PrecastConcretePlant/PrecastConcretePlantDatabaseImplement/DatabaseImplementationExtension.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; using PrecastConcretePlantContracts.DI; using PrecastConcretePlantContracts.StoragesContracts; using PrecastConcretePlantDatabaseImplement.Implements; - +//начало 3его вопроса - Как реализован новый механизм настройки зависимостей? namespace PrecastConcretePlantDatabaseImplement { public class DatabaseImplementationExtension : IImplementationExtension diff --git a/PrecastConcretePlant/PrecastConcretePlantView/DataGridViewExtension.cs b/PrecastConcretePlant/PrecastConcretePlantView/DataGridViewExtension.cs index 27e34eb..25d7cba 100644 --- a/PrecastConcretePlant/PrecastConcretePlantView/DataGridViewExtension.cs +++ b/PrecastConcretePlant/PrecastConcretePlantView/DataGridViewExtension.cs @@ -5,7 +5,6 @@ using System.Text; using System.Threading.Tasks; using PrecastConcretePlantContracts.Attributes; - namespace PrecastConcretePlantView { public static class DataGridViewExtension @@ -20,6 +19,7 @@ namespace PrecastConcretePlantView var type = typeof(T); var properties = type.GetProperties(); + foreach (DataGridViewColumn column in grid.Columns) { var property = properties.FirstOrDefault(x => x.Name == column.Name); @@ -27,13 +27,15 @@ namespace PrecastConcretePlantView { throw new InvalidOperationException($"В типе {type.Name} не найдено свойство с именем {column.Name}"); } + var attribute = property.GetCustomAttributes(typeof(ColumnAttribute), true)?.SingleOrDefault(); + if (attribute == null) { throw new InvalidOperationException($"Не найден атрибут типа ColumnAttribute для свойства {property.Name}"); } - if (attribute is ColumnAttribute columnAttr) + if (attribute is ColumnAttribute columnAttr)//проставляем полученные аттрибуты { column.HeaderText = columnAttr.Title; column.Visible = columnAttr.Visible;