├── .gitignore
├── Level 1
├── 10
│ ├── 07_Avionika
│ │ ├── 07_Avionika.sln
│ │ └── 07_Avionika
│ │ │ ├── 07_Avionika.csproj
│ │ │ ├── App.config
│ │ │ ├── BoardSystem.cs
│ │ │ ├── Devices
│ │ │ ├── BaseDevice.cs
│ │ │ ├── Engine.cs
│ │ │ ├── IBaseDevice.cs
│ │ │ ├── PressureSensor.cs
│ │ │ ├── Sensor.cs
│ │ │ └── VoltageSensor.cs
│ │ │ ├── Program.cs
│ │ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ ├── 10_Delegates
│ │ ├── 10_Delegates.sln
│ │ └── 10_Delegates
│ │ │ ├── 10_Delegates.csproj
│ │ │ ├── App.config
│ │ │ ├── Delegates.cs
│ │ │ ├── Program.cs
│ │ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ └── 10_Events
│ │ ├── 10_Events.sln
│ │ └── 10_Events
│ │ ├── 10_Events.csproj
│ │ ├── App.config
│ │ ├── Program.cs
│ │ └── Properties
│ │ └── AssemblyInfo.cs
├── 11
│ ├── 11_Collections
│ │ ├── 11_Collections.sln
│ │ └── 11_Collections
│ │ │ ├── 11_Collections.csproj
│ │ │ ├── App.config
│ │ │ ├── Program.cs
│ │ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ └── 11_CustomCollection
│ │ ├── 11_CustomCollection.sln
│ │ └── 11_CustomCollection
│ │ ├── 11_CustomCollection.csproj
│ │ ├── App.config
│ │ ├── PrintableList.cs
│ │ ├── Program.cs
│ │ └── Properties
│ │ └── AssemblyInfo.cs
├── 12
│ ├── 12_Enumerables
│ │ ├── 12_Enumerables.sln
│ │ └── 12_Enumerables
│ │ │ ├── 12_Enumerables.csproj
│ │ │ ├── App.config
│ │ │ ├── Book.cs
│ │ │ ├── Library.cs
│ │ │ ├── Library2.cs
│ │ │ ├── Program.cs
│ │ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ ├── 12_TestCPPMemory
│ │ ├── 12_TestCPPMemory.sln
│ │ └── 12_TestCPPMemory
│ │ │ ├── 12_TestCPPMemory.cpp
│ │ │ ├── 12_TestCPPMemory.vcxproj
│ │ │ ├── 12_TestCPPMemory.vcxproj.filters
│ │ │ ├── ReadMe.txt
│ │ │ ├── stdafx.cpp
│ │ │ ├── stdafx.h
│ │ │ └── targetver.h
│ └── 12_TestCSharpMemory
│ │ ├── 12_TestCSharpMemory.sln
│ │ └── 12_TestCSharpMemory
│ │ ├── 12_TestCSharpMemory.csproj
│ │ ├── App.config
│ │ ├── Program.cs
│ │ └── Properties
│ │ └── AssemblyInfo.cs
├── 13
│ ├── 13_LINQ
│ │ ├── 13_LINQ.sln
│ │ └── 13_LINQ
│ │ │ ├── 13_LINQ.csproj
│ │ │ ├── App.config
│ │ │ ├── Extensions.cs
│ │ │ ├── Person.cs
│ │ │ ├── Program.cs
│ │ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ └── 13_LINQ2
│ │ ├── 13_LINQ2.sln
│ │ └── 13_LINQ2
│ │ ├── 13_LINQ2.csproj
│ │ ├── App.config
│ │ ├── Person.cs
│ │ ├── Program.cs
│ │ └── Properties
│ │ └── AssemblyInfo.cs
├── 14
│ ├── 14_Features
│ │ ├── 14_Features.sln
│ │ ├── 14_Features
│ │ │ ├── 14_Features.csproj
│ │ │ ├── App.config
│ │ │ ├── Class1.cs
│ │ │ ├── DbManager.cs
│ │ │ ├── Del.cs
│ │ │ ├── Program.cs
│ │ │ └── Properties
│ │ │ │ └── AssemblyInfo.cs
│ │ └── WindowsFormsApplication1
│ │ │ ├── App.config
│ │ │ ├── Form1.Designer.cs
│ │ │ ├── Form1.cs
│ │ │ ├── Program.cs
│ │ │ ├── Properties
│ │ │ ├── AssemblyInfo.cs
│ │ │ ├── Resources.Designer.cs
│ │ │ ├── Resources.resx
│ │ │ ├── Settings.Designer.cs
│ │ │ └── Settings.settings
│ │ │ └── WindowsFormsApplication1.csproj
│ ├── 14_LINQ3
│ │ ├── 14_LINQ3.sln
│ │ └── 14_LINQ3
│ │ │ ├── 14_LINQ3.csproj
│ │ │ ├── App.config
│ │ │ ├── Company.cs
│ │ │ ├── Person.cs
│ │ │ ├── Program.cs
│ │ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ └── 14_Variativeness
│ │ ├── 14_Variativeness.sln
│ │ └── 14_Variativeness
│ │ ├── 14_Variativeness.csproj
│ │ ├── App.config
│ │ ├── Container.cs
│ │ ├── IContainer.cs
│ │ ├── Program.cs
│ │ ├── Properties
│ │ └── AssemblyInfo.cs
│ │ └── Shape.cs
├── 16
│ └── 16_Threading
│ │ ├── 16_Threading.csproj
│ │ ├── 16_Threading.sln
│ │ ├── 16_Threading.v12.suo
│ │ ├── App.config
│ │ ├── Atomic.cs
│ │ ├── AtomicIncrement.cs
│ │ ├── DeadLock.cs
│ │ ├── Program.cs
│ │ ├── Properties
│ │ └── AssemblyInfo.cs
│ │ └── SharedData.cs
├── 02_GuessNumber
│ ├── 02_GuessNumber.sln
│ └── 02_GuessNumber
│ │ ├── 02_GuessNumber.csproj
│ │ ├── App.config
│ │ ├── Class10.cs
│ │ ├── Program.cs
│ │ ├── Properties
│ │ └── AssemblyInfo.cs
│ │ └── xxx.cs
├── 02_Types
│ ├── 02_Types.sln
│ └── 02_Types
│ │ ├── 02_Types.csproj
│ │ ├── App.config
│ │ ├── Program.cs
│ │ └── Properties
│ │ └── AssemblyInfo.cs
├── 04_Converter
│ ├── 04_Converter.sln
│ ├── 04_Converter
│ │ ├── 04_Converter.csproj
│ │ ├── Converter.cs
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ └── ConverterTest
│ │ ├── ConverterTest.csproj
│ │ ├── Properties
│ │ └── AssemblyInfo.cs
│ │ └── UnitTest1.cs
├── 04_Exceptions
│ ├── 04_Exceptions.sln
│ ├── 04_Exceptions
│ │ ├── 04_Exceptions.csproj
│ │ ├── App.config
│ │ ├── Program.cs
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ └── ReportLib
│ │ ├── Class1.cs
│ │ ├── Properties
│ │ └── AssemblyInfo.cs
│ │ ├── ReportException.cs
│ │ └── ReportLib.csproj
├── 05_Files
│ ├── 05_Files.sln
│ └── 05_Files
│ │ ├── 05_Files.csproj
│ │ ├── App.config
│ │ ├── Program.cs
│ │ └── Properties
│ │ └── AssemblyInfo.cs
├── 05_Streams
│ ├── 05_Streams.sln
│ └── 05_Streams
│ │ ├── 05_Streams.csproj
│ │ ├── App.config
│ │ ├── Program.cs
│ │ └── Properties
│ │ └── AssemblyInfo.cs
├── 06_NewTypes
│ ├── 06_NewTypes.sln
│ └── 06_NewTypes
│ │ ├── 06_NewTypes.csproj
│ │ ├── App.config
│ │ ├── Day.cs
│ │ ├── Input.cs
│ │ ├── Person.cs
│ │ ├── PersonInfo.cs
│ │ ├── Program.cs
│ │ └── Properties
│ │ └── AssemblyInfo.cs
├── 07_Avionika
│ ├── 07_Avionika.sln
│ └── 07_Avionika
│ │ ├── 07_Avionika.csproj
│ │ ├── App.config
│ │ ├── BoardSystem.cs
│ │ ├── Engine.cs
│ │ ├── Program.cs
│ │ └── Properties
│ │ └── AssemblyInfo.cs
├── 07_Classes
│ ├── 07_Classes.sln
│ ├── 07_Classes
│ │ ├── 07_Classes.csproj
│ │ ├── App.config
│ │ ├── Program.cs
│ │ ├── Program2.cs
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ └── ClassLibrary1
│ │ ├── ClassLibrary1.csproj
│ │ ├── Person.cs
│ │ └── Properties
│ │ └── AssemblyInfo.cs
├── 08
│ ├── 07_Avionika
│ │ ├── 07_Avionika.sln
│ │ └── 07_Avionika
│ │ │ ├── 07_Avionika.csproj
│ │ │ ├── App.config
│ │ │ ├── BoardSystem.cs
│ │ │ ├── Devices
│ │ │ ├── BaseDevice.cs
│ │ │ ├── Engine.cs
│ │ │ ├── IBaseDevice.cs
│ │ │ └── Sensor.cs
│ │ │ ├── Program.cs
│ │ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ └── 08_DemoInterfaces
│ │ ├── 08_DemoInterfaces.sln
│ │ └── 08_DemoInterfaces
│ │ ├── 08_DemoInterfaces.csproj
│ │ ├── App.config
│ │ ├── MyComparer.cs
│ │ ├── Program.cs
│ │ └── Properties
│ │ └── AssemblyInfo.cs
├── 09
│ ├── 07_Avionika
│ │ ├── 07_Avionika.sln
│ │ └── 07_Avionika
│ │ │ ├── 07_Avionika.csproj
│ │ │ ├── App.config
│ │ │ ├── BoardSystem.cs
│ │ │ ├── Devices
│ │ │ ├── BaseDevice.cs
│ │ │ ├── Engine.cs
│ │ │ ├── IBaseDevice.cs
│ │ │ └── Sensor.cs
│ │ │ ├── Program.cs
│ │ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ └── 09_Matrix
│ │ ├── 09_Matrix.sln
│ │ └── 09_Matrix
│ │ ├── 09_Matrix.csproj
│ │ ├── App.config
│ │ ├── Matrix.cs
│ │ ├── Program.cs
│ │ └── Properties
│ │ └── AssemblyInfo.cs
├── Books
│ ├── C# 5.0 in a Nutshell [Albahari Albahari] [2012] [pdf] [www.bookstor.ru].pdf
│ ├── Mark Michaelis - Essential C# 4.0, 3rd Edition 2010.pdf
│ ├── Microsoft.Press.CLR.via.Csharp.4th.Edition.Oct.2012.pdf
│ ├── Skeet J. - C# in Depth, 3rd Edition - 2013.pdf
│ ├── Рихтер Дж. - CLR via C#. Программирование на платформе Microsoft .NET Framework 4.5 на языке C# (Мастер-класс) - 2013.pdf
│ ├── Рихтер Дж. - CLR via C#. Программирование на платформе Microsoft .NET Framework 4.0 на языке C# (Мастер-класс) - 2012.pdf
│ ├── Скит Дж. - C# программирование для профессионалов - 2011.djvu
│ └── Троелсен Э. - Язык программирования C# 2010 и платформа .NET 4 - 2010.djvu
└── МатериалНепройденный.txt
├── Level 2
├── 10
│ ├── DemoExpressionTree
│ │ ├── ConsoleApplication1.sln
│ │ └── ConsoleApplication1
│ │ │ ├── App.config
│ │ │ ├── ConsoleApplication1.csproj
│ │ │ ├── Customers.cs
│ │ │ ├── Program.cs
│ │ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ └── Inspector
│ │ ├── Inspector.BLL
│ │ ├── Bootstrapper.cs
│ │ ├── Inspector.BLL.csproj
│ │ ├── Managers
│ │ │ └── CatalogManager.cs
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Inspector.DAL
│ │ ├── 00_Data.sql
│ │ ├── 00_Initial.sql
│ │ ├── AdoNet
│ │ │ ├── AdoNetConnectionFactory.cs
│ │ │ ├── AdoNetDbContext.cs
│ │ │ ├── AdoNetUnitOfWork.cs
│ │ │ └── GenericRepository.cs
│ │ ├── Bootstrapper.cs
│ │ ├── Db.cs
│ │ ├── Exceptions
│ │ │ └── DalException.cs
│ │ ├── Inspector.DAL.csproj
│ │ ├── Interfaces
│ │ │ ├── IConnectionFactory.cs
│ │ │ ├── IDbContext.cs
│ │ │ ├── IRepository.cs
│ │ │ └── IUnitOfWork.cs
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ └── packages.config
│ │ ├── Inspector.Domain
│ │ ├── Inspector.Domain.csproj
│ │ ├── Interfaces
│ │ │ ├── ICatalogManager.cs
│ │ │ └── IReportManager.cs
│ │ ├── Ioc
│ │ │ ├── IoC.cs
│ │ │ └── IoCException.cs
│ │ ├── Misc
│ │ │ ├── Filter.cs
│ │ │ └── TableAttribute.cs
│ │ ├── Models
│ │ │ ├── Area.cs
│ │ │ ├── FinIndex.cs
│ │ │ ├── GenericEntity.cs
│ │ │ ├── IEntity.cs
│ │ │ ├── OrgType.cs
│ │ │ └── Organization.cs
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Inspector.GUI
│ │ ├── AboutWindow.xaml
│ │ ├── AboutWindow.xaml.cs
│ │ ├── App.config
│ │ ├── App.xaml
│ │ ├── App.xaml.cs
│ │ ├── CatalogManager.cs
│ │ ├── Inspector.GUI.csproj
│ │ ├── MainWindow.xaml
│ │ ├── MainWindow.xaml.cs
│ │ └── Properties
│ │ │ ├── AssemblyInfo.cs
│ │ │ ├── Resources.Designer.cs
│ │ │ ├── Resources.resx
│ │ │ ├── Settings.Designer.cs
│ │ │ └── Settings.settings
│ │ ├── Inspector.Test
│ │ ├── BLL
│ │ │ └── CatalogManagerTest.cs
│ │ ├── DAL
│ │ │ └── GenericRepositoryTest.cs
│ │ ├── Helpers
│ │ │ └── DbContextHelper.cs
│ │ ├── Inspector.Test.csproj
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ └── packages.config
│ │ ├── Inspector.sln
│ │ └── packages
│ │ └── repositories.config
├── 11
│ └── Inspector
│ │ ├── Inspector.BLL
│ │ ├── Bootstrapper.cs
│ │ ├── Inspector.BLL.csproj
│ │ ├── Managers
│ │ │ ├── CatalogManager.cs
│ │ │ ├── FinancialManager.cs
│ │ │ └── GenericManager.cs
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Inspector.DAL
│ │ ├── 00_Data.sql
│ │ ├── 00_Initial.sql
│ │ ├── AdoNet
│ │ │ ├── AdoNetConnectionFactory.cs
│ │ │ ├── AdoNetDbContext.cs
│ │ │ ├── AdoNetUnitOfWork.cs
│ │ │ └── GenericRepository.cs
│ │ ├── Bootstrapper.cs
│ │ ├── Db.cs
│ │ ├── Exceptions
│ │ │ └── DalException.cs
│ │ ├── Inspector.DAL.csproj
│ │ ├── Interfaces
│ │ │ ├── IConnectionFactory.cs
│ │ │ ├── IDbContext.cs
│ │ │ ├── IRepository.cs
│ │ │ └── IUnitOfWork.cs
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ └── packages.config
│ │ ├── Inspector.Domain
│ │ ├── Inspector.Domain.csproj
│ │ ├── Interfaces
│ │ │ ├── ICatalogManager.cs
│ │ │ ├── IFinancialManager.cs
│ │ │ └── IReportManager.cs
│ │ ├── Ioc
│ │ │ ├── IoC.cs
│ │ │ └── IoCException.cs
│ │ ├── Misc
│ │ │ ├── Filter.cs
│ │ │ └── TableAttribute.cs
│ │ ├── Models
│ │ │ ├── Area.cs
│ │ │ ├── FinIndex.cs
│ │ │ ├── GenericEntity.cs
│ │ │ ├── IEntity.cs
│ │ │ ├── OrgType.cs
│ │ │ └── Organization.cs
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Inspector.GUI
│ │ ├── AboutWindow.xaml
│ │ ├── AboutWindow.xaml.cs
│ │ ├── App.config
│ │ ├── App.xaml
│ │ ├── App.xaml.cs
│ │ ├── Inspector.GUI.csproj
│ │ ├── MainWindow.xaml
│ │ ├── MainWindow.xaml.cs
│ │ ├── Properties
│ │ │ ├── AssemblyInfo.cs
│ │ │ ├── Resources.Designer.cs
│ │ │ ├── Resources.resx
│ │ │ ├── Settings.Designer.cs
│ │ │ └── Settings.settings
│ │ ├── StringExt.cs
│ │ └── packages.config
│ │ ├── Inspector.Test
│ │ ├── BLL
│ │ │ └── CatalogManagerTest.cs
│ │ ├── DAL
│ │ │ └── GenericRepositoryTest.cs
│ │ ├── Helpers
│ │ │ └── DbContextHelper.cs
│ │ ├── Inspector.Test.csproj
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ └── packages.config
│ │ ├── Inspector.sln
│ │ └── packages
│ │ └── repositories.config
├── 12
│ └── Inspector
│ │ ├── Inspector.BLL
│ │ ├── Bootstrapper.cs
│ │ ├── Inspector.BLL.csproj
│ │ ├── Managers
│ │ │ ├── CatalogManager.cs
│ │ │ ├── FinancialManager.cs
│ │ │ └── GenericManager.cs
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Inspector.DAL
│ │ ├── 00_Data.sql
│ │ ├── 00_Initial.sql
│ │ ├── AdoNet
│ │ │ ├── AdoNetConnectionFactory.cs
│ │ │ ├── AdoNetDbContext.cs
│ │ │ ├── AdoNetUnitOfWork.cs
│ │ │ └── GenericRepository.cs
│ │ ├── Bootstrapper.cs
│ │ ├── Db.cs
│ │ ├── Exceptions
│ │ │ └── DalException.cs
│ │ ├── Inspector.DAL.csproj
│ │ ├── Interfaces
│ │ │ ├── IConnectionFactory.cs
│ │ │ ├── IDbContext.cs
│ │ │ ├── IRepository.cs
│ │ │ └── IUnitOfWork.cs
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ └── packages.config
│ │ ├── Inspector.Domain
│ │ ├── Inspector.Domain.csproj
│ │ ├── Interfaces
│ │ │ ├── ICatalogManager.cs
│ │ │ ├── IFinancialManager.cs
│ │ │ └── IReportManager.cs
│ │ ├── Ioc
│ │ │ ├── IoC.cs
│ │ │ └── IoCException.cs
│ │ ├── Misc
│ │ │ ├── Filter.cs
│ │ │ └── TableAttribute.cs
│ │ ├── Models
│ │ │ ├── Area.cs
│ │ │ ├── FinIndex.cs
│ │ │ ├── GenericEntity.cs
│ │ │ ├── IEntity.cs
│ │ │ ├── OrgType.cs
│ │ │ └── Organization.cs
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Inspector.GUI
│ │ ├── AboutWindow.xaml
│ │ ├── AboutWindow.xaml.cs
│ │ ├── App.config
│ │ ├── App.xaml
│ │ ├── App.xaml.cs
│ │ ├── Forms
│ │ │ ├── DescriptionsForm.xaml
│ │ │ ├── DescriptionsForm.xaml.cs
│ │ │ ├── InitialDataTypingForm.xaml
│ │ │ └── InitialDataTypingForm.xaml.cs
│ │ ├── Inspector.GUI.csproj
│ │ ├── MainWindow.xaml
│ │ ├── MainWindow.xaml.cs
│ │ ├── Properties
│ │ │ ├── AssemblyInfo.cs
│ │ │ ├── Resources.Designer.cs
│ │ │ ├── Resources.resx
│ │ │ ├── Settings.Designer.cs
│ │ │ └── Settings.settings
│ │ ├── StringExt.cs
│ │ └── packages.config
│ │ ├── Inspector.Test
│ │ ├── BLL
│ │ │ └── CatalogManagerTest.cs
│ │ ├── DAL
│ │ │ └── GenericRepositoryTest.cs
│ │ ├── Helpers
│ │ │ └── DbContextHelper.cs
│ │ ├── Inspector.Test.csproj
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ └── packages.config
│ │ ├── Inspector.sln
│ │ └── packages
│ │ └── repositories.config
├── 13
│ └── Inspector
│ │ ├── Inspector.BLL
│ │ ├── Bootstrapper.cs
│ │ ├── Inspector.BLL.csproj
│ │ ├── Managers
│ │ │ ├── CatalogManager.cs
│ │ │ ├── FinancialManager.cs
│ │ │ └── GenericManager.cs
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Inspector.DAL
│ │ ├── 00_Data.sql
│ │ ├── 00_Initial.sql
│ │ ├── AdoNet
│ │ │ ├── AdoNetConnectionFactory.cs
│ │ │ ├── AdoNetDbContext.cs
│ │ │ ├── AdoNetUnitOfWork.cs
│ │ │ └── GenericRepository.cs
│ │ ├── Bootstrapper.cs
│ │ ├── Db.cs
│ │ ├── Exceptions
│ │ │ └── DalException.cs
│ │ ├── Inspector.DAL.csproj
│ │ ├── Interfaces
│ │ │ ├── IConnectionFactory.cs
│ │ │ ├── IDbContext.cs
│ │ │ ├── IRepository.cs
│ │ │ └── IUnitOfWork.cs
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ └── packages.config
│ │ ├── Inspector.Domain
│ │ ├── Inspector.Domain.csproj
│ │ ├── Interfaces
│ │ │ ├── ICatalogManager.cs
│ │ │ ├── IFinancialManager.cs
│ │ │ └── IReportManager.cs
│ │ ├── Ioc
│ │ │ ├── IoC.cs
│ │ │ ├── IoCException.cs
│ │ │ └── IoCMode.cs
│ │ ├── Misc
│ │ │ ├── Filter.cs
│ │ │ └── TableAttribute.cs
│ │ ├── Models
│ │ │ ├── Area.cs
│ │ │ ├── FinIndex.cs
│ │ │ ├── GenericEntity.cs
│ │ │ ├── IEntity.cs
│ │ │ ├── OrgType.cs
│ │ │ └── Organization.cs
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Inspector.GUI
│ │ ├── AboutWindow.xaml
│ │ ├── AboutWindow.xaml.cs
│ │ ├── App.config
│ │ ├── App.xaml
│ │ ├── App.xaml.cs
│ │ ├── Forms
│ │ │ ├── DescriptionsForm.xaml
│ │ │ ├── DescriptionsForm.xaml.cs
│ │ │ ├── IFormHost.cs
│ │ │ ├── InitialDataTypingForm.xaml
│ │ │ └── InitialDataTypingForm.xaml.cs
│ │ ├── Inspector.GUI.csproj
│ │ ├── MainWindow.xaml
│ │ ├── MainWindow.xaml.cs
│ │ ├── Properties
│ │ │ ├── AssemblyInfo.cs
│ │ │ ├── Resources.Designer.cs
│ │ │ ├── Resources.resx
│ │ │ ├── Settings.Designer.cs
│ │ │ └── Settings.settings
│ │ ├── StringExt.cs
│ │ ├── StylesDictionary.xaml
│ │ └── packages.config
│ │ ├── Inspector.Test
│ │ ├── BLL
│ │ │ └── CatalogManagerTest.cs
│ │ ├── DAL
│ │ │ └── GenericRepositoryTest.cs
│ │ ├── Helpers
│ │ │ └── DbContextHelper.cs
│ │ ├── Inspector.Test.csproj
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ └── packages.config
│ │ ├── Inspector.sln
│ │ └── packages
│ │ └── repositories.config
├── 01_WinForms
│ ├── 01_WinForms.sln
│ └── 01_WinForms
│ │ ├── 01_WinForms.csproj
│ │ ├── App.config
│ │ ├── MainForm.Designer.cs
│ │ ├── MainForm.cs
│ │ ├── MainForm.resx
│ │ ├── Program.cs
│ │ └── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
├── 02_Win32
│ ├── App.config
│ ├── Program.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ ├── Win32.cs
│ ├── Win32.csproj
│ ├── Win32.sln
│ ├── Win32.v12.suo
│ ├── Win32
│ │ ├── App.config
│ │ ├── Program.cs
│ │ ├── Properties
│ │ │ ├── AssemblyInfo.cs
│ │ │ ├── Resources.Designer.cs
│ │ │ ├── Resources.resx
│ │ │ ├── Settings.Designer.cs
│ │ │ └── Settings.settings
│ │ ├── Win32.cs
│ │ └── Win32.csproj
│ ├── WinForms
│ │ ├── App.config
│ │ ├── Form1.Designer.cs
│ │ ├── Form1.cs
│ │ ├── Form1.resx
│ │ ├── Program.cs
│ │ ├── Properties
│ │ │ ├── AssemblyInfo.cs
│ │ │ ├── Resources.Designer.cs
│ │ │ ├── Resources.resx
│ │ │ ├── Settings.Designer.cs
│ │ │ └── Settings.settings
│ │ └── WinForms.csproj
│ └── Wpf
│ │ ├── App.config
│ │ ├── App.xaml
│ │ ├── App.xaml.cs
│ │ ├── MainWindow.xaml
│ │ ├── MainWindow.xaml.cs
│ │ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ │ └── Wpf.csproj
├── 03
│ └── Inspector
│ │ ├── Inspector.BLL
│ │ ├── Inspector.BLL.csproj
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Inspector.DAL
│ │ ├── Inspector.DAL.csproj
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Inspector.Domain
│ │ ├── Inspector.Domain.csproj
│ │ ├── Interfaces
│ │ │ └── IReportManager.cs
│ │ ├── Misc
│ │ │ └── Filter.cs
│ │ ├── Models
│ │ │ ├── Area.cs
│ │ │ ├── FinIndex.cs
│ │ │ ├── OrgType.cs
│ │ │ └── Organization.cs
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Inspector.GUI
│ │ ├── AboutWindow.xaml
│ │ ├── AboutWindow.xaml.cs
│ │ ├── App.config
│ │ ├── App.xaml
│ │ ├── App.xaml.cs
│ │ ├── Inspector.GUI.csproj
│ │ ├── MainWindow.xaml
│ │ ├── MainWindow.xaml.cs
│ │ └── Properties
│ │ │ ├── AssemblyInfo.cs
│ │ │ ├── Resources.Designer.cs
│ │ │ ├── Resources.resx
│ │ │ ├── Settings.Designer.cs
│ │ │ └── Settings.settings
│ │ └── Inspector.sln
├── 04
│ └── Inspector
│ │ ├── Inspector.BLL
│ │ ├── Bootstrapper.cs
│ │ ├── Inspector.BLL.csproj
│ │ ├── Managers
│ │ │ └── CatalogManager.cs
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Inspector.DAL
│ │ ├── Inspector.DAL.csproj
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Inspector.Domain
│ │ ├── Inspector.Domain.csproj
│ │ ├── Interfaces
│ │ │ ├── ICatalogManager.cs
│ │ │ └── IReportManager.cs
│ │ ├── Ioc
│ │ │ ├── IoC.cs
│ │ │ └── IoCException.cs
│ │ ├── Misc
│ │ │ └── Filter.cs
│ │ ├── Models
│ │ │ ├── Area.cs
│ │ │ ├── FinIndex.cs
│ │ │ ├── OrgType.cs
│ │ │ └── Organization.cs
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Inspector.GUI
│ │ ├── AboutWindow.xaml
│ │ ├── AboutWindow.xaml.cs
│ │ ├── App.config
│ │ ├── App.xaml
│ │ ├── App.xaml.cs
│ │ ├── CatalogManager.cs
│ │ ├── Inspector.GUI.csproj
│ │ ├── MainWindow.xaml
│ │ ├── MainWindow.xaml.cs
│ │ └── Properties
│ │ │ ├── AssemblyInfo.cs
│ │ │ ├── Resources.Designer.cs
│ │ │ ├── Resources.resx
│ │ │ ├── Settings.Designer.cs
│ │ │ └── Settings.settings
│ │ ├── Inspector.Test
│ │ ├── BLL
│ │ │ └── CatalogManagerTest.cs
│ │ ├── Inspector.Test.csproj
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ │ └── Inspector.sln
├── 05
│ └── Inspector
│ │ ├── Inspector.BLL
│ │ ├── Bootstrapper.cs
│ │ ├── Inspector.BLL.csproj
│ │ ├── Managers
│ │ │ └── CatalogManager.cs
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Inspector.DAL
│ │ ├── Inspector.DAL.csproj
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Inspector.Domain
│ │ ├── Inspector.Domain.csproj
│ │ ├── Interfaces
│ │ │ ├── ICatalogManager.cs
│ │ │ └── IReportManager.cs
│ │ ├── Ioc
│ │ │ ├── IoC.cs
│ │ │ └── IoCException.cs
│ │ ├── Misc
│ │ │ └── Filter.cs
│ │ ├── Models
│ │ │ ├── Area.cs
│ │ │ ├── FinIndex.cs
│ │ │ ├── OrgType.cs
│ │ │ └── Organization.cs
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Inspector.GUI
│ │ ├── AboutWindow.xaml
│ │ ├── AboutWindow.xaml.cs
│ │ ├── App.config
│ │ ├── App.xaml
│ │ ├── App.xaml.cs
│ │ ├── CatalogManager.cs
│ │ ├── Inspector.GUI.csproj
│ │ ├── MainWindow.xaml
│ │ ├── MainWindow.xaml.cs
│ │ └── Properties
│ │ │ ├── AssemblyInfo.cs
│ │ │ ├── Resources.Designer.cs
│ │ │ ├── Resources.resx
│ │ │ ├── Settings.Designer.cs
│ │ │ └── Settings.settings
│ │ ├── Inspector.Test
│ │ ├── BLL
│ │ │ └── CatalogManagerTest.cs
│ │ ├── Inspector.Test.csproj
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ │ └── Inspector.sln
├── 06
│ └── Inspector
│ │ ├── Inspector.BLL
│ │ ├── Bootstrapper.cs
│ │ ├── Inspector.BLL.csproj
│ │ ├── Managers
│ │ │ └── CatalogManager.cs
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Inspector.DAL
│ │ ├── 00_Data.sql
│ │ ├── 00_Initial.sql
│ │ ├── Db.cs
│ │ ├── Inspector.DAL.csproj
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ └── packages.config
│ │ ├── Inspector.Domain
│ │ ├── Inspector.Domain.csproj
│ │ ├── Interfaces
│ │ │ ├── ICatalogManager.cs
│ │ │ └── IReportManager.cs
│ │ ├── Ioc
│ │ │ ├── IoC.cs
│ │ │ └── IoCException.cs
│ │ ├── Misc
│ │ │ └── Filter.cs
│ │ ├── Models
│ │ │ ├── Area.cs
│ │ │ ├── FinIndex.cs
│ │ │ ├── OrgType.cs
│ │ │ └── Organization.cs
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Inspector.GUI
│ │ ├── AboutWindow.xaml
│ │ ├── AboutWindow.xaml.cs
│ │ ├── App.config
│ │ ├── App.xaml
│ │ ├── App.xaml.cs
│ │ ├── CatalogManager.cs
│ │ ├── Inspector.GUI.csproj
│ │ ├── MainWindow.xaml
│ │ ├── MainWindow.xaml.cs
│ │ └── Properties
│ │ │ ├── AssemblyInfo.cs
│ │ │ ├── Resources.Designer.cs
│ │ │ ├── Resources.resx
│ │ │ ├── Settings.Designer.cs
│ │ │ └── Settings.settings
│ │ ├── Inspector.Test
│ │ ├── BLL
│ │ │ └── CatalogManagerTest.cs
│ │ ├── Inspector.Test.csproj
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Inspector.sln
│ │ └── packages
│ │ └── repositories.config
├── 08
│ └── Inspector
│ │ ├── Inspector.BLL
│ │ ├── Bootstrapper.cs
│ │ ├── Inspector.BLL.csproj
│ │ ├── Managers
│ │ │ └── CatalogManager.cs
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Inspector.DAL
│ │ ├── 00_Data.sql
│ │ ├── 00_Initial.sql
│ │ ├── AdoNet
│ │ │ ├── AdoNetConnectionFactory.cs
│ │ │ ├── AdoNetDbContext.cs
│ │ │ ├── AdoNetUnitOfWork.cs
│ │ │ └── GenericRepository.cs
│ │ ├── Bootstrapper.cs
│ │ ├── Db.cs
│ │ ├── Exceptions
│ │ │ └── DalException.cs
│ │ ├── Inspector.DAL.csproj
│ │ ├── Interfaces
│ │ │ ├── IConnectionFactory.cs
│ │ │ ├── IDbContext.cs
│ │ │ ├── IRepository.cs
│ │ │ └── IUnitOfWork.cs
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ └── packages.config
│ │ ├── Inspector.Domain
│ │ ├── Inspector.Domain.csproj
│ │ ├── Interfaces
│ │ │ ├── ICatalogManager.cs
│ │ │ └── IReportManager.cs
│ │ ├── Ioc
│ │ │ ├── IoC.cs
│ │ │ └── IoCException.cs
│ │ ├── Misc
│ │ │ └── Filter.cs
│ │ ├── Models
│ │ │ ├── Area.cs
│ │ │ ├── FinIndex.cs
│ │ │ ├── OrgType.cs
│ │ │ └── Organization.cs
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Inspector.GUI
│ │ ├── AboutWindow.xaml
│ │ ├── AboutWindow.xaml.cs
│ │ ├── App.config
│ │ ├── App.xaml
│ │ ├── App.xaml.cs
│ │ ├── CatalogManager.cs
│ │ ├── Inspector.GUI.csproj
│ │ ├── MainWindow.xaml
│ │ ├── MainWindow.xaml.cs
│ │ └── Properties
│ │ │ ├── AssemblyInfo.cs
│ │ │ ├── Resources.Designer.cs
│ │ │ ├── Resources.resx
│ │ │ ├── Settings.Designer.cs
│ │ │ └── Settings.settings
│ │ ├── Inspector.Test
│ │ ├── BLL
│ │ │ └── CatalogManagerTest.cs
│ │ ├── Helpers
│ │ │ └── DbContextHelper.cs
│ │ ├── Inspector.Test.csproj
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ └── packages.config
│ │ ├── Inspector.sln
│ │ └── packages
│ │ └── repositories.config
├── 09
│ └── Inspector
│ │ ├── Inspector.BLL
│ │ ├── Bootstrapper.cs
│ │ ├── Inspector.BLL.csproj
│ │ ├── Managers
│ │ │ └── CatalogManager.cs
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Inspector.DAL
│ │ ├── 00_Data.sql
│ │ ├── 00_Initial.sql
│ │ ├── AdoNet
│ │ │ ├── AdoNetConnectionFactory.cs
│ │ │ ├── AdoNetDbContext.cs
│ │ │ ├── AdoNetUnitOfWork.cs
│ │ │ └── GenericRepository.cs
│ │ ├── Bootstrapper.cs
│ │ ├── Db.cs
│ │ ├── Exceptions
│ │ │ └── DalException.cs
│ │ ├── Inspector.DAL.csproj
│ │ ├── Interfaces
│ │ │ ├── IConnectionFactory.cs
│ │ │ ├── IDbContext.cs
│ │ │ ├── IRepository.cs
│ │ │ └── IUnitOfWork.cs
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ └── packages.config
│ │ ├── Inspector.Domain
│ │ ├── Inspector.Domain.csproj
│ │ ├── Interfaces
│ │ │ ├── ICatalogManager.cs
│ │ │ └── IReportManager.cs
│ │ ├── Ioc
│ │ │ ├── IoC.cs
│ │ │ └── IoCException.cs
│ │ ├── Misc
│ │ │ ├── Filter.cs
│ │ │ └── TableAttribute.cs
│ │ ├── Models
│ │ │ ├── Area.cs
│ │ │ ├── FinIndex.cs
│ │ │ ├── GenericEntity.cs
│ │ │ ├── IEntity.cs
│ │ │ ├── OrgType.cs
│ │ │ └── Organization.cs
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Inspector.GUI
│ │ ├── AboutWindow.xaml
│ │ ├── AboutWindow.xaml.cs
│ │ ├── App.config
│ │ ├── App.xaml
│ │ ├── App.xaml.cs
│ │ ├── CatalogManager.cs
│ │ ├── Inspector.GUI.csproj
│ │ ├── MainWindow.xaml
│ │ ├── MainWindow.xaml.cs
│ │ └── Properties
│ │ │ ├── AssemblyInfo.cs
│ │ │ ├── Resources.Designer.cs
│ │ │ ├── Resources.resx
│ │ │ ├── Settings.Designer.cs
│ │ │ └── Settings.settings
│ │ ├── Inspector.Test
│ │ ├── BLL
│ │ │ └── CatalogManagerTest.cs
│ │ ├── Helpers
│ │ │ └── DbContextHelper.cs
│ │ ├── Inspector.Test.csproj
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ └── packages.config
│ │ ├── Inspector.sln
│ │ └── packages
│ │ └── repositories.config
├── Prepar
│ └── Inspector
│ │ ├── Inspector.BLL
│ │ ├── Bootstrapper.cs
│ │ ├── Inspector.BLL.csproj
│ │ ├── Managers
│ │ │ ├── CatalogManager.cs
│ │ │ ├── FinancialManager.cs
│ │ │ └── GenericManager.cs
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Inspector.DAL
│ │ ├── 00_Data.sql
│ │ ├── 00_Initial.sql
│ │ ├── AdoNet
│ │ │ ├── AdoNetConnectionFactory.cs
│ │ │ ├── AdoNetDbContext.cs
│ │ │ ├── AdoNetUnitOfWork.cs
│ │ │ └── GenericRepository.cs
│ │ ├── Bootstrapper.cs
│ │ ├── Db.cs
│ │ ├── Exceptions
│ │ │ └── DalException.cs
│ │ ├── Inspector.DAL.csproj
│ │ ├── Interfaces
│ │ │ ├── IConnectionFactory.cs
│ │ │ ├── IDbContext.cs
│ │ │ ├── IRepository.cs
│ │ │ └── IUnitOfWork.cs
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ └── packages.config
│ │ ├── Inspector.Domain
│ │ ├── Inspector.Domain.csproj
│ │ ├── Interfaces
│ │ │ ├── ICatalogManager.cs
│ │ │ ├── IFinancialManager.cs
│ │ │ └── IReportManager.cs
│ │ ├── Ioc
│ │ │ ├── IoC.cs
│ │ │ └── IoCException.cs
│ │ ├── Misc
│ │ │ ├── Filter.cs
│ │ │ └── TableAttribute.cs
│ │ ├── Models
│ │ │ ├── Area.cs
│ │ │ ├── FinIndex.cs
│ │ │ ├── GenericEntity.cs
│ │ │ ├── IEntity.cs
│ │ │ ├── OrgType.cs
│ │ │ └── Organization.cs
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ │ ├── Inspector.GUI
│ │ ├── AboutWindow.xaml
│ │ ├── AboutWindow.xaml.cs
│ │ ├── App.config
│ │ ├── App.xaml
│ │ ├── App.xaml.cs
│ │ ├── Inspector.GUI.csproj
│ │ ├── MainWindow.xaml
│ │ ├── MainWindow.xaml.cs
│ │ ├── Properties
│ │ │ ├── AssemblyInfo.cs
│ │ │ ├── Resources.Designer.cs
│ │ │ ├── Resources.resx
│ │ │ ├── Settings.Designer.cs
│ │ │ └── Settings.settings
│ │ ├── StringExt.cs
│ │ ├── StylesDictionary.xaml
│ │ ├── Views
│ │ │ ├── DescriptionView.xaml
│ │ │ ├── DescriptionView.xaml.cs
│ │ │ ├── IViewHost.cs
│ │ │ ├── InitialDataTypingView.xaml
│ │ │ └── InitialDataTypingView.xaml.cs
│ │ └── packages.config
│ │ ├── Inspector.Test
│ │ ├── BLL
│ │ │ └── CatalogManagerTest.cs
│ │ ├── DAL
│ │ │ └── GenericRepositoryTest.cs
│ │ ├── Helpers
│ │ │ └── DbContextHelper.cs
│ │ ├── Inspector.Test.csproj
│ │ ├── Properties
│ │ │ └── AssemblyInfo.cs
│ │ └── packages.config
│ │ ├── Inspector.sln
│ │ └── packages
│ │ └── repositories.config
└── holder
├── Level 3
└── holder
├── Level 4
├── IIS_ASP_NET.jpg
└── lifecycle-of-an-aspnet-mvc-5-application.pdf
├── Level 5
└── holder
├── Links.txt
├── PREPOD21.LOG
└── pull.cmd
/.gitignore:
--------------------------------------------------------------------------------
1 | /Level 1/02_GuessNumber/*.suo
2 | /Level 1/02_Types/*.suo
3 | /Level 1/04_Converter/*.suo
4 | /Level 1/04_Exceptions/*.suo
5 | /Level 1/05_Files/*.suo
6 | /Level 1/05_Streams/*.suo
7 | /Level 1/06_NewTypes/*.suo
8 | /Level 1/07_Avionika/*.suo
9 | /Level 1/07_Classes/*.suo
10 | /Level 1/08/07_Avionika/*.suo
11 | /Level 1/08/08_DemoInterfaces/*.suo
12 | /Level 1/14/14_Features/*.suo
13 | /Level 1/14/14_LINQ3/*.suo
14 | /Level 1/14/14_Variativeness/*.suo
15 |
--------------------------------------------------------------------------------
/Level 1/02_GuessNumber/02_GuessNumber/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 1/02_GuessNumber/02_GuessNumber/Class10.cs:
--------------------------------------------------------------------------------
1 | using XXX;
2 |
3 | namespace School50
4 | {
5 | class Class10
6 | {
7 | public Class10(xxx e)
8 | {
9 |
10 | }
11 | public xxx m1(xxx x)
12 | {
13 | return new xxx();
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Level 1/02_GuessNumber/02_GuessNumber/xxx.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace XXX
3 | {
4 | class xxx
5 | {
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Level 1/02_Types/02_Types/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 1/02_Types/02_Types/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace _02_Types
8 | {
9 | class Program
10 | {
11 | static void Main(string[] args)
12 | {
13 | Console.WriteLine("Enter any string:");
14 |
15 | string st = Console.ReadLine();
16 |
17 | Console.WriteLine("You have entered: " + st);
18 |
19 | for (int k = 0; k < st.Length; k++)
20 | Console.WriteLine(st[k]);
21 |
22 | for (int k = 0; k < st.Length; k++)
23 | Console.Write(st[k]);
24 |
25 | Console.WriteLine();
26 |
27 | for (int k = st.Length - 1; k >= 0; k--)
28 | Console.Write(st[k]);
29 |
30 | Console.WriteLine(); Console.WriteLine();
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Level 1/04_Converter/04_Converter/Converter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace _04_Converter
8 | {
9 | public class Converter
10 | {
11 | public static void Main()
12 | {
13 | string st = Console.ReadLine();
14 |
15 | int n = ToInt(st);
16 |
17 | Console.WriteLine(n);
18 | }
19 |
20 | public static int ToInt(string st)
21 | {
22 | int res = 0;
23 |
24 | for (int k = st.Length - 1; k >= 0; k-- )
25 | {
26 | char c = st[k];
27 | int n = (byte)c - 0x30;
28 |
29 | int a = st.Length - k - 1;
30 |
31 | res = res + (int)Math.Pow(10, a) * n;
32 | }
33 |
34 | return res;
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/Level 1/04_Exceptions/04_Exceptions/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 1/04_Exceptions/ReportLib/Class1.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace ReportLib
9 | {
10 | public static class ReportPrinter
11 | {
12 | public static void YearReport()
13 | {
14 | var ex = new ReportException();
15 |
16 | try
17 | {
18 | throw ex;
19 |
20 | Debug.WriteLine("TRY");
21 | }
22 | catch(FormatException)
23 | {
24 | Debug.WriteLine("CATCH");
25 | }
26 | finally
27 | {
28 | Debug.WriteLine("FINALLY");
29 | }
30 |
31 | Debug.WriteLine("AFTER FINALLY");
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Level 1/04_Exceptions/ReportLib/ReportException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace ReportLib
8 | {
9 | public class ReportException : Exception
10 | {
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 1/05_Files/05_Files/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 1/05_Streams/05_Streams/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 1/06_NewTypes/06_NewTypes/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Level 1/06_NewTypes/06_NewTypes/Day.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace _06_NewTypes
8 | {
9 | enum Day
10 | {
11 | Mon,
12 | Tue,
13 | Wed
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Level 1/06_NewTypes/06_NewTypes/Input.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace _06_NewTypes
7 | {
8 | internal static class Input
9 | {
10 | internal static void Print(string s)
11 | {
12 | Console.WriteLine(s);
13 | }
14 |
15 | internal static string GetStr(string s)
16 | {
17 | Console.WriteLine(s);
18 |
19 | return Console.ReadLine();
20 | }
21 |
22 | internal static int GetInt(string s)
23 | {
24 | try
25 | {
26 | return Convert.ToInt32(GetStr(s));
27 | }
28 | catch(FormatException)
29 | {
30 | return int.MinValue;
31 | }
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Level 1/06_NewTypes/06_NewTypes/PersonInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace _06_NewTypes
7 | {
8 | struct PersonInfo
9 | {
10 | public string Account { get; set; }
11 | public decimal Summa { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Level 1/07_Avionika/07_Avionika/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 1/07_Avionika/07_Avionika/Engine.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace _07_Avionika
4 | {
5 | internal class Engine
6 | {
7 | private string _type;
8 |
9 | public Engine(string type)
10 | {
11 | _type = type;
12 | }
13 |
14 | internal void Start()
15 | {
16 | Console.WriteLine("Engine {0} Started", _type);
17 | }
18 |
19 | internal void Stop()
20 | {
21 | Console.WriteLine("Engine {0} Stopped", _type);
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Level 1/07_Avionika/07_Avionika/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace _07_Avionika
8 | {
9 | class Program
10 | {
11 | static void Main(string[] args)
12 | {
13 | new BoardSystem().Run();
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Level 1/07_Classes/07_Classes/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 1/07_Classes/07_Classes/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace _07_Classes
8 | {
9 | class Program
10 | {
11 | static void Main2(string[] args)
12 | {
13 | bool? b;
14 |
15 | b = null;
16 | b = true;
17 | b = false;
18 |
19 | if (b.HasValue)
20 | Console.WriteLine(b);
21 |
22 | var n = b.HasValue ? ((b.Value) ? 3 : 2) : 1;
23 |
24 | Console.WriteLine(n);
25 |
26 | int? x = null;
27 |
28 | x = 90;
29 |
30 | int r = x.Value;
31 |
32 | }
33 |
34 | private void x(Program _this, int e)
35 | {
36 | var w = this;
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/Level 1/07_Classes/07_Classes/Program2.cs:
--------------------------------------------------------------------------------
1 | using ClassLibrary1;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Data.SqlClient;
5 | using System.IO;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 |
10 | namespace _07_Classes
11 | {
12 | public class Program2
13 | {
14 | public static void Main()
15 | {
16 | var p = new Person();
17 |
18 | p.Name = "John";
19 |
20 | p.Print();
21 |
22 | p.Save();
23 | }
24 | }
25 |
26 | internal static class PersonExt
27 | {
28 | public static void Print(this Person p)
29 | {
30 | Console.WriteLine("Person Name: " + p.Name);
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Level 1/07_Classes/ClassLibrary1/Person.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 |
9 | namespace ClassLibrary1
10 | {
11 | public class Person
12 | {
13 | public string Name { get; set; }
14 |
15 | public void Save()
16 | {
17 | Db.Store(this);
18 | }
19 | }
20 |
21 | public class Db
22 | {
23 | internal static void Store(Person p)
24 | {
25 | File.WriteAllText("persons.db", p.Name);
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Level 1/08/07_Avionika/07_Avionika/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 1/08/07_Avionika/07_Avionika/Devices/BaseDevice.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace _07_Avionika.Devices
8 | {
9 | abstract class BaseDevice : IBaseDevice
10 | {
11 | private static int _counter;
12 | private int _id;
13 |
14 | public BaseDevice(int r)
15 | {
16 | _id = _counter++;
17 | }
18 |
19 | public virtual string GetInfo()
20 | {
21 | return string.Format(" ID = {0}", _id);
22 | }
23 |
24 | public void Start()
25 | {
26 | Console.WriteLine("{0}{1} Started", GetType().Name, GetInfo());
27 | }
28 |
29 | public void Stop()
30 | {
31 | Console.WriteLine("{0}{1} Stopped", GetType().Name, GetInfo());
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Level 1/08/07_Avionika/07_Avionika/Devices/Engine.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace _07_Avionika.Devices
4 | {
5 | internal sealed class Engine : BaseDevice
6 | {
7 | private string _type;
8 |
9 | public Engine(string type) : base(0)
10 | {
11 | _type = type;
12 | }
13 |
14 | public override string GetInfo()
15 | {
16 | return base.GetInfo() + " " + _type;
17 | }
18 |
19 | //internal void Start()
20 | //{
21 | // Console.WriteLine("Engine {0} Started", _type);
22 | //}
23 |
24 | //internal void Stop()
25 | //{
26 | // Console.WriteLine("Engine {0} Stopped", _type);
27 | //}
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Level 1/08/07_Avionika/07_Avionika/Devices/IBaseDevice.cs:
--------------------------------------------------------------------------------
1 | namespace _07_Avionika.Devices
2 | {
3 | internal interface IBaseDevice
4 | {
5 | void Start();
6 | void Stop();
7 |
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Level 1/08/07_Avionika/07_Avionika/Devices/Sensor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace _07_Avionika.Devices
8 | {
9 | internal sealed class Sensor : BaseDevice
10 | {
11 | public Sensor()
12 | :base(0)
13 | {
14 |
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Level 1/08/07_Avionika/07_Avionika/Program.cs:
--------------------------------------------------------------------------------
1 | using _07_Avionika.Devices;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace _07_Avionika
9 | {
10 | class Program
11 | {
12 | static void Main(string[] args)
13 | {
14 | new BoardSystem().Run();
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Level 1/08/08_DemoInterfaces/08_DemoInterfaces/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 1/08/08_DemoInterfaces/08_DemoInterfaces/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace _08_DemoInterfaces
9 | {
10 | class Program
11 | {
12 | static void Main(string[] args)
13 | {
14 | string[] mas = new string[]{"28052014", "14042014", "01012015"};
15 |
16 | IComparer c = new MyComparer();
17 |
18 | Array.Sort(mas, c);
19 |
20 | foreach (var item in mas)
21 | {
22 | Console.WriteLine(item);
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Level 1/09/07_Avionika/07_Avionika/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 1/09/07_Avionika/07_Avionika/Devices/Engine.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace _07_Avionika.Devices
4 | {
5 | internal sealed class Engine : BaseDevice
6 | {
7 | private string _type;
8 |
9 | public Engine(string type) : base(0)
10 | {
11 | _type = type;
12 | }
13 |
14 | public override string GetInfo()
15 | {
16 | var res = base.GetInfo() + " " + _type;
17 |
18 | if (!Started)
19 | {
20 | var time = (int)(DateTime.Now - StartTime).TotalMilliseconds;
21 |
22 |
23 | res += string.Format(" (Work Time = {0}ms) ", time);
24 | }
25 |
26 | return res;
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Level 1/09/07_Avionika/07_Avionika/Devices/IBaseDevice.cs:
--------------------------------------------------------------------------------
1 | namespace _07_Avionika.Devices
2 | {
3 | internal interface IBaseDevice
4 | {
5 | void Start();
6 | void Stop();
7 |
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Level 1/09/07_Avionika/07_Avionika/Devices/Sensor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace _07_Avionika.Devices
8 | {
9 | internal sealed class Sensor : BaseDevice
10 | {
11 | public Sensor()
12 | :base(0)
13 | {
14 |
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Level 1/09/07_Avionika/07_Avionika/Program.cs:
--------------------------------------------------------------------------------
1 | using _07_Avionika.Devices;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace _07_Avionika
9 | {
10 | class Program
11 | {
12 | static void Main(string[] args)
13 | {
14 | var bs = new BoardSystem();
15 |
16 | var el = bs.Devices[0];
17 | //var el2 = bs[345345];
18 |
19 | //bs.Devices = null;
20 |
21 | foreach (var item in bs.Devices)
22 | {
23 | Console.WriteLine(item);
24 | }
25 |
26 | bs.Run();
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Level 1/09/09_Matrix/09_Matrix/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 1/10/07_Avionika/07_Avionika/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 1/10/07_Avionika/07_Avionika/Devices/Engine.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace _07_Avionika.Devices
4 | {
5 | internal sealed class Engine : BaseDevice
6 | {
7 | private string _type;
8 |
9 | public Engine(string type) : base()
10 | {
11 | _type = type;
12 | }
13 |
14 | public override string GetInfo()
15 | {
16 | var res = base.GetInfo() + " " + _type;
17 |
18 | if (!Started)
19 | {
20 | var time = (int)(DateTime.Now - StartTime).TotalMilliseconds;
21 |
22 |
23 | res += string.Format(" (Work Time = {0}ms) ", time);
24 | }
25 |
26 | return res;
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Level 1/10/07_Avionika/07_Avionika/Devices/IBaseDevice.cs:
--------------------------------------------------------------------------------
1 | namespace _07_Avionika.Devices
2 | {
3 | internal interface IBaseDevice
4 | {
5 | void Start();
6 | void Stop();
7 |
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Level 1/10/07_Avionika/07_Avionika/Devices/PressureSensor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace _07_Avionika.Devices
8 | {
9 | internal sealed class PressureSensor : Sensor
10 | {
11 | protected override void Generate()
12 | {
13 | var x = DateTime.Now.Millisecond;
14 | Console.WriteLine("Pressure = 4." + x);
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Level 1/10/07_Avionika/07_Avionika/Devices/Sensor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Timers;
8 |
9 | namespace _07_Avionika.Devices
10 | {
11 | internal abstract class Sensor : BaseDevice
12 | {
13 | private Timer _timer;
14 | public Sensor() :base()
15 | {
16 | _timer = new Timer(1500);
17 | _timer.Elapsed += (s, e) =>
18 | {
19 | Generate();
20 | //var p = new Process();
21 | //p.StartInfo.FileName = "Notepad.exe";
22 | //p.Start();
23 | };
24 | _timer.Start();
25 | }
26 |
27 | protected abstract void Generate();
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Level 1/10/07_Avionika/07_Avionika/Devices/VoltageSensor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace _07_Avionika.Devices
8 | {
9 | internal sealed class VoltageSensor : Sensor
10 | {
11 | protected override void Generate()
12 | {
13 | var x = DateTime.Now.Millisecond;
14 | Console.WriteLine("Voltage = 1." + (x ^ 435).ToString());
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Level 1/10/07_Avionika/07_Avionika/Program.cs:
--------------------------------------------------------------------------------
1 | using _07_Avionika.Devices;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace _07_Avionika
9 | {
10 | class Program
11 | {
12 | static void Main(string[] args)
13 | {
14 | var bs = new BoardSystem();
15 |
16 | var el = bs.Devices[0];
17 | //var el2 = bs[345345];
18 |
19 | //bs.Devices = null;
20 |
21 | foreach (var item in bs.Devices)
22 | {
23 | Console.WriteLine(item);
24 | }
25 |
26 | bs.Run();
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Level 1/10/10_Delegates/10_Delegates/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 1/10/10_Delegates/10_Delegates/Delegates.cs:
--------------------------------------------------------------------------------
1 | namespace _10_Delegates
2 | {
3 | delegate void Act();
4 | delegate void ActStr(string st);
5 | delegate void ActStr2(string st1, string st2);
6 |
7 | delegate string StringDelegate(string st);
8 | }
9 |
--------------------------------------------------------------------------------
/Level 1/10/10_Events/10_Events/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 1/11/11_Collections/11_Collections/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 1/11/11_CustomCollection/11_CustomCollection/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 1/12/12_Enumerables/12_Enumerables/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 1/12/12_Enumerables/12_Enumerables/Book.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace _12_Enumerables
8 | {
9 | internal class Book
10 | {
11 | public string Title { get; set; }
12 | public int Year { get; set; }
13 |
14 | public override string ToString()
15 | {
16 | return string.Format("{0} - {1}", Title, Year);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Level 1/12/12_TestCPPMemory/12_TestCPPMemory/12_TestCPPMemory.cpp:
--------------------------------------------------------------------------------
1 | // 12_TestCPPMemory.cpp : Defines the entry point for the console application.
2 | //
3 |
4 | #include "stdafx.h"
5 |
6 |
7 | int _tmain(int argc, _TCHAR* argv[])
8 | {
9 | int n;
10 |
11 | n = 7;
12 |
13 | return 0;
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/Level 1/12/12_TestCPPMemory/12_TestCPPMemory/stdafx.cpp:
--------------------------------------------------------------------------------
1 | // stdafx.cpp : source file that includes just the standard includes
2 | // 12_TestCPPMemory.pch will be the pre-compiled header
3 | // stdafx.obj will contain the pre-compiled type information
4 |
5 | #include "stdafx.h"
6 |
7 | // TODO: reference any additional headers you need in STDAFX.H
8 | // and not in this file
9 |
--------------------------------------------------------------------------------
/Level 1/12/12_TestCPPMemory/12_TestCPPMemory/stdafx.h:
--------------------------------------------------------------------------------
1 | // stdafx.h : include file for standard system include files,
2 | // or project specific include files that are used frequently, but
3 | // are changed infrequently
4 | //
5 |
6 | #pragma once
7 |
8 | #include "targetver.h"
9 |
10 | #include
11 | #include
12 |
13 |
14 |
15 | // TODO: reference additional headers your program requires here
16 |
--------------------------------------------------------------------------------
/Level 1/12/12_TestCPPMemory/12_TestCPPMemory/targetver.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | // Including SDKDDKVer.h defines the highest available Windows platform.
4 |
5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
7 |
8 | #include
9 |
--------------------------------------------------------------------------------
/Level 1/12/12_TestCSharpMemory/12_TestCSharpMemory/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 1/13/13_LINQ/13_LINQ/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 1/13/13_LINQ/13_LINQ/Person.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace _13_LINQ
7 | {
8 | class Person
9 | {
10 | public string Name { get; set; }
11 |
12 | public int Age { get; set; }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Level 1/13/13_LINQ2/13_LINQ2/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 1/13/13_LINQ2/13_LINQ2/Person.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace _13_LINQ2
7 | {
8 | class Person
9 | {
10 | public string Name { get; set; }
11 |
12 | public int Age { get; set; }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Level 1/14/14_Features/14_Features/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 1/14/14_Features/14_Features/Class1.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace _14_Features
8 | {
9 | public partial class Class1
10 | {
11 | int r;
12 | int MyProperty { get; set; }
13 | public int MyProperty2 { get; set; }
14 |
15 | public void X()
16 | {
17 | Console.WriteLine("X");
18 | Z();
19 | }
20 |
21 | partial void Z();
22 | }
23 |
24 | public class Class2 : Class1
25 | {
26 |
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Level 1/14/14_Features/14_Features/DbManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace _14_Features
8 | {
9 | class DbManager
10 | {
11 | private static DbManager _this;
12 |
13 | private DbManager()
14 | {
15 |
16 | }
17 |
18 | public static DbManager Instance
19 | {
20 | get
21 | {
22 | return _this ?? (_this = new DbManager());
23 | }
24 | }
25 |
26 | public void X()
27 | {
28 |
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Level 1/14/14_Features/14_Features/Del.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace _14_Features
8 | {
9 | interface Del
10 | {
11 | void Work(T obj);
12 | }
13 |
14 | delegate void Del2(T obj);
15 |
16 | class DelImpl : Del
17 | {
18 | public void Work(T obj)
19 | {
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Level 1/14/14_Features/WindowsFormsApplication1/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 1/14/14_Features/WindowsFormsApplication1/Form1.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace WindowsFormsApplication1
12 | {
13 | public partial class Form1 : Form
14 | {
15 | public Form1()
16 | {
17 | InitializeComponent();
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Level 1/14/14_Features/WindowsFormsApplication1/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using System.Windows.Forms;
6 |
7 | namespace WindowsFormsApplication1
8 | {
9 | static class Program
10 | {
11 | ///
12 | /// The main entry point for the application.
13 | ///
14 | [STAThread]
15 | static void Main()
16 | {
17 | Application.EnableVisualStyles();
18 | Application.SetCompatibleTextRenderingDefault(false);
19 | Application.Run(new Form1());
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Level 1/14/14_Features/WindowsFormsApplication1/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Level 1/14/14_LINQ3/14_LINQ3/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 1/14/14_LINQ3/14_LINQ3/Company.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace _14_LINQ3
7 | {
8 | class Company
9 | {
10 | public string Name { get; set; }
11 |
12 | public string Area { get; set; }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Level 1/14/14_LINQ3/14_LINQ3/Person.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace _14_LINQ3
7 | {
8 | class Person
9 | {
10 | public string Name { get; set; }
11 |
12 | public int Age { get; set; }
13 |
14 | public string Company { get; set; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Level 1/14/14_Variativeness/14_Variativeness/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 1/14/14_Variativeness/14_Variativeness/Container.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace _14_Variativeness
8 | {
9 | public class Container : IContainer
10 | {
11 | public T GetItem()
12 | {
13 | return default(T);
14 | }
15 | }
16 |
17 | public class Container2 : IContainer2
18 | {
19 | public void SetItem(T obj)
20 | {
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Level 1/14/14_Variativeness/14_Variativeness/IContainer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace _14_Variativeness
8 | {
9 | public interface IContainer
10 | {
11 | T GetItem();
12 | }
13 |
14 | public interface IContainer2
15 | {
16 | void SetItem(T obj);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Level 1/14/14_Variativeness/14_Variativeness/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace _14_Variativeness
8 | {
9 |
10 | class Program
11 | {
12 | static void Main(string[] args)
13 | {
14 | IContainer list = new Container();
15 |
16 | Shape shape = new Circle();
17 |
18 | Shape[] mas = new Shape[2];
19 | mas[0] = new Circle();
20 |
21 | list = new Container();
22 |
23 | IContainer2 list2 = new Container2();
24 |
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Level 1/14/14_Variativeness/14_Variativeness/Shape.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace _14_Variativeness
8 | {
9 | public class Shape
10 | {
11 | }
12 |
13 | public class Circle : Shape
14 | {
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/Level 1/16/16_Threading/16_Threading.v12.suo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/micros-uz/csharp/4fef5a752e372d41aa2ad68432b6f6bef39ef7fe/Level 1/16/16_Threading/16_Threading.v12.suo
--------------------------------------------------------------------------------
/Level 1/16/16_Threading/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 1/Books/C# 5.0 in a Nutshell [Albahari Albahari] [2012] [pdf] [www.bookstor.ru].pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/micros-uz/csharp/4fef5a752e372d41aa2ad68432b6f6bef39ef7fe/Level 1/Books/C# 5.0 in a Nutshell [Albahari Albahari] [2012] [pdf] [www.bookstor.ru].pdf
--------------------------------------------------------------------------------
/Level 1/Books/Mark Michaelis - Essential C# 4.0, 3rd Edition 2010.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/micros-uz/csharp/4fef5a752e372d41aa2ad68432b6f6bef39ef7fe/Level 1/Books/Mark Michaelis - Essential C# 4.0, 3rd Edition 2010.pdf
--------------------------------------------------------------------------------
/Level 1/Books/Microsoft.Press.CLR.via.Csharp.4th.Edition.Oct.2012.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/micros-uz/csharp/4fef5a752e372d41aa2ad68432b6f6bef39ef7fe/Level 1/Books/Microsoft.Press.CLR.via.Csharp.4th.Edition.Oct.2012.pdf
--------------------------------------------------------------------------------
/Level 1/Books/Skeet J. - C# in Depth, 3rd Edition - 2013.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/micros-uz/csharp/4fef5a752e372d41aa2ad68432b6f6bef39ef7fe/Level 1/Books/Skeet J. - C# in Depth, 3rd Edition - 2013.pdf
--------------------------------------------------------------------------------
/Level 1/Books/Рихтер Дж. - CLR via C#. Программирование на платформе Microsoft .NET Framework 4.5 на языке C# (Мастер-класс) - 2013.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/micros-uz/csharp/4fef5a752e372d41aa2ad68432b6f6bef39ef7fe/Level 1/Books/Рихтер Дж. - CLR via C#. Программирование на платформе Microsoft .NET Framework 4.5 на языке C# (Мастер-класс) - 2013.pdf
--------------------------------------------------------------------------------
/Level 1/Books/Рихтер Дж. - CLR via C#. Программирование на платформе Microsoft .NET Framework 4.0 на языке C# (Мастер-класс) - 2012.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/micros-uz/csharp/4fef5a752e372d41aa2ad68432b6f6bef39ef7fe/Level 1/Books/Рихтер Дж. - CLR via C#. Программирование на платформе Microsoft .NET Framework 4.0 на языке C# (Мастер-класс) - 2012.pdf
--------------------------------------------------------------------------------
/Level 1/Books/Скит Дж. - C# программирование для профессионалов - 2011.djvu:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/micros-uz/csharp/4fef5a752e372d41aa2ad68432b6f6bef39ef7fe/Level 1/Books/Скит Дж. - C# программирование для профессионалов - 2011.djvu
--------------------------------------------------------------------------------
/Level 1/Books/Троелсен Э. - Язык программирования C# 2010 и платформа .NET 4 - 2010.djvu:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/micros-uz/csharp/4fef5a752e372d41aa2ad68432b6f6bef39ef7fe/Level 1/Books/Троелсен Э. - Язык программирования C# 2010 и платформа .NET 4 - 2010.djvu
--------------------------------------------------------------------------------
/Level 1/МатериалНепройденный.txt:
--------------------------------------------------------------------------------
1 | 1) Partial methods and classes
2 | 2) Stucts http://msdn.microsoft.com/en-us/library/ms173109.aspx
3 | http://geekswithblogs.net/BlackRabbitCoder/archive/2010/07/29/c-fundamentals-the-differences-between-struct-and-class.aspx
4 | http://geekswithblogs.net/BlackRabbitCoder/archive/2010/07/29/c-fundamentals-the-differences-between-struct-and-class.aspx
5 |
6 | 3) ref keyword
7 | 4) covariance and contrvariance http://habrahabr.ru/post/43938/
8 |
--------------------------------------------------------------------------------
/Level 2/01_WinForms/01_WinForms/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 2/01_WinForms/01_WinForms/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using System.Windows.Forms;
6 |
7 | namespace _01_WinForms
8 | {
9 | static class Program
10 | {
11 | [STAThread]
12 | static void Main()
13 | {
14 | Application.EnableVisualStyles();
15 | Application.SetCompatibleTextRenderingDefault(false);
16 | Application.Run(new MainForm());
17 | }
18 | }
19 | }
20 |
21 |
22 |
--------------------------------------------------------------------------------
/Level 2/01_WinForms/01_WinForms/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Level 2/02_Win32/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 2/02_Win32/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Level 2/02_Win32/Win32.v12.suo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/micros-uz/csharp/4fef5a752e372d41aa2ad68432b6f6bef39ef7fe/Level 2/02_Win32/Win32.v12.suo
--------------------------------------------------------------------------------
/Level 2/02_Win32/Win32/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 2/02_Win32/Win32/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Level 2/02_Win32/WinForms/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 2/02_Win32/WinForms/Form1.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace WinForms
12 | {
13 | public partial class Form1 : Form
14 | {
15 | public Form1()
16 | {
17 | InitializeComponent();
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Level 2/02_Win32/WinForms/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using System.Windows.Forms;
6 |
7 | namespace WinForms
8 | {
9 | static class Program
10 | {
11 | ///
12 | /// The main entry point for the application.
13 | ///
14 | [STAThread]
15 | static void Main()
16 | {
17 | Application.EnableVisualStyles();
18 | Application.SetCompatibleTextRenderingDefault(false);
19 | Application.Run(new Form1());
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Level 2/02_Win32/WinForms/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Level 2/02_Win32/Wpf/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 2/02_Win32/Wpf/App.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Level 2/02_Win32/Wpf/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace Wpf
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Level 2/02_Win32/Wpf/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Level 2/02_Win32/Wpf/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Wpf
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : Window
22 | {
23 | public MainWindow()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Level 2/02_Win32/Wpf/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Level 2/03/Inspector/Inspector.Domain/Interfaces/IReportManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Misc;
2 | using System;
3 |
4 | namespace Inspector.Domain.Interfaces
5 | {
6 | public interface IReportManager
7 | {
8 | void GetTotalProductVolume(Filter filter);
9 | void GetTotalRevenue(Filter filter);
10 | void GetTotalProfit(Filter filter);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/03/Inspector/Inspector.Domain/Misc/Filter.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System;
3 |
4 | namespace Inspector.Domain.Misc
5 | {
6 | public class Filter
7 | {
8 | public string Soato {get;set;}
9 | public DateTime? StartDate { get; set; }
10 | public DateTime? EndDate { get; set; }
11 | public OrgType? OrgType { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Level 2/03/Inspector/Inspector.Domain/Models/Area.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.Domain.Models
2 | {
3 | public class Area
4 | {
5 | public int Id { get; set; }
6 | public string Name { get; set; }
7 | public string SOATO { get; set; }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Level 2/03/Inspector/Inspector.Domain/Models/FinIndex.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Inspector.Domain.Models
4 | {
5 | public class FinIndex
6 | {
7 | public int IndexId { get; set; }
8 | public int OrgId { get; set; }
9 | public decimal ProductVolume { get; set; }
10 | public decimal Revenue { get; set; }
11 | public decimal Profit { get; set; }
12 | public DateTime StartDate { get; set; }
13 | public DateTime EndDate { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Level 2/03/Inspector/Inspector.Domain/Models/OrgType.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.Domain.Models
2 | {
3 | public enum OrgType
4 | {
5 | None = 0,
6 | Small = 1,
7 | Micro = 2,
8 | Large = 3,
9 | Other = 4,
10 | Personal = 5
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/03/Inspector/Inspector.Domain/Models/Organization.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.Domain.Models
2 | {
3 | public class Organization
4 | {
5 | public int Id { get; set; }
6 | public string OKPO { get; set; }
7 | public string SOATO { get; set; }
8 | public string INN { get; set; }
9 | public string Name { get; set; }
10 | public OrgType Type { get; set; }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/03/Inspector/Inspector.GUI/AboutWindow.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
15 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Level 2/03/Inspector/Inspector.GUI/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 2/03/Inspector/Inspector.GUI/App.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Level 2/03/Inspector/Inspector.GUI/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows;
3 |
4 | namespace Inspector.GUI
5 | {
6 | public partial class App : Application
7 | {
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Level 2/03/Inspector/Inspector.GUI/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Level 2/03/Inspector/Inspector.GUI/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Inspector.GUI
17 | {
18 | public partial class MainWindow : Window
19 | {
20 | public MainWindow()
21 | {
22 | InitializeComponent();
23 | }
24 |
25 | private void AboutItem_Click(object sender, RoutedEventArgs e)
26 | {
27 | new AboutWindow(this).ShowDialog();
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Level 2/03/Inspector/Inspector.GUI/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Level 2/04/Inspector/Inspector.BLL/Bootstrapper.cs:
--------------------------------------------------------------------------------
1 | using Inspector.BLL.Managers;
2 | using Inspector.Domain.Interfaces;
3 | using Inspector.Domain.Ioc;
4 |
5 | namespace Inspector.BLL
6 | {
7 | public static class Bootstrapper
8 | {
9 | public static void Init()
10 | {
11 | IoC.Register();
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Level 2/04/Inspector/Inspector.BLL/Managers/CatalogManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Interfaces;
2 | using Inspector.Domain.Models;
3 | using System.Collections.Generic;
4 |
5 | namespace Inspector.BLL.Managers
6 | {
7 | internal class CatalogManager : ICatalogManager
8 | {
9 | public IEnumerable GetAreas()
10 | {
11 | return new List
12 | {
13 | new Area{Name = "Toshkent", SOATO = "1726"},
14 | new Area{Name = "Toshkent viloyati", SOATO = "1727"},
15 | new Area{Name = "Fargona viloyati", SOATO = "1730"}
16 | };
17 | }
18 |
19 | public IEnumerable GetOrgatizations(string soato)
20 | {
21 | throw new System.NotImplementedException();
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Level 2/04/Inspector/Inspector.Domain/Interfaces/ICatalogManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System.Collections.Generic;
3 |
4 | namespace Inspector.Domain.Interfaces
5 | {
6 | public interface ICatalogManager
7 | {
8 | IEnumerable GetAreas();
9 | IEnumerable GetOrgatizations(string soato);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Level 2/04/Inspector/Inspector.Domain/Interfaces/IReportManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Misc;
2 | using System;
3 |
4 | namespace Inspector.Domain.Interfaces
5 | {
6 | public interface IReportManager
7 | {
8 | void GetTotalProductVolume(Filter filter);
9 | void GetTotalRevenue(Filter filter);
10 | void GetTotalProfit(Filter filter);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/04/Inspector/Inspector.Domain/Ioc/IoC.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Interfaces;
2 | using System;
3 | using System.Collections.Generic;
4 |
5 | namespace Inspector.Domain.Ioc
6 | {
7 | public static class IoC
8 | {
9 | private static IDictionary _dict = new Dictionary();
10 |
11 | public static void Register()
12 | {
13 | var intf = typeof(TIntf);
14 | var impl = typeof(TImpl);
15 |
16 | _dict[intf] = impl;
17 | }
18 |
19 | public static T Get()
20 | {
21 | if (_dict.ContainsKey(typeof(T)))
22 | {
23 | var type = _dict[typeof(T)];
24 |
25 | var res = Activator.CreateInstance(type);
26 |
27 | return (T)res;
28 | }
29 |
30 | throw new IoCException();
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Level 2/04/Inspector/Inspector.Domain/Ioc/IoCException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Inspector.Domain.Ioc
4 | {
5 | public class IoCException : Exception
6 | {
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/Level 2/04/Inspector/Inspector.Domain/Misc/Filter.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System;
3 |
4 | namespace Inspector.Domain.Misc
5 | {
6 | public class Filter
7 | {
8 | public string Soato {get;set;}
9 | public DateTime? StartDate { get; set; }
10 | public DateTime? EndDate { get; set; }
11 | public OrgType? OrgType { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Level 2/04/Inspector/Inspector.Domain/Models/Area.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.Domain.Models
2 | {
3 | public class Area
4 | {
5 | public int Id { get; set; }
6 | public string Name { get; set; }
7 | public string SOATO { get; set; }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Level 2/04/Inspector/Inspector.Domain/Models/FinIndex.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Inspector.Domain.Models
4 | {
5 | public class FinIndex
6 | {
7 | public int IndexId { get; set; }
8 | public int OrgId { get; set; }
9 | public decimal ProductVolume { get; set; }
10 | public decimal Revenue { get; set; }
11 | public decimal Profit { get; set; }
12 | public DateTime StartDate { get; set; }
13 | public DateTime EndDate { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Level 2/04/Inspector/Inspector.Domain/Models/OrgType.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.Domain.Models
2 | {
3 | public enum OrgType
4 | {
5 | None = 0,
6 | Small = 1,
7 | Micro = 2,
8 | Large = 3,
9 | Other = 4,
10 | Personal = 5
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/04/Inspector/Inspector.Domain/Models/Organization.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.Domain.Models
2 | {
3 | public class Organization
4 | {
5 | public int Id { get; set; }
6 | public string OKPO { get; set; }
7 | public string SOATO { get; set; }
8 | public string INN { get; set; }
9 | public string Name { get; set; }
10 | public OrgType Type { get; set; }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/04/Inspector/Inspector.GUI/AboutWindow.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
15 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Level 2/04/Inspector/Inspector.GUI/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 2/04/Inspector/Inspector.GUI/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Level 2/04/Inspector/Inspector.GUI/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using Inspector.BLL;
2 | using System;
3 | using System.Windows;
4 |
5 | namespace Inspector.GUI
6 | {
7 | public partial class App : Application
8 | {
9 | private void Application_Startup(object sender, StartupEventArgs e)
10 | {
11 | Bootstrapper.Init();
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Level 2/04/Inspector/Inspector.GUI/CatalogManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Inspector.GUI
7 | {
8 | class CatalogManager
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Level 2/04/Inspector/Inspector.GUI/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Level 2/04/Inspector/Inspector.Test/BLL/CatalogManagerTest.cs:
--------------------------------------------------------------------------------
1 | using System.Linq;
2 | using Inspector.BLL.Managers;
3 | using Microsoft.VisualStudio.TestTools.UnitTesting;
4 |
5 | namespace Inspector.Test.BLL
6 | {
7 | [TestClass]
8 | public class CatalogManagerTest
9 | {
10 | [TestMethod]
11 | public void GetAreTest()
12 | {
13 | var catMgr = new CatalogManager();
14 |
15 | var areas = catMgr.GetAreas();
16 |
17 | Assert.IsNotNull(areas);
18 | Assert.AreEqual(14, areas.Count());
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Level 2/05/Inspector/Inspector.BLL/Bootstrapper.cs:
--------------------------------------------------------------------------------
1 | using Inspector.BLL.Managers;
2 | using Inspector.Domain.Interfaces;
3 | using Inspector.Domain.Ioc;
4 |
5 | namespace Inspector.BLL
6 | {
7 | public static class Bootstrapper
8 | {
9 | public static void Init()
10 | {
11 | IoC.Register();
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Level 2/05/Inspector/Inspector.Domain/Interfaces/ICatalogManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System.Collections.Generic;
3 |
4 | namespace Inspector.Domain.Interfaces
5 | {
6 | public interface ICatalogManager
7 | {
8 | IEnumerable GetAreas();
9 | IEnumerable GetOrgatizations(string soato);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Level 2/05/Inspector/Inspector.Domain/Interfaces/IReportManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Misc;
2 | using System;
3 |
4 | namespace Inspector.Domain.Interfaces
5 | {
6 | public interface IReportManager
7 | {
8 | void GetTotalProductVolume(Filter filter);
9 | void GetTotalRevenue(Filter filter);
10 | void GetTotalProfit(Filter filter);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/05/Inspector/Inspector.Domain/Ioc/IoCException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Inspector.Domain.Ioc
4 | {
5 | public class IoCException : Exception
6 | {
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/Level 2/05/Inspector/Inspector.Domain/Misc/Filter.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System;
3 |
4 | namespace Inspector.Domain.Misc
5 | {
6 | public class Filter
7 | {
8 | public string Soato {get;set;}
9 | public DateTime? StartDate { get; set; }
10 | public DateTime? EndDate { get; set; }
11 | public OrgType? OrgType { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Level 2/05/Inspector/Inspector.Domain/Models/Area.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.Domain.Models
2 | {
3 | public class Area
4 | {
5 | public int Id { get; set; }
6 | public string Name { get; set; }
7 | public string SOATO { get; set; }
8 |
9 | public override string ToString()
10 | {
11 | return Name;
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Level 2/05/Inspector/Inspector.Domain/Models/FinIndex.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Inspector.Domain.Models
4 | {
5 | public class FinIndex
6 | {
7 | public int IndexId { get; set; }
8 | public int OrgId { get; set; }
9 | public decimal ProductVolume { get; set; }
10 | public decimal Revenue { get; set; }
11 | public decimal Profit { get; set; }
12 | public DateTime StartDate { get; set; }
13 | public DateTime EndDate { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Level 2/05/Inspector/Inspector.Domain/Models/OrgType.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.Domain.Models
2 | {
3 | public enum OrgType
4 | {
5 | None = 0,
6 | Small = 1,
7 | Micro = 2,
8 | Large = 3,
9 | Other = 4,
10 | Personal = 5
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/05/Inspector/Inspector.Domain/Models/Organization.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.Domain.Models
2 | {
3 | public class Organization
4 | {
5 | public int Id { get; set; }
6 | public string OKPO { get; set; }
7 | public string SOATO { get; set; }
8 | public string INN { get; set; }
9 | public string Name { get; set; }
10 | public OrgType Type { get; set; }
11 |
12 | public override string ToString()
13 | {
14 | return string.Format("{0,16} | {1,8}", Name, OKPO);
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Level 2/05/Inspector/Inspector.GUI/AboutWindow.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
15 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Level 2/05/Inspector/Inspector.GUI/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 2/05/Inspector/Inspector.GUI/App.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Level 2/05/Inspector/Inspector.GUI/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using Inspector.BLL;
2 | using Inspector.Domain.Ioc;
3 | using System;
4 | using System.Windows;
5 |
6 | namespace Inspector.GUI
7 | {
8 | public partial class App : Application
9 | {
10 | private void Application_Startup(object sender, StartupEventArgs e)
11 | {
12 | Bootstrapper.Init();
13 |
14 | IoC.Register();
15 |
16 | IoC.Get().Show();
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Level 2/05/Inspector/Inspector.GUI/CatalogManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Inspector.GUI
7 | {
8 | class CatalogManager
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Level 2/05/Inspector/Inspector.GUI/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Level 2/06/Inspector/Inspector.BLL/Bootstrapper.cs:
--------------------------------------------------------------------------------
1 | using Inspector.BLL.Managers;
2 | using Inspector.Domain.Interfaces;
3 | using Inspector.Domain.Ioc;
4 |
5 | namespace Inspector.BLL
6 | {
7 | public static class Bootstrapper
8 | {
9 | public static void Init()
10 | {
11 | IoC.Register();
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Level 2/06/Inspector/Inspector.DAL/00_Data.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Respublika Uzbekistan', '1700')
2 | GO
3 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Respublika Karakalpakstan', '1735')
4 | GO
5 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Andijan viloyati', '1703')
6 | GO
7 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Buhoro viloyati', '1706')
8 | GO
9 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Jizzah', '1708')
10 | GO
11 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Kashkadaryo viloyati', '1710')
12 | GO
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Level 2/06/Inspector/Inspector.DAL/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Level 2/06/Inspector/Inspector.Domain/Interfaces/ICatalogManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System.Collections.Generic;
3 |
4 | namespace Inspector.Domain.Interfaces
5 | {
6 | public interface ICatalogManager
7 | {
8 | IEnumerable GetAreas();
9 | IEnumerable GetOrgatizations(string soato);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Level 2/06/Inspector/Inspector.Domain/Interfaces/IReportManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Misc;
2 | using System;
3 |
4 | namespace Inspector.Domain.Interfaces
5 | {
6 | public interface IReportManager
7 | {
8 | void GetTotalProductVolume(Filter filter);
9 | void GetTotalRevenue(Filter filter);
10 | void GetTotalProfit(Filter filter);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/06/Inspector/Inspector.Domain/Ioc/IoCException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Inspector.Domain.Ioc
4 | {
5 | public class IoCException : Exception
6 | {
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/Level 2/06/Inspector/Inspector.Domain/Misc/Filter.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System;
3 |
4 | namespace Inspector.Domain.Misc
5 | {
6 | public class Filter
7 | {
8 | public string Soato {get;set;}
9 | public DateTime? StartDate { get; set; }
10 | public DateTime? EndDate { get; set; }
11 | public OrgType? OrgType { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Level 2/06/Inspector/Inspector.Domain/Models/Area.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.Domain.Models
2 | {
3 | public class Area
4 | {
5 | public int Id { get; set; }
6 | public string Name { get; set; }
7 | public string SOATO { get; set; }
8 |
9 | public override string ToString()
10 | {
11 | return Name;
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Level 2/06/Inspector/Inspector.Domain/Models/FinIndex.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Inspector.Domain.Models
4 | {
5 | public class FinIndex
6 | {
7 | public int Id { get; set; }
8 | public int OrgId { get; set; }
9 | public decimal ProductVolume { get; set; }
10 | public decimal Revenue { get; set; }
11 | public decimal Profit { get; set; }
12 | public DateTime StartDate { get; set; }
13 | public DateTime EndDate { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Level 2/06/Inspector/Inspector.Domain/Models/OrgType.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.Domain.Models
2 | {
3 | public enum OrgType
4 | {
5 | None = 0,
6 | Small = 1,
7 | Micro = 2,
8 | Large = 3,
9 | Other = 4,
10 | Personal = 5
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/06/Inspector/Inspector.Domain/Models/Organization.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.Domain.Models
2 | {
3 | public class Organization
4 | {
5 | public int Id { get; set; }
6 | public string OKPO { get; set; }
7 | public string SOATO { get; set; }
8 | public string INN { get; set; }
9 | public string Name { get; set; }
10 | public OrgType Type { get; set; }
11 |
12 | public override string ToString()
13 | {
14 | return string.Format("{0,16} | {1,8}", Name, OKPO);
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Level 2/06/Inspector/Inspector.GUI/AboutWindow.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
15 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Level 2/06/Inspector/Inspector.GUI/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 2/06/Inspector/Inspector.GUI/App.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Level 2/06/Inspector/Inspector.GUI/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using Inspector.BLL;
2 | using Inspector.Domain.Ioc;
3 | using System;
4 | using System.Windows;
5 |
6 | namespace Inspector.GUI
7 | {
8 | public partial class App : Application
9 | {
10 | private void Application_Startup(object sender, StartupEventArgs e)
11 | {
12 | Bootstrapper.Init();
13 |
14 | IoC.Register();
15 |
16 | IoC.Get().Show();
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Level 2/06/Inspector/Inspector.GUI/CatalogManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Inspector.GUI
7 | {
8 | class CatalogManager
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Level 2/06/Inspector/Inspector.GUI/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Level 2/06/Inspector/packages/repositories.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Level 2/08/Inspector/Inspector.BLL/Bootstrapper.cs:
--------------------------------------------------------------------------------
1 | using Inspector.BLL.Managers;
2 | using Inspector.Domain.Interfaces;
3 | using Inspector.Domain.Ioc;
4 |
5 | namespace Inspector.BLL
6 | {
7 | public static class Bootstrapper
8 | {
9 | public static void Init()
10 | {
11 | Inspector.DAL.Bootstrapper.Init();
12 |
13 | IoC.Register();
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Level 2/08/Inspector/Inspector.DAL/00_Data.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Respublika Uzbekistan', '1700')
2 | GO
3 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Respublika Karakalpakstan', '1735')
4 | GO
5 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Andijan viloyati', '1703')
6 | GO
7 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Buhoro viloyati', '1706')
8 | GO
9 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Jizzah', '1708')
10 | GO
11 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Kashkadaryo viloyati', '1710')
12 | GO
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Level 2/08/Inspector/Inspector.DAL/AdoNet/AdoNetConnectionFactory.cs:
--------------------------------------------------------------------------------
1 | using Inspector.DAL.Interfaces;
2 | using System.Configuration;
3 | using System.Data;
4 | using System.Data.Common;
5 | using System.Data.SqlClient;
6 |
7 | namespace Inspector.DAL.AdoNet
8 | {
9 | internal class AdoNetConnectionFactory : IConnectionFactory
10 | {
11 | public IDbConnection GetConnection()
12 | {
13 | var connStr = ConfigurationManager.ConnectionStrings["PROD_CONNSTR"];
14 |
15 | var providerName = connStr.ProviderName;
16 | var factory = DbProviderFactories.GetFactory(providerName);
17 |
18 | var conn = factory.CreateConnection();
19 |
20 | conn.Open();
21 |
22 | return conn;
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Level 2/08/Inspector/Inspector.DAL/AdoNet/AdoNetDbContext.cs:
--------------------------------------------------------------------------------
1 | using Inspector.DAL.Interfaces;
2 |
3 | namespace Inspector.DAL.AdoNet
4 | {
5 | internal class AdoNetDbContext : IDbContext
6 | {
7 | private readonly IConnectionFactory _connFactory;
8 |
9 | public AdoNetDbContext(IConnectionFactory connFactory)
10 | {
11 | _connFactory = connFactory;
12 | }
13 |
14 | public IUnitOfWork GetUnitOfWork()
15 | {
16 | return new AdoNetUnitOfWork(_connFactory);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Level 2/08/Inspector/Inspector.DAL/AdoNet/GenericRepository.cs:
--------------------------------------------------------------------------------
1 | using Inspector.DAL.Interfaces;
2 |
3 | namespace Inspector.DAL.AdoNet
4 | {
5 | internal class GenericRepository : IRepository where T : new()
6 | {
7 | private readonly IUnitOfWork _uow;
8 | public GenericRepository(IUnitOfWork uow)
9 | {
10 | _uow = uow;
11 | }
12 | public void Add(T entity)
13 | {
14 | using(var cmd = _uow.GetCommand())
15 | {
16 | cmd.CommandText = "";
17 | cmd.ExecuteNonQuery();
18 | }
19 | }
20 |
21 | public System.Collections.Generic.IEnumerable GetAll()
22 | {
23 | return null;
24 | }
25 |
26 | public void Update(T entity)
27 | {
28 | }
29 |
30 | public void Delete(T entity)
31 | {
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Level 2/08/Inspector/Inspector.DAL/Bootstrapper.cs:
--------------------------------------------------------------------------------
1 | using Inspector.DAL.Interfaces;
2 | using Inspector.Domain.Ioc;
3 | using Inspector.DAL.AdoNet;
4 |
5 | namespace Inspector.DAL
6 | {
7 | public static class Bootstrapper
8 | {
9 | public static void Init()
10 | {
11 | IoC.Register();
12 | IoC.Register();
13 | IoC.Register();
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Level 2/08/Inspector/Inspector.DAL/Exceptions/DalException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Inspector.DAL.Exceptions
4 | {
5 | public class DalException : Exception
6 | {
7 | public DalException()
8 | {
9 | }
10 |
11 | public DalException(string message)
12 | :base(message)
13 | {
14 | }
15 |
16 | public DalException(string message, Exception innerException)
17 | : base(message, innerException)
18 | {
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Level 2/08/Inspector/Inspector.DAL/Interfaces/IConnectionFactory.cs:
--------------------------------------------------------------------------------
1 | using System.Data;
2 |
3 | namespace Inspector.DAL.Interfaces
4 | {
5 | public interface IConnectionFactory
6 | {
7 | IDbConnection GetConnection();
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Level 2/08/Inspector/Inspector.DAL/Interfaces/IDbContext.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.DAL.Interfaces
2 | {
3 | public interface IDbContext
4 | {
5 | IUnitOfWork GetUnitOfWork();
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Level 2/08/Inspector/Inspector.DAL/Interfaces/IRepository.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System.Collections.Generic;
3 |
4 | namespace Inspector.DAL.Interfaces
5 | {
6 | public interface IRepository where T : new()
7 | {
8 | void Add(T entity);
9 | IEnumerable GetAll();
10 | void Update(T entity);
11 | void Delete(T entity);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Level 2/08/Inspector/Inspector.DAL/Interfaces/IUnitOfWork.cs:
--------------------------------------------------------------------------------
1 | using System.Data;
2 | using System.Data.SqlClient;
3 |
4 | namespace Inspector.DAL.Interfaces
5 | {
6 | public interface IUnitOfWork
7 | {
8 | void SaveChanges();
9 |
10 | IDbCommand GetCommand();
11 |
12 | IRepository GetRepository() where T : new();
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Level 2/08/Inspector/Inspector.DAL/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Level 2/08/Inspector/Inspector.Domain/Interfaces/ICatalogManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System.Collections.Generic;
3 |
4 | namespace Inspector.Domain.Interfaces
5 | {
6 | public interface ICatalogManager
7 | {
8 | IEnumerable GetEntities() where T : new();
9 |
10 | IEnumerable GetAreas();
11 | IEnumerable GetOrgatizations(string soato);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Level 2/08/Inspector/Inspector.Domain/Interfaces/IReportManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Misc;
2 | using System;
3 |
4 | namespace Inspector.Domain.Interfaces
5 | {
6 | public interface IReportManager
7 | {
8 | void GetTotalProductVolume(Filter filter);
9 | void GetTotalRevenue(Filter filter);
10 | void GetTotalProfit(Filter filter);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/08/Inspector/Inspector.Domain/Ioc/IoCException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Inspector.Domain.Ioc
4 | {
5 | public class IoCException : Exception
6 | {
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/Level 2/08/Inspector/Inspector.Domain/Misc/Filter.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System;
3 |
4 | namespace Inspector.Domain.Misc
5 | {
6 | public class Filter
7 | {
8 | public string Soato {get;set;}
9 | public DateTime? StartDate { get; set; }
10 | public DateTime? EndDate { get; set; }
11 | public OrgType? OrgType { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Level 2/08/Inspector/Inspector.Domain/Models/Area.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.Domain.Models
2 | {
3 | public class Area
4 | {
5 | public int Id { get; set; }
6 | public string Name { get; set; }
7 | public string SOATO { get; set; }
8 |
9 | public override string ToString()
10 | {
11 | return Name;
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Level 2/08/Inspector/Inspector.Domain/Models/FinIndex.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Inspector.Domain.Models
4 | {
5 | public class FinIndex
6 | {
7 | public int Id { get; set; }
8 | public int OrgId { get; set; }
9 | public decimal ProductVolume { get; set; }
10 | public decimal Revenue { get; set; }
11 | public decimal Profit { get; set; }
12 | public DateTime StartDate { get; set; }
13 | public DateTime EndDate { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Level 2/08/Inspector/Inspector.Domain/Models/OrgType.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.Domain.Models
2 | {
3 | public enum OrgType
4 | {
5 | None = 0,
6 | Small = 1,
7 | Micro = 2,
8 | Large = 3,
9 | Other = 4,
10 | Personal = 5
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/08/Inspector/Inspector.Domain/Models/Organization.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.Domain.Models
2 | {
3 | public class Organization
4 | {
5 | public int Id { get; set; }
6 | public string OKPO { get; set; }
7 | public string SOATO { get; set; }
8 | public string INN { get; set; }
9 | public string Name { get; set; }
10 | public OrgType Type { get; set; }
11 |
12 | public override string ToString()
13 | {
14 | return string.Format("{0,16} | {1,8}", Name, OKPO);
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Level 2/08/Inspector/Inspector.GUI/AboutWindow.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
15 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Level 2/08/Inspector/Inspector.GUI/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/Level 2/08/Inspector/Inspector.GUI/App.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Level 2/08/Inspector/Inspector.GUI/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using Inspector.BLL;
2 | using Inspector.Domain.Ioc;
3 | using System;
4 | using System.Windows;
5 |
6 | namespace Inspector.GUI
7 | {
8 | public partial class App : Application
9 | {
10 | private void Application_Startup(object sender, StartupEventArgs e)
11 | {
12 | Bootstrapper.Init();
13 |
14 | IoC.Register();
15 |
16 | IoC.Get().Show();
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Level 2/08/Inspector/Inspector.GUI/CatalogManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Inspector.GUI
7 | {
8 | class CatalogManager
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Level 2/08/Inspector/Inspector.GUI/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Level 2/08/Inspector/Inspector.Test/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Level 2/08/Inspector/packages/repositories.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Level 2/09/Inspector/Inspector.BLL/Bootstrapper.cs:
--------------------------------------------------------------------------------
1 | using Inspector.BLL.Managers;
2 | using Inspector.Domain.Interfaces;
3 | using Inspector.Domain.Ioc;
4 |
5 | namespace Inspector.BLL
6 | {
7 | public static class Bootstrapper
8 | {
9 | public static void Init()
10 | {
11 | Inspector.DAL.Bootstrapper.Init();
12 |
13 | IoC.Register();
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Level 2/09/Inspector/Inspector.DAL/00_Data.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Respublika Uzbekistan', '1700')
2 | GO
3 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Respublika Karakalpakstan', '1735')
4 | GO
5 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Andijan viloyati', '1703')
6 | GO
7 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Buhoro viloyati', '1706')
8 | GO
9 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Jizzah', '1708')
10 | GO
11 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Kashkadaryo viloyati', '1710')
12 | GO
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Level 2/09/Inspector/Inspector.DAL/AdoNet/AdoNetConnectionFactory.cs:
--------------------------------------------------------------------------------
1 | using Inspector.DAL.Interfaces;
2 | using System.Configuration;
3 | using System.Data;
4 | using System.Data.Common;
5 | using System.Data.SqlClient;
6 |
7 | namespace Inspector.DAL.AdoNet
8 | {
9 | internal class AdoNetConnectionFactory : IConnectionFactory
10 | {
11 | public IDbConnection GetConnection()
12 | {
13 | var connStr = ConfigurationManager.ConnectionStrings["PROD_CONNSTR"];
14 |
15 | var providerName = connStr.ProviderName;
16 | var factory = DbProviderFactories.GetFactory(providerName);
17 |
18 | var conn = factory.CreateConnection();
19 | conn.ConnectionString = connStr.ConnectionString;
20 |
21 | conn.Open();
22 |
23 | return conn;
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Level 2/09/Inspector/Inspector.DAL/AdoNet/AdoNetDbContext.cs:
--------------------------------------------------------------------------------
1 | using Inspector.DAL.Interfaces;
2 |
3 | namespace Inspector.DAL.AdoNet
4 | {
5 | internal class AdoNetDbContext : IDbContext
6 | {
7 | private readonly IConnectionFactory _connFactory;
8 |
9 | public AdoNetDbContext(IConnectionFactory connFactory)
10 | {
11 | _connFactory = connFactory;
12 | }
13 |
14 | public IUnitOfWork GetUnitOfWork()
15 | {
16 | return new AdoNetUnitOfWork(_connFactory);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Level 2/09/Inspector/Inspector.DAL/Bootstrapper.cs:
--------------------------------------------------------------------------------
1 | using Inspector.DAL.Interfaces;
2 | using Inspector.Domain.Ioc;
3 | using Inspector.DAL.AdoNet;
4 |
5 | namespace Inspector.DAL
6 | {
7 | public static class Bootstrapper
8 | {
9 | public static void Init()
10 | {
11 | IoC.Register();
12 | IoC.Register();
13 | IoC.Register();
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Level 2/09/Inspector/Inspector.DAL/Exceptions/DalException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Inspector.DAL.Exceptions
4 | {
5 | public class DalException : Exception
6 | {
7 | public DalException()
8 | {
9 | }
10 |
11 | public DalException(string message)
12 | :base(message)
13 | {
14 | }
15 |
16 | public DalException(string message, Exception innerException)
17 | : base(message, innerException)
18 | {
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Level 2/09/Inspector/Inspector.DAL/Interfaces/IConnectionFactory.cs:
--------------------------------------------------------------------------------
1 | using System.Data;
2 |
3 | namespace Inspector.DAL.Interfaces
4 | {
5 | public interface IConnectionFactory
6 | {
7 | IDbConnection GetConnection();
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Level 2/09/Inspector/Inspector.DAL/Interfaces/IDbContext.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.DAL.Interfaces
2 | {
3 | public interface IDbContext
4 | {
5 | IUnitOfWork GetUnitOfWork();
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Level 2/09/Inspector/Inspector.DAL/Interfaces/IRepository.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System.Collections.Generic;
3 |
4 | namespace Inspector.DAL.Interfaces
5 | {
6 | public interface IRepository where T : IEntity, new()
7 | {
8 | void Add(T entity);
9 | IEnumerable GetAll();
10 | void Update(T entity);
11 | void Delete(T entity);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Level 2/09/Inspector/Inspector.DAL/Interfaces/IUnitOfWork.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System.Data;
3 | using System.Data.SqlClient;
4 |
5 | namespace Inspector.DAL.Interfaces
6 | {
7 | public interface IUnitOfWork
8 | {
9 | void SaveChanges();
10 |
11 | IDbCommand GetCommand();
12 |
13 | IRepository GetRepository() where T : IEntity, new();
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Level 2/09/Inspector/Inspector.DAL/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Level 2/09/Inspector/Inspector.Domain/Interfaces/ICatalogManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System.Collections.Generic;
3 |
4 | namespace Inspector.Domain.Interfaces
5 | {
6 | public interface ICatalogManager
7 | {
8 | IEnumerable GetEntities() where T : IEntity, new();
9 |
10 | IEnumerable GetAreas();
11 | IEnumerable GetOrgatizations(string soato);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Level 2/09/Inspector/Inspector.Domain/Interfaces/IReportManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Misc;
2 | using System;
3 |
4 | namespace Inspector.Domain.Interfaces
5 | {
6 | public interface IReportManager
7 | {
8 | void GetTotalProductVolume(Filter filter);
9 | void GetTotalRevenue(Filter filter);
10 | void GetTotalProfit(Filter filter);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/09/Inspector/Inspector.Domain/Ioc/IoCException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Inspector.Domain.Ioc
4 | {
5 | public class IoCException : Exception
6 | {
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/Level 2/09/Inspector/Inspector.Domain/Misc/Filter.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System;
3 |
4 | namespace Inspector.Domain.Misc
5 | {
6 | public class Filter
7 | {
8 | public string Soato {get;set;}
9 | public DateTime? StartDate { get; set; }
10 | public DateTime? EndDate { get; set; }
11 | public OrgType? OrgType { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Level 2/09/Inspector/Inspector.Domain/Misc/TableAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Inspector.Domain.Misc
4 | {
5 | [AttributeUsage(AttributeTargets.Class)]
6 | public class TableAttribute : Attribute
7 | {
8 | public TableAttribute(string tableName)
9 | {
10 | TableName = tableName;
11 | }
12 |
13 | public string TableName { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Level 2/09/Inspector/Inspector.Domain/Models/Area.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Misc;
2 | using System.Collections.Generic;
3 | using System.Data;
4 |
5 | namespace Inspector.Domain.Models
6 | {
7 | public class Area : GenericEntity
8 | {
9 | public int Id { get; set; }
10 | public string Name { get; set; }
11 | public string SOATO { get; set; }
12 |
13 | public override string ToString()
14 | {
15 | return Name;
16 | }
17 |
18 | public override void Load(IDataRecord record)
19 | {
20 | Id = record.GetInt32(0);
21 | Name = record.GetString(1);
22 | SOATO = record.GetString(2);
23 | }
24 |
25 | public override void Save(Dictionary dic)
26 | {
27 | dic.Add("Id", Id);
28 | dic.Add("Name", Name);
29 | dic.Add("SOATO", SOATO);
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Level 2/09/Inspector/Inspector.Domain/Models/FinIndex.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Misc;
2 | using System;
3 |
4 | namespace Inspector.Domain.Models
5 | {
6 | [Table("FinIndexes")]
7 | public class FinIndex : GenericEntity
8 | {
9 | public int Id { get; set; }
10 | public int OrgId { get; set; }
11 | public decimal ProductVolume { get; set; }
12 | public decimal Revenue { get; set; }
13 | public decimal Profit { get; set; }
14 | public DateTime StartDate { get; set; }
15 | public DateTime EndDate { get; set; }
16 |
17 | public override void Load(System.Data.IDataRecord record)
18 | {
19 | throw new NotImplementedException();
20 | }
21 |
22 | public override void Save(System.Collections.Generic.Dictionary dic)
23 | {
24 | throw new NotImplementedException();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Level 2/09/Inspector/Inspector.Domain/Models/GenericEntity.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | namespace Inspector.Domain.Models
3 | {
4 | public abstract class GenericEntity : IEntity
5 | {
6 | public abstract void Load(System.Data.IDataRecord record);
7 |
8 | public string TableName
9 | {
10 | get { throw new System.NotImplementedException(); }
11 | }
12 |
13 | public abstract void Save(Dictionary dic);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Level 2/09/Inspector/Inspector.Domain/Models/IEntity.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Data;
3 |
4 | namespace Inspector.Domain.Models
5 | {
6 | public interface IEntity
7 | {
8 | void Load(IDataRecord record);
9 | string TableName { get; }
10 | void Save(Dictionary dic);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/09/Inspector/Inspector.Domain/Models/OrgType.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.Domain.Models
2 | {
3 | public enum OrgType
4 | {
5 | None = 0,
6 | Small = 1,
7 | Micro = 2,
8 | Large = 3,
9 | Other = 4,
10 | Personal = 5
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/09/Inspector/Inspector.Domain/Models/Organization.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.Domain.Models
2 | {
3 | public class Organization : GenericEntity
4 | {
5 | public int Id { get; set; }
6 | public string OKPO { get; set; }
7 | public string SOATO { get; set; }
8 | public string INN { get; set; }
9 | public string Name { get; set; }
10 | public OrgType Type { get; set; }
11 |
12 | public override string ToString()
13 | {
14 | return string.Format("{0,16} | {1,8}", Name, OKPO);
15 | }
16 |
17 | public override void Load(System.Data.IDataRecord record)
18 | {
19 | throw new System.NotImplementedException();
20 | }
21 |
22 | public override void Save(System.Collections.Generic.Dictionary dic)
23 | {
24 | throw new System.NotImplementedException();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Level 2/09/Inspector/Inspector.GUI/AboutWindow.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
15 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Level 2/09/Inspector/Inspector.GUI/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/Level 2/09/Inspector/Inspector.GUI/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Level 2/09/Inspector/Inspector.GUI/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using Inspector.BLL;
2 | using Inspector.Domain.Ioc;
3 | using System;
4 | using System.Windows;
5 | using System.Windows.Threading;
6 |
7 | namespace Inspector.GUI
8 | {
9 | public partial class App : Application
10 | {
11 | private void Application_Startup(object sender, StartupEventArgs e)
12 | {
13 | Bootstrapper.Init();
14 |
15 | IoC.Register();
16 |
17 | IoC.Get().Show();
18 | }
19 |
20 | private void Application_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
21 | {
22 | MessageBox.Show(e.Exception.Message, "Error",
23 | MessageBoxButton.OK, MessageBoxImage.Error);
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Level 2/09/Inspector/Inspector.GUI/CatalogManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Inspector.GUI
7 | {
8 | class CatalogManager
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Level 2/09/Inspector/Inspector.GUI/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Level 2/09/Inspector/Inspector.Test/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Level 2/09/Inspector/packages/repositories.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Level 2/10/DemoExpressionTree/ConsoleApplication1/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 2/10/DemoExpressionTree/ConsoleApplication1/Customers.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace ConsoleApplication1
7 | {
8 | class Customers
9 | {
10 | public int Age { get; set; }
11 |
12 | public string Name { get; set; }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Level 2/10/Inspector/Inspector.BLL/Bootstrapper.cs:
--------------------------------------------------------------------------------
1 | using Inspector.BLL.Managers;
2 | using Inspector.Domain.Interfaces;
3 | using Inspector.Domain.Ioc;
4 |
5 | namespace Inspector.BLL
6 | {
7 | public static class Bootstrapper
8 | {
9 | public static void Init()
10 | {
11 | Inspector.DAL.Bootstrapper.Init();
12 |
13 | IoC.Register();
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Level 2/10/Inspector/Inspector.DAL/00_Data.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Respublika Uzbekistan', '1700')
2 | GO
3 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Respublika Karakalpakstan', '1735')
4 | GO
5 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Andijan viloyati', '1703')
6 | GO
7 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Buhoro viloyati', '1706')
8 | GO
9 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Jizzah', '1708')
10 | GO
11 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Kashkadaryo viloyati', '1710')
12 | GO
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Level 2/10/Inspector/Inspector.DAL/AdoNet/AdoNetConnectionFactory.cs:
--------------------------------------------------------------------------------
1 | using Inspector.DAL.Interfaces;
2 | using System.Configuration;
3 | using System.Data;
4 | using System.Data.Common;
5 | using System.Data.SqlClient;
6 |
7 | namespace Inspector.DAL.AdoNet
8 | {
9 | internal class AdoNetConnectionFactory : IConnectionFactory
10 | {
11 | public IDbConnection GetConnection()
12 | {
13 | var connStr = ConfigurationManager.ConnectionStrings["PROD_CONNSTR"];
14 |
15 | var providerName = connStr.ProviderName;
16 | var factory = DbProviderFactories.GetFactory(providerName);
17 |
18 | var conn = factory.CreateConnection();
19 | conn.ConnectionString = connStr.ConnectionString;
20 |
21 | conn.Open();
22 |
23 | return conn;
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Level 2/10/Inspector/Inspector.DAL/AdoNet/AdoNetDbContext.cs:
--------------------------------------------------------------------------------
1 | using Inspector.DAL.Interfaces;
2 |
3 | namespace Inspector.DAL.AdoNet
4 | {
5 | internal class AdoNetDbContext : IDbContext
6 | {
7 | private readonly IConnectionFactory _connFactory;
8 |
9 | public AdoNetDbContext(IConnectionFactory connFactory)
10 | {
11 | _connFactory = connFactory;
12 | }
13 |
14 | public IUnitOfWork GetUnitOfWork()
15 | {
16 | return new AdoNetUnitOfWork(_connFactory);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Level 2/10/Inspector/Inspector.DAL/Bootstrapper.cs:
--------------------------------------------------------------------------------
1 | using Inspector.DAL.Interfaces;
2 | using Inspector.Domain.Ioc;
3 | using Inspector.DAL.AdoNet;
4 |
5 | namespace Inspector.DAL
6 | {
7 | public static class Bootstrapper
8 | {
9 | public static void Init()
10 | {
11 | IoC.Register();
12 | IoC.Register();
13 | IoC.Register();
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Level 2/10/Inspector/Inspector.DAL/Exceptions/DalException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Inspector.DAL.Exceptions
4 | {
5 | public class DalException : Exception
6 | {
7 | public DalException()
8 | {
9 | }
10 |
11 | public DalException(string message)
12 | :base(message)
13 | {
14 | }
15 |
16 | public DalException(string message, Exception innerException)
17 | : base(message, innerException)
18 | {
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Level 2/10/Inspector/Inspector.DAL/Interfaces/IConnectionFactory.cs:
--------------------------------------------------------------------------------
1 | using System.Data;
2 |
3 | namespace Inspector.DAL.Interfaces
4 | {
5 | public interface IConnectionFactory
6 | {
7 | IDbConnection GetConnection();
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Level 2/10/Inspector/Inspector.DAL/Interfaces/IDbContext.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.DAL.Interfaces
2 | {
3 | public interface IDbContext
4 | {
5 | IUnitOfWork GetUnitOfWork();
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Level 2/10/Inspector/Inspector.DAL/Interfaces/IRepository.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq.Expressions;
5 |
6 | namespace Inspector.DAL.Interfaces
7 | {
8 | public interface IRepository where T : IEntity, new()
9 | {
10 | void Add(T entity);
11 | IEnumerable GetAll(Expression> predicat);
12 | void Update(T entity);
13 | void Delete(T entity);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Level 2/10/Inspector/Inspector.DAL/Interfaces/IUnitOfWork.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System;
3 | using System.Data;
4 | using System.Data.SqlClient;
5 |
6 | namespace Inspector.DAL.Interfaces
7 | {
8 | public interface IUnitOfWork : IDisposable
9 | {
10 | void SaveChanges();
11 |
12 | IDbCommand GetCommand();
13 |
14 | IRepository GetRepository() where T : IEntity, new();
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Level 2/10/Inspector/Inspector.DAL/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Level 2/10/Inspector/Inspector.Domain/Interfaces/ICatalogManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System.Collections.Generic;
3 |
4 | namespace Inspector.Domain.Interfaces
5 | {
6 | public interface ICatalogManager
7 | {
8 | IEnumerable GetEntities() where T : IEntity, new();
9 |
10 | IEnumerable GetAreas();
11 | IEnumerable GetOrgatizations(string soato);
12 |
13 | void AddArea(Area area);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Level 2/10/Inspector/Inspector.Domain/Interfaces/IReportManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Misc;
2 | using System;
3 |
4 | namespace Inspector.Domain.Interfaces
5 | {
6 | public interface IReportManager
7 | {
8 | void GetTotalProductVolume(Filter filter);
9 | void GetTotalRevenue(Filter filter);
10 | void GetTotalProfit(Filter filter);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/10/Inspector/Inspector.Domain/Ioc/IoCException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Inspector.Domain.Ioc
4 | {
5 | public class IoCException : Exception
6 | {
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/Level 2/10/Inspector/Inspector.Domain/Misc/Filter.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System;
3 |
4 | namespace Inspector.Domain.Misc
5 | {
6 | public class Filter
7 | {
8 | public string Soato {get;set;}
9 | public DateTime? StartDate { get; set; }
10 | public DateTime? EndDate { get; set; }
11 | public OrgType? OrgType { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Level 2/10/Inspector/Inspector.Domain/Misc/TableAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Inspector.Domain.Misc
4 | {
5 | [AttributeUsage(AttributeTargets.Class)]
6 | public class TableAttribute : Attribute
7 | {
8 | public TableAttribute(string tableName)
9 | {
10 | TableName = tableName;
11 | }
12 |
13 | public string TableName { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Level 2/10/Inspector/Inspector.Domain/Models/Area.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Misc;
2 | using System.Collections.Generic;
3 | using System.Data;
4 |
5 | namespace Inspector.Domain.Models
6 | {
7 | public class Area : GenericEntity
8 | {
9 | public int Id { get; set; }
10 | public string Name { get; set; }
11 | public string SOATO { get; set; }
12 |
13 | public override string ToString()
14 | {
15 | return Name;
16 | }
17 |
18 | public override void Load(IDataRecord record)
19 | {
20 | Id = record.GetInt32(0);
21 | Name = record.GetString(1);
22 | SOATO = record.GetString(2);
23 | }
24 |
25 | public override void Save(Dictionary dic)
26 | {
27 | //dic.Add("Id", Id);
28 | dic.Add("Name", Name);
29 | dic.Add("SOATO", SOATO);
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Level 2/10/Inspector/Inspector.Domain/Models/FinIndex.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Misc;
2 | using System;
3 |
4 | namespace Inspector.Domain.Models
5 | {
6 | [Table("FinIndexes")]
7 | public class FinIndex : GenericEntity
8 | {
9 | public int Id { get; set; }
10 | public int OrgId { get; set; }
11 | public decimal ProductVolume { get; set; }
12 | public decimal Revenue { get; set; }
13 | public decimal Profit { get; set; }
14 | public DateTime StartDate { get; set; }
15 | public DateTime EndDate { get; set; }
16 |
17 | public override void Load(System.Data.IDataRecord record)
18 | {
19 | throw new NotImplementedException();
20 | }
21 |
22 | public override void Save(System.Collections.Generic.Dictionary dic)
23 | {
24 | throw new NotImplementedException();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Level 2/10/Inspector/Inspector.Domain/Models/GenericEntity.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | namespace Inspector.Domain.Models
3 | {
4 | public abstract class GenericEntity : IEntity
5 | {
6 | public abstract void Load(System.Data.IDataRecord record);
7 |
8 | public string TableName
9 | {
10 | get { throw new System.NotImplementedException(); }
11 | }
12 |
13 | public abstract void Save(Dictionary dic);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Level 2/10/Inspector/Inspector.Domain/Models/IEntity.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Data;
3 |
4 | namespace Inspector.Domain.Models
5 | {
6 | public interface IEntity
7 | {
8 | void Load(IDataRecord record);
9 | string TableName { get; }
10 | void Save(Dictionary dic);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/10/Inspector/Inspector.Domain/Models/OrgType.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.Domain.Models
2 | {
3 | public enum OrgType
4 | {
5 | None = 0,
6 | Small = 1,
7 | Micro = 2,
8 | Large = 3,
9 | Other = 4,
10 | Personal = 5
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/10/Inspector/Inspector.Domain/Models/Organization.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.Domain.Models
2 | {
3 | public class Organization : GenericEntity
4 | {
5 | public int Id { get; set; }
6 | public string OKPO { get; set; }
7 | public string SOATO { get; set; }
8 | public string INN { get; set; }
9 | public string Name { get; set; }
10 | public OrgType Type { get; set; }
11 |
12 | public override string ToString()
13 | {
14 | return string.Format("{0,16} | {1,8}", Name, OKPO);
15 | }
16 |
17 | public override void Load(System.Data.IDataRecord record)
18 | {
19 | throw new System.NotImplementedException();
20 | }
21 |
22 | public override void Save(System.Collections.Generic.Dictionary dic)
23 | {
24 | throw new System.NotImplementedException();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Level 2/10/Inspector/Inspector.GUI/AboutWindow.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
15 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Level 2/10/Inspector/Inspector.GUI/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/Level 2/10/Inspector/Inspector.GUI/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Level 2/10/Inspector/Inspector.GUI/CatalogManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Inspector.GUI
7 | {
8 | class CatalogManager
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Level 2/10/Inspector/Inspector.GUI/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Level 2/10/Inspector/Inspector.Test/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Level 2/10/Inspector/packages/repositories.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Level 2/11/Inspector/Inspector.BLL/Bootstrapper.cs:
--------------------------------------------------------------------------------
1 | using Inspector.BLL.Managers;
2 | using Inspector.Domain.Interfaces;
3 | using Inspector.Domain.Ioc;
4 |
5 | namespace Inspector.BLL
6 | {
7 | public static class Bootstrapper
8 | {
9 | public static void Init()
10 | {
11 | Inspector.DAL.Bootstrapper.Init();
12 |
13 | IoC.Register();
14 | IoC.Register();
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Level 2/11/Inspector/Inspector.BLL/Managers/FinancialManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.DAL.Interfaces;
2 | using Inspector.Domain.Interfaces;
3 | using Inspector.Domain.Models;
4 |
5 | namespace Inspector.BLL.Managers
6 | {
7 | internal class FinancialManager : GenericManager, IFinancialManager
8 | {
9 | public FinancialManager(IDbContext ctx)
10 | : base(ctx)
11 | {
12 | }
13 |
14 | public void AddFinIndex(FinIndex finIndex)
15 | {
16 | AddEntity(finIndex);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Level 2/11/Inspector/Inspector.BLL/Managers/GenericManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.DAL.Interfaces;
2 | using Inspector.Domain.Models;
3 | namespace Inspector.BLL.Managers
4 | {
5 | internal class GenericManager
6 | {
7 | private readonly IDbContext _ctx;
8 |
9 | public GenericManager(IDbContext ctx)
10 | {
11 | _ctx = ctx;
12 | }
13 |
14 | protected void AddEntity(T entity) where T : IEntity, new()
15 | {
16 | using (var uow = _ctx.GetUnitOfWork())
17 | {
18 | var rpstr = uow.GetRepository();
19 | rpstr.Add(entity);
20 |
21 | uow.SaveChanges();
22 | }
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Level 2/11/Inspector/Inspector.DAL/00_Data.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Respublika Uzbekistan', '1700')
2 | GO
3 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Respublika Karakalpakstan', '1735')
4 | GO
5 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Andijan viloyati', '1703')
6 | GO
7 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Buhoro viloyati', '1706')
8 | GO
9 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Jizzah', '1708')
10 | GO
11 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Kashkadaryo viloyati', '1710')
12 | GO
13 |
14 |
15 | set identity_insert Organizations ON
16 | go
17 | INSERT INTO Organizations (id, OKPO,SOATO,INN,Name,Type)VALUES(1, '12345678', '1700', '987654232', 'Micros Training Centre', 3)
18 | GO
19 | INSERT INTO Organizations (id, OKPO,SOATO,INN,Name,Type)VALUES(2, '12345670', '1700', '987654232', 'MUM', 3)
20 | GO
21 | set identity_insert Organizations OFF
22 | go
--------------------------------------------------------------------------------
/Level 2/11/Inspector/Inspector.DAL/AdoNet/AdoNetConnectionFactory.cs:
--------------------------------------------------------------------------------
1 | using Inspector.DAL.Interfaces;
2 | using System.Configuration;
3 | using System.Data;
4 | using System.Data.Common;
5 | using System.Data.SqlClient;
6 |
7 | namespace Inspector.DAL.AdoNet
8 | {
9 | internal class AdoNetConnectionFactory : IConnectionFactory
10 | {
11 | public IDbConnection GetConnection()
12 | {
13 | var connStr = ConfigurationManager.ConnectionStrings["PROD_CONNSTR"];
14 |
15 | var providerName = connStr.ProviderName;
16 | var factory = DbProviderFactories.GetFactory(providerName);
17 |
18 | var conn = factory.CreateConnection();
19 | conn.ConnectionString = connStr.ConnectionString;
20 |
21 | conn.Open();
22 |
23 | return conn;
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Level 2/11/Inspector/Inspector.DAL/AdoNet/AdoNetDbContext.cs:
--------------------------------------------------------------------------------
1 | using Inspector.DAL.Interfaces;
2 |
3 | namespace Inspector.DAL.AdoNet
4 | {
5 | internal class AdoNetDbContext : IDbContext
6 | {
7 | private readonly IConnectionFactory _connFactory;
8 |
9 | public AdoNetDbContext(IConnectionFactory connFactory)
10 | {
11 | _connFactory = connFactory;
12 | }
13 |
14 | public IUnitOfWork GetUnitOfWork()
15 | {
16 | return new AdoNetUnitOfWork(_connFactory);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Level 2/11/Inspector/Inspector.DAL/Bootstrapper.cs:
--------------------------------------------------------------------------------
1 | using Inspector.DAL.Interfaces;
2 | using Inspector.Domain.Ioc;
3 | using Inspector.DAL.AdoNet;
4 |
5 | namespace Inspector.DAL
6 | {
7 | public static class Bootstrapper
8 | {
9 | public static void Init()
10 | {
11 | IoC.Register();
12 | IoC.Register();
13 | IoC.Register();
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Level 2/11/Inspector/Inspector.DAL/Exceptions/DalException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Inspector.DAL.Exceptions
4 | {
5 | public class DalException : Exception
6 | {
7 | public DalException()
8 | {
9 | }
10 |
11 | public DalException(string message)
12 | :base(message)
13 | {
14 | }
15 |
16 | public DalException(string message, Exception innerException)
17 | : base(message, innerException)
18 | {
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Level 2/11/Inspector/Inspector.DAL/Interfaces/IConnectionFactory.cs:
--------------------------------------------------------------------------------
1 | using System.Data;
2 |
3 | namespace Inspector.DAL.Interfaces
4 | {
5 | public interface IConnectionFactory
6 | {
7 | IDbConnection GetConnection();
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Level 2/11/Inspector/Inspector.DAL/Interfaces/IDbContext.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.DAL.Interfaces
2 | {
3 | public interface IDbContext
4 | {
5 | IUnitOfWork GetUnitOfWork();
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Level 2/11/Inspector/Inspector.DAL/Interfaces/IRepository.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq.Expressions;
5 |
6 | namespace Inspector.DAL.Interfaces
7 | {
8 | public interface IRepository where T : IEntity, new()
9 | {
10 | void Add(T entity);
11 | IEnumerable GetAll(Expression> predicat);
12 | void Update(T entity);
13 | void Delete(T entity);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Level 2/11/Inspector/Inspector.DAL/Interfaces/IUnitOfWork.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System;
3 | using System.Data;
4 | using System.Data.SqlClient;
5 |
6 | namespace Inspector.DAL.Interfaces
7 | {
8 | public interface IUnitOfWork : IDisposable
9 | {
10 | void SaveChanges();
11 |
12 | IDbCommand GetCommand();
13 |
14 | IRepository GetRepository() where T : IEntity, new();
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Level 2/11/Inspector/Inspector.DAL/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Level 2/11/Inspector/Inspector.Domain/Interfaces/ICatalogManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System.Collections.Generic;
3 |
4 | namespace Inspector.Domain.Interfaces
5 | {
6 | public interface ICatalogManager
7 | {
8 | IEnumerable GetEntities() where T : IEntity, new();
9 |
10 | IEnumerable GetAreas();
11 | IEnumerable GetOrgatizations(string soato);
12 |
13 | void AddArea(Area area);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Level 2/11/Inspector/Inspector.Domain/Interfaces/IFinancialManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 |
3 | namespace Inspector.Domain.Interfaces
4 | {
5 | public interface IFinancialManager
6 | {
7 | void AddFinIndex(FinIndex finIndex);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Level 2/11/Inspector/Inspector.Domain/Interfaces/IReportManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Misc;
2 | using System;
3 |
4 | namespace Inspector.Domain.Interfaces
5 | {
6 | public interface IReportManager
7 | {
8 | void GetTotalProductVolume(Filter filter);
9 | void GetTotalRevenue(Filter filter);
10 | void GetTotalProfit(Filter filter);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/11/Inspector/Inspector.Domain/Ioc/IoCException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Inspector.Domain.Ioc
4 | {
5 | public class IoCException : Exception
6 | {
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/Level 2/11/Inspector/Inspector.Domain/Misc/Filter.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System;
3 |
4 | namespace Inspector.Domain.Misc
5 | {
6 | public class Filter
7 | {
8 | public string Soato {get;set;}
9 | public DateTime? StartDate { get; set; }
10 | public DateTime? EndDate { get; set; }
11 | public OrgType? OrgType { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Level 2/11/Inspector/Inspector.Domain/Misc/TableAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Inspector.Domain.Misc
4 | {
5 | [AttributeUsage(AttributeTargets.Class)]
6 | public class TableAttribute : Attribute
7 | {
8 | public TableAttribute(string tableName)
9 | {
10 | TableName = tableName;
11 | }
12 |
13 | public string TableName { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Level 2/11/Inspector/Inspector.Domain/Models/Area.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Misc;
2 | using System.Collections.Generic;
3 | using System.Data;
4 |
5 | namespace Inspector.Domain.Models
6 | {
7 | public class Area : GenericEntity
8 | {
9 | public int Id { get; set; }
10 | public string Name { get; set; }
11 | public string SOATO { get; set; }
12 |
13 | public override string ToString()
14 | {
15 | return Name;
16 | }
17 |
18 | public override void Load(IDataRecord record)
19 | {
20 | Id = record.GetInt32(0);
21 | Name = record.GetString(1);
22 | SOATO = record.GetString(2);
23 | }
24 |
25 | public override void Save(Dictionary dic)
26 | {
27 | //dic.Add("Id", Id);
28 | dic.Add("Name", Name);
29 | dic.Add("SOATO", SOATO);
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Level 2/11/Inspector/Inspector.Domain/Models/GenericEntity.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | namespace Inspector.Domain.Models
3 | {
4 | public abstract class GenericEntity : IEntity
5 | {
6 | public abstract void Load(System.Data.IDataRecord record);
7 |
8 | public string TableName
9 | {
10 | get { throw new System.NotImplementedException(); }
11 | }
12 |
13 | public abstract void Save(Dictionary dic);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Level 2/11/Inspector/Inspector.Domain/Models/IEntity.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Data;
3 |
4 | namespace Inspector.Domain.Models
5 | {
6 | public interface IEntity
7 | {
8 | void Load(IDataRecord record);
9 | string TableName { get; }
10 | void Save(Dictionary dic);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/11/Inspector/Inspector.Domain/Models/OrgType.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.Domain.Models
2 | {
3 | public enum OrgType
4 | {
5 | None = 0,
6 | Small = 1,
7 | Micro = 2,
8 | Large = 3,
9 | Other = 4,
10 | Personal = 5
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/11/Inspector/Inspector.Domain/Models/Organization.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.Domain.Models
2 | {
3 | public class Organization : GenericEntity
4 | {
5 | public int Id { get; set; }
6 | public string OKPO { get; set; }
7 | public string SOATO { get; set; }
8 | public string INN { get; set; }
9 | public string Name { get; set; }
10 | public OrgType Type { get; set; }
11 |
12 | public override string ToString()
13 | {
14 | return string.Format("{0,16} | {1,8}", Name, OKPO);
15 | }
16 |
17 | public override void Load(System.Data.IDataRecord record)
18 | {
19 | throw new System.NotImplementedException();
20 | }
21 |
22 | public override void Save(System.Collections.Generic.Dictionary dic)
23 | {
24 | throw new System.NotImplementedException();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Level 2/11/Inspector/Inspector.GUI/AboutWindow.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
15 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Level 2/11/Inspector/Inspector.GUI/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/Level 2/11/Inspector/Inspector.GUI/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Level 2/11/Inspector/Inspector.GUI/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Level 2/11/Inspector/Inspector.GUI/StringExt.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Inspector.GUI
4 | {
5 | internal static class StringExt
6 | {
7 | public static decimal D(this string val)
8 | {
9 | return Convert.ToDecimal(val);
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/11/Inspector/Inspector.GUI/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Level 2/11/Inspector/Inspector.Test/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Level 2/11/Inspector/packages/repositories.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 2/12/Inspector/Inspector.BLL/Bootstrapper.cs:
--------------------------------------------------------------------------------
1 | using Inspector.BLL.Managers;
2 | using Inspector.Domain.Interfaces;
3 | using Inspector.Domain.Ioc;
4 |
5 | namespace Inspector.BLL
6 | {
7 | public static class Bootstrapper
8 | {
9 | public static void Init()
10 | {
11 | Inspector.DAL.Bootstrapper.Init();
12 |
13 | IoC.Register();
14 | IoC.Register();
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Level 2/12/Inspector/Inspector.BLL/Managers/FinancialManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.DAL.Interfaces;
2 | using Inspector.Domain.Interfaces;
3 | using Inspector.Domain.Models;
4 |
5 | namespace Inspector.BLL.Managers
6 | {
7 | internal class FinancialManager : GenericManager, IFinancialManager
8 | {
9 | public FinancialManager(IDbContext ctx)
10 | : base(ctx)
11 | {
12 | }
13 |
14 | public void AddFinIndex(FinIndex finIndex)
15 | {
16 | AddEntity(finIndex);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Level 2/12/Inspector/Inspector.BLL/Managers/GenericManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.DAL.Interfaces;
2 | using Inspector.Domain.Models;
3 |
4 | namespace Inspector.BLL.Managers
5 | {
6 | internal class GenericManager
7 | {
8 | private readonly IDbContext _ctx;
9 |
10 | public GenericManager(IDbContext ctx)
11 | {
12 | _ctx = ctx;
13 | }
14 |
15 | protected void AddEntity(T entity) where T : IEntity, new()
16 | {
17 | using (var uow = _ctx.GetUnitOfWork())
18 | {
19 | var rpstr = uow.GetRepository();
20 | rpstr.Add(entity);
21 |
22 | uow.SaveChanges();
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Level 2/12/Inspector/Inspector.DAL/00_Data.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Respublika Uzbekistan', '1700')
2 | GO
3 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Respublika Karakalpakstan', '1735')
4 | GO
5 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Andijan viloyati', '1703')
6 | GO
7 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Buhoro viloyati', '1706')
8 | GO
9 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Jizzah', '1708')
10 | GO
11 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Kashkadaryo viloyati', '1710')
12 | GO
13 |
14 |
15 | set identity_insert Organizations ON
16 | go
17 | INSERT INTO Organizations (id, OKPO,SOATO,INN,Name,Type)VALUES(1, '12345678', '1700', '987654232', 'Micros Training Centre', 3)
18 | GO
19 | INSERT INTO Organizations (id, OKPO,SOATO,INN,Name,Type)VALUES(2, '12345670', '1700', '987654232', 'MUM', 3)
20 | GO
21 | set identity_insert Organizations OFF
22 | go
--------------------------------------------------------------------------------
/Level 2/12/Inspector/Inspector.DAL/AdoNet/AdoNetConnectionFactory.cs:
--------------------------------------------------------------------------------
1 | using Inspector.DAL.Interfaces;
2 | using System.Configuration;
3 | using System.Data;
4 | using System.Data.Common;
5 | using System.Data.SqlClient;
6 |
7 | namespace Inspector.DAL.AdoNet
8 | {
9 | internal class AdoNetConnectionFactory : IConnectionFactory
10 | {
11 | public IDbConnection GetConnection()
12 | {
13 | var connStr = ConfigurationManager.ConnectionStrings["PROD_CONNSTR"];
14 |
15 | var providerName = connStr.ProviderName;
16 | var factory = DbProviderFactories.GetFactory(providerName);
17 |
18 | var conn = factory.CreateConnection();
19 | conn.ConnectionString = connStr.ConnectionString;
20 |
21 | conn.Open();
22 |
23 | return conn;
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Level 2/12/Inspector/Inspector.DAL/AdoNet/AdoNetDbContext.cs:
--------------------------------------------------------------------------------
1 | using Inspector.DAL.Interfaces;
2 |
3 | namespace Inspector.DAL.AdoNet
4 | {
5 | internal class AdoNetDbContext : IDbContext
6 | {
7 | private readonly IConnectionFactory _connFactory;
8 |
9 | public AdoNetDbContext(IConnectionFactory connFactory)
10 | {
11 | _connFactory = connFactory;
12 | }
13 |
14 | public IUnitOfWork GetUnitOfWork()
15 | {
16 | return new AdoNetUnitOfWork(_connFactory);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Level 2/12/Inspector/Inspector.DAL/Bootstrapper.cs:
--------------------------------------------------------------------------------
1 | using Inspector.DAL.Interfaces;
2 | using Inspector.Domain.Ioc;
3 | using Inspector.DAL.AdoNet;
4 |
5 | namespace Inspector.DAL
6 | {
7 | public static class Bootstrapper
8 | {
9 | public static void Init()
10 | {
11 | IoC.Register();
12 | IoC.Register();
13 | IoC.Register();
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Level 2/12/Inspector/Inspector.DAL/Exceptions/DalException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Inspector.DAL.Exceptions
4 | {
5 | public class DalException : Exception
6 | {
7 | public DalException()
8 | {
9 | }
10 |
11 | public DalException(string message)
12 | :base(message)
13 | {
14 | }
15 |
16 | public DalException(string message, Exception innerException)
17 | : base(message, innerException)
18 | {
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Level 2/12/Inspector/Inspector.DAL/Interfaces/IConnectionFactory.cs:
--------------------------------------------------------------------------------
1 | using System.Data;
2 |
3 | namespace Inspector.DAL.Interfaces
4 | {
5 | public interface IConnectionFactory
6 | {
7 | IDbConnection GetConnection();
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Level 2/12/Inspector/Inspector.DAL/Interfaces/IDbContext.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.DAL.Interfaces
2 | {
3 | public interface IDbContext
4 | {
5 | IUnitOfWork GetUnitOfWork();
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Level 2/12/Inspector/Inspector.DAL/Interfaces/IRepository.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq.Expressions;
5 |
6 | namespace Inspector.DAL.Interfaces
7 | {
8 | public interface IRepository where T : IEntity, new()
9 | {
10 | void Add(T entity);
11 | IEnumerable GetAll(Expression> predicat);
12 | void Update(T entity);
13 | void Delete(T entity);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Level 2/12/Inspector/Inspector.DAL/Interfaces/IUnitOfWork.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System;
3 | using System.Data;
4 | using System.Data.SqlClient;
5 |
6 | namespace Inspector.DAL.Interfaces
7 | {
8 | public interface IUnitOfWork : IDisposable
9 | {
10 | void SaveChanges();
11 |
12 | IDbCommand GetCommand();
13 |
14 | IRepository GetRepository() where T : IEntity, new();
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Level 2/12/Inspector/Inspector.DAL/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Level 2/12/Inspector/Inspector.Domain/Interfaces/ICatalogManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System.Collections.Generic;
3 |
4 | namespace Inspector.Domain.Interfaces
5 | {
6 | public interface ICatalogManager
7 | {
8 | IEnumerable GetEntities() where T : IEntity, new();
9 |
10 | IEnumerable GetAreas();
11 | IEnumerable GetOrgatizations(string soato);
12 |
13 | void AddArea(Area area);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Level 2/12/Inspector/Inspector.Domain/Interfaces/IFinancialManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 |
3 | namespace Inspector.Domain.Interfaces
4 | {
5 | public interface IFinancialManager
6 | {
7 | void AddFinIndex(FinIndex finIndex);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Level 2/12/Inspector/Inspector.Domain/Interfaces/IReportManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Misc;
2 | using System;
3 |
4 | namespace Inspector.Domain.Interfaces
5 | {
6 | public interface IReportManager
7 | {
8 | void GetTotalProductVolume(Filter filter);
9 | void GetTotalRevenue(Filter filter);
10 | void GetTotalProfit(Filter filter);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/12/Inspector/Inspector.Domain/Ioc/IoCException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Inspector.Domain.Ioc
4 | {
5 | public class IoCException : Exception
6 | {
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/Level 2/12/Inspector/Inspector.Domain/Misc/Filter.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System;
3 |
4 | namespace Inspector.Domain.Misc
5 | {
6 | public class Filter
7 | {
8 | public string Soato {get;set;}
9 | public DateTime? StartDate { get; set; }
10 | public DateTime? EndDate { get; set; }
11 | public OrgType? OrgType { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Level 2/12/Inspector/Inspector.Domain/Misc/TableAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Inspector.Domain.Misc
4 | {
5 | [AttributeUsage(AttributeTargets.Class)]
6 | public class TableAttribute : Attribute
7 | {
8 | public TableAttribute(string tableName)
9 | {
10 | TableName = tableName;
11 | }
12 |
13 | public string TableName { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Level 2/12/Inspector/Inspector.Domain/Models/Area.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Misc;
2 | using System.Collections.Generic;
3 | using System.Data;
4 |
5 | namespace Inspector.Domain.Models
6 | {
7 | public class Area : GenericEntity
8 | {
9 | public int Id { get; set; }
10 | public string Name { get; set; }
11 | public string SOATO { get; set; }
12 |
13 | public override string ToString()
14 | {
15 | return Name;
16 | }
17 |
18 | public override void Load(IDataRecord record)
19 | {
20 | Id = record.GetInt32(0);
21 | Name = record.GetString(1);
22 | SOATO = record.GetString(2);
23 | }
24 |
25 | public override void Save(Dictionary dic)
26 | {
27 | //dic.Add("Id", Id);
28 | dic.Add("Name", Name);
29 | dic.Add("SOATO", SOATO);
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Level 2/12/Inspector/Inspector.Domain/Models/GenericEntity.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | namespace Inspector.Domain.Models
3 | {
4 | public abstract class GenericEntity : IEntity
5 | {
6 | public abstract void Load(System.Data.IDataRecord record);
7 |
8 | public string TableName
9 | {
10 | get { throw new System.NotImplementedException(); }
11 | }
12 |
13 | public abstract void Save(Dictionary dic);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Level 2/12/Inspector/Inspector.Domain/Models/IEntity.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Data;
3 |
4 | namespace Inspector.Domain.Models
5 | {
6 | public interface IEntity
7 | {
8 | void Load(IDataRecord record);
9 | string TableName { get; }
10 | void Save(Dictionary dic);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/12/Inspector/Inspector.Domain/Models/OrgType.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.Domain.Models
2 | {
3 | public enum OrgType
4 | {
5 | None = 0,
6 | Small = 1,
7 | Micro = 2,
8 | Large = 3,
9 | Other = 4,
10 | Personal = 5
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/12/Inspector/Inspector.GUI/AboutWindow.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
15 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Level 2/12/Inspector/Inspector.GUI/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/Level 2/12/Inspector/Inspector.GUI/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Level 2/12/Inspector/Inspector.GUI/Forms/DescriptionsForm.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Level 2/12/Inspector/Inspector.GUI/Forms/DescriptionsForm.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Inspector.GUI.Forms
17 | {
18 | ///
19 | /// Interaction logic for DescriptionsForm.xaml
20 | ///
21 | public partial class DescriptionsForm : UserControl
22 | {
23 | public DescriptionsForm()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Level 2/12/Inspector/Inspector.GUI/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Level 2/12/Inspector/Inspector.GUI/StringExt.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Inspector.GUI
4 | {
5 | internal static class StringExt
6 | {
7 | public static decimal D(this string val)
8 | {
9 | return Convert.ToDecimal(val);
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/12/Inspector/Inspector.GUI/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Level 2/12/Inspector/Inspector.Test/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Level 2/12/Inspector/packages/repositories.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.BLL/Bootstrapper.cs:
--------------------------------------------------------------------------------
1 | using Inspector.BLL.Managers;
2 | using Inspector.Domain.Interfaces;
3 | using Inspector.Domain.Ioc;
4 |
5 | namespace Inspector.BLL
6 | {
7 | public static class Bootstrapper
8 | {
9 | public static void Init()
10 | {
11 | Inspector.DAL.Bootstrapper.Init();
12 |
13 | IoC.Register();
14 | IoC.Register();
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.BLL/Managers/FinancialManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.DAL.Interfaces;
2 | using Inspector.Domain.Interfaces;
3 | using Inspector.Domain.Models;
4 |
5 | namespace Inspector.BLL.Managers
6 | {
7 | internal class FinancialManager : GenericManager, IFinancialManager
8 | {
9 | public FinancialManager(IDbContext ctx)
10 | : base(ctx)
11 | {
12 | }
13 |
14 | public void AddFinIndex(FinIndex finIndex)
15 | {
16 | AddEntity(finIndex);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.BLL/Managers/GenericManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.DAL.Interfaces;
2 | using Inspector.Domain.Models;
3 |
4 | namespace Inspector.BLL.Managers
5 | {
6 | internal class GenericManager
7 | {
8 | private readonly IDbContext _ctx;
9 |
10 | public GenericManager(IDbContext ctx)
11 | {
12 | _ctx = ctx;
13 | }
14 |
15 | protected void AddEntity(T entity) where T : IEntity, new()
16 | {
17 | using (var uow = _ctx.GetUnitOfWork())
18 | {
19 | var rpstr = uow.GetRepository();
20 | rpstr.Add(entity);
21 |
22 | uow.SaveChanges();
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.DAL/00_Data.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Respublika Uzbekistan', '1700')
2 | GO
3 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Respublika Karakalpakstan', '1735')
4 | GO
5 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Andijan viloyati', '1703')
6 | GO
7 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Buhoro viloyati', '1706')
8 | GO
9 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Jizzah', '1708')
10 | GO
11 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Kashkadaryo viloyati', '1710')
12 | GO
13 |
14 |
15 | set identity_insert Organizations ON
16 | go
17 | INSERT INTO Organizations (id, OKPO,SOATO,INN,Name,Type)VALUES(1, '12345678', '1700', '987654232', 'Micros Training Centre', 3)
18 | GO
19 | INSERT INTO Organizations (id, OKPO,SOATO,INN,Name,Type)VALUES(2, '12345670', '1700', '987654232', 'MUM', 3)
20 | GO
21 | set identity_insert Organizations OFF
22 | go
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.DAL/AdoNet/AdoNetConnectionFactory.cs:
--------------------------------------------------------------------------------
1 | using Inspector.DAL.Interfaces;
2 | using System.Configuration;
3 | using System.Data;
4 | using System.Data.Common;
5 | using System.Data.SqlClient;
6 |
7 | namespace Inspector.DAL.AdoNet
8 | {
9 | internal class AdoNetConnectionFactory : IConnectionFactory
10 | {
11 | public IDbConnection GetConnection()
12 | {
13 | var connStr = ConfigurationManager.ConnectionStrings["PROD_CONNSTR"];
14 |
15 | var providerName = connStr.ProviderName;
16 | var factory = DbProviderFactories.GetFactory(providerName);
17 |
18 | var conn = factory.CreateConnection();
19 | conn.ConnectionString = connStr.ConnectionString;
20 |
21 | conn.Open();
22 |
23 | return conn;
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.DAL/AdoNet/AdoNetDbContext.cs:
--------------------------------------------------------------------------------
1 | using Inspector.DAL.Interfaces;
2 |
3 | namespace Inspector.DAL.AdoNet
4 | {
5 | internal class AdoNetDbContext : IDbContext
6 | {
7 | private readonly IConnectionFactory _connFactory;
8 |
9 | public AdoNetDbContext(IConnectionFactory connFactory)
10 | {
11 | _connFactory = connFactory;
12 | }
13 |
14 | public IUnitOfWork GetUnitOfWork()
15 | {
16 | return new AdoNetUnitOfWork(_connFactory);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.DAL/Bootstrapper.cs:
--------------------------------------------------------------------------------
1 | using Inspector.DAL.Interfaces;
2 | using Inspector.Domain.Ioc;
3 | using Inspector.DAL.AdoNet;
4 |
5 | namespace Inspector.DAL
6 | {
7 | public static class Bootstrapper
8 | {
9 | public static void Init()
10 | {
11 | IoC.Register();
12 | IoC.Register();
13 | IoC.Register();
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.DAL/Exceptions/DalException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Inspector.DAL.Exceptions
4 | {
5 | public class DalException : Exception
6 | {
7 | public DalException()
8 | {
9 | }
10 |
11 | public DalException(string message)
12 | :base(message)
13 | {
14 | }
15 |
16 | public DalException(string message, Exception innerException)
17 | : base(message, innerException)
18 | {
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.DAL/Interfaces/IConnectionFactory.cs:
--------------------------------------------------------------------------------
1 | using System.Data;
2 |
3 | namespace Inspector.DAL.Interfaces
4 | {
5 | public interface IConnectionFactory
6 | {
7 | IDbConnection GetConnection();
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.DAL/Interfaces/IDbContext.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.DAL.Interfaces
2 | {
3 | public interface IDbContext
4 | {
5 | IUnitOfWork GetUnitOfWork();
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.DAL/Interfaces/IRepository.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq.Expressions;
5 |
6 | namespace Inspector.DAL.Interfaces
7 | {
8 | public interface IRepository where T : IEntity, new()
9 | {
10 | void Add(T entity);
11 | IEnumerable GetAll(Expression> predicat);
12 | void Update(T entity);
13 | void Delete(T entity);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.DAL/Interfaces/IUnitOfWork.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System;
3 | using System.Data;
4 | using System.Data.SqlClient;
5 |
6 | namespace Inspector.DAL.Interfaces
7 | {
8 | public interface IUnitOfWork : IDisposable
9 | {
10 | void SaveChanges();
11 |
12 | IDbCommand GetCommand();
13 |
14 | IRepository GetRepository() where T : IEntity, new();
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.DAL/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.Domain/Interfaces/ICatalogManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System.Collections.Generic;
3 |
4 | namespace Inspector.Domain.Interfaces
5 | {
6 | public interface ICatalogManager
7 | {
8 | IEnumerable GetEntities() where T : IEntity, new();
9 |
10 | IEnumerable GetAreas();
11 | IEnumerable GetOrgatizations(string soato);
12 |
13 | void AddArea(Area area);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.Domain/Interfaces/IFinancialManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 |
3 | namespace Inspector.Domain.Interfaces
4 | {
5 | public interface IFinancialManager
6 | {
7 | void AddFinIndex(FinIndex finIndex);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.Domain/Interfaces/IReportManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Misc;
2 | using System;
3 |
4 | namespace Inspector.Domain.Interfaces
5 | {
6 | public interface IReportManager
7 | {
8 | void GetTotalProductVolume(Filter filter);
9 | void GetTotalRevenue(Filter filter);
10 | void GetTotalProfit(Filter filter);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.Domain/Ioc/IoCException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Inspector.Domain.Ioc
4 | {
5 | public class IoCException : Exception
6 | {
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.Domain/Ioc/IoCMode.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.Domain.Ioc
2 | {
3 | public enum IoCMode
4 | {
5 | None,
6 | Singleton
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.Domain/Misc/Filter.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System;
3 |
4 | namespace Inspector.Domain.Misc
5 | {
6 | public class Filter
7 | {
8 | public string Soato {get;set;}
9 | public DateTime? StartDate { get; set; }
10 | public DateTime? EndDate { get; set; }
11 | public OrgType? OrgType { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.Domain/Misc/TableAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Inspector.Domain.Misc
4 | {
5 | [AttributeUsage(AttributeTargets.Class)]
6 | public class TableAttribute : Attribute
7 | {
8 | public TableAttribute(string tableName)
9 | {
10 | TableName = tableName;
11 | }
12 |
13 | public string TableName { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.Domain/Models/Area.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Misc;
2 | using System.Collections.Generic;
3 | using System.Data;
4 |
5 | namespace Inspector.Domain.Models
6 | {
7 | public class Area : GenericEntity
8 | {
9 | public int Id { get; set; }
10 | public string Name { get; set; }
11 | public string SOATO { get; set; }
12 |
13 | public override string ToString()
14 | {
15 | return Name;
16 | }
17 |
18 | public override void Load(IDataRecord record)
19 | {
20 | Id = record.GetInt32(0);
21 | Name = record.GetString(1);
22 | SOATO = record.GetString(2);
23 | }
24 |
25 | public override void Save(Dictionary dic)
26 | {
27 | //dic.Add("Id", Id);
28 | dic.Add("Name", Name);
29 | dic.Add("SOATO", SOATO);
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.Domain/Models/GenericEntity.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | namespace Inspector.Domain.Models
3 | {
4 | public abstract class GenericEntity : IEntity
5 | {
6 | public abstract void Load(System.Data.IDataRecord record);
7 |
8 | public string TableName
9 | {
10 | get { throw new System.NotImplementedException(); }
11 | }
12 |
13 | public abstract void Save(Dictionary dic);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.Domain/Models/IEntity.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Data;
3 |
4 | namespace Inspector.Domain.Models
5 | {
6 | public interface IEntity
7 | {
8 | void Load(IDataRecord record);
9 | string TableName { get; }
10 | void Save(Dictionary dic);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.Domain/Models/OrgType.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.Domain.Models
2 | {
3 | public enum OrgType
4 | {
5 | None = 0,
6 | Small = 1,
7 | Micro = 2,
8 | Large = 3,
9 | Other = 4,
10 | Personal = 5
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.GUI/AboutWindow.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
15 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.GUI/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.GUI/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.GUI/Forms/DescriptionsForm.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.GUI/Forms/DescriptionsForm.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Inspector.GUI.Forms
17 | {
18 | ///
19 | /// Interaction logic for DescriptionsForm.xaml
20 | ///
21 | public partial class DescriptionsForm : UserControl
22 | {
23 | public DescriptionsForm()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.GUI/Forms/IFormHost.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.GUI.Forms
2 | {
3 | internal interface IFormHost
4 | {
5 | int OrgId { get; }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.GUI/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.GUI/StringExt.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Inspector.GUI
4 | {
5 | internal static class StringExt
6 | {
7 | public static decimal D(this string val)
8 | {
9 | return Convert.ToDecimal(val);
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.GUI/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/Inspector.Test/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Level 2/13/Inspector/packages/repositories.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 2/Prepar/Inspector/Inspector.BLL/Bootstrapper.cs:
--------------------------------------------------------------------------------
1 | using Inspector.BLL.Managers;
2 | using Inspector.Domain.Interfaces;
3 | using Inspector.Domain.Ioc;
4 |
5 | namespace Inspector.BLL
6 | {
7 | public static class Bootstrapper
8 | {
9 | public static void Init()
10 | {
11 | Inspector.DAL.Bootstrapper.Init();
12 |
13 | IoC.Register();
14 | IoC.Register();
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Level 2/Prepar/Inspector/Inspector.BLL/Managers/FinancialManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.DAL.Interfaces;
2 | using Inspector.Domain.Interfaces;
3 | using Inspector.Domain.Models;
4 |
5 | namespace Inspector.BLL.Managers
6 | {
7 | internal class FinancialManager : GenericManager, IFinancialManager
8 | {
9 | public FinancialManager(IDbContext ctx)
10 | : base(ctx)
11 | {
12 | }
13 |
14 | public void AddFinIndex(FinIndex finIndex)
15 | {
16 | AddEntity(finIndex);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Level 2/Prepar/Inspector/Inspector.BLL/Managers/GenericManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.DAL.Interfaces;
2 | using Inspector.Domain.Models;
3 | namespace Inspector.BLL.Managers
4 | {
5 | internal class GenericManager
6 | {
7 | private readonly IDbContext _ctx;
8 |
9 | public GenericManager(IDbContext ctx)
10 | {
11 | _ctx = ctx;
12 | }
13 |
14 | protected void AddEntity(T entity) where T : IEntity, new()
15 | {
16 | using (var uow = _ctx.GetUnitOfWork())
17 | {
18 | var rpstr = uow.GetRepository();
19 | rpstr.Add(entity);
20 |
21 | uow.SaveChanges();
22 | }
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Level 2/Prepar/Inspector/Inspector.DAL/00_Data.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Respublika Uzbekistan', '1700')
2 | GO
3 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Respublika Karakalpakstan', '1735')
4 | GO
5 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Andijan viloyati', '1703')
6 | GO
7 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Buhoro viloyati', '1706')
8 | GO
9 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Jizzah', '1708')
10 | GO
11 | INSERT INTO [dbo].[Areas] ([Name] ,[SOATO]) VALUES ('Kashkadaryo viloyati', '1710')
12 | GO
13 |
14 |
15 | set identity_insert Organizations ON
16 | go
17 | INSERT INTO Organizations (id, OKPO,SOATO,INN,Name,Type)VALUES(1, '12345678', '1700', '987654232', 'Micros Training Centre', 3)
18 | GO
19 | INSERT INTO Organizations (id, OKPO,SOATO,INN,Name,Type)VALUES(2, '12345670', '1700', '987654232', 'MUM', 3)
20 | GO
21 | set identity_insert Organizations OFF
22 | go
--------------------------------------------------------------------------------
/Level 2/Prepar/Inspector/Inspector.DAL/AdoNet/AdoNetConnectionFactory.cs:
--------------------------------------------------------------------------------
1 | using Inspector.DAL.Interfaces;
2 | using System.Configuration;
3 | using System.Data;
4 | using System.Data.Common;
5 | using System.Data.SqlClient;
6 |
7 | namespace Inspector.DAL.AdoNet
8 | {
9 | internal class AdoNetConnectionFactory : IConnectionFactory
10 | {
11 | public IDbConnection GetConnection()
12 | {
13 | var connStr = ConfigurationManager.ConnectionStrings["PROD_CONNSTR"];
14 |
15 | var providerName = connStr.ProviderName;
16 | var factory = DbProviderFactories.GetFactory(providerName);
17 |
18 | var conn = factory.CreateConnection();
19 | conn.ConnectionString = connStr.ConnectionString;
20 |
21 | conn.Open();
22 |
23 | return conn;
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Level 2/Prepar/Inspector/Inspector.DAL/AdoNet/AdoNetDbContext.cs:
--------------------------------------------------------------------------------
1 | using Inspector.DAL.Interfaces;
2 |
3 | namespace Inspector.DAL.AdoNet
4 | {
5 | internal class AdoNetDbContext : IDbContext
6 | {
7 | private readonly IConnectionFactory _connFactory;
8 |
9 | public AdoNetDbContext(IConnectionFactory connFactory)
10 | {
11 | _connFactory = connFactory;
12 | }
13 |
14 | public IUnitOfWork GetUnitOfWork()
15 | {
16 | return new AdoNetUnitOfWork(_connFactory);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Level 2/Prepar/Inspector/Inspector.DAL/Bootstrapper.cs:
--------------------------------------------------------------------------------
1 | using Inspector.DAL.Interfaces;
2 | using Inspector.Domain.Ioc;
3 | using Inspector.DAL.AdoNet;
4 |
5 | namespace Inspector.DAL
6 | {
7 | public static class Bootstrapper
8 | {
9 | public static void Init()
10 | {
11 | IoC.Register();
12 | IoC.Register();
13 | IoC.Register();
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Level 2/Prepar/Inspector/Inspector.DAL/Exceptions/DalException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Inspector.DAL.Exceptions
4 | {
5 | public class DalException : Exception
6 | {
7 | public DalException()
8 | {
9 | }
10 |
11 | public DalException(string message)
12 | :base(message)
13 | {
14 | }
15 |
16 | public DalException(string message, Exception innerException)
17 | : base(message, innerException)
18 | {
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Level 2/Prepar/Inspector/Inspector.DAL/Interfaces/IConnectionFactory.cs:
--------------------------------------------------------------------------------
1 | using System.Data;
2 |
3 | namespace Inspector.DAL.Interfaces
4 | {
5 | public interface IConnectionFactory
6 | {
7 | IDbConnection GetConnection();
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Level 2/Prepar/Inspector/Inspector.DAL/Interfaces/IDbContext.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.DAL.Interfaces
2 | {
3 | public interface IDbContext
4 | {
5 | IUnitOfWork GetUnitOfWork();
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Level 2/Prepar/Inspector/Inspector.DAL/Interfaces/IRepository.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq.Expressions;
5 |
6 | namespace Inspector.DAL.Interfaces
7 | {
8 | public interface IRepository where T : IEntity, new()
9 | {
10 | void Add(T entity);
11 | IEnumerable GetAll(Expression> predicat);
12 | void Update(T entity);
13 | void Delete(T entity);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Level 2/Prepar/Inspector/Inspector.DAL/Interfaces/IUnitOfWork.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System;
3 | using System.Data;
4 | using System.Data.SqlClient;
5 |
6 | namespace Inspector.DAL.Interfaces
7 | {
8 | public interface IUnitOfWork : IDisposable
9 | {
10 | void SaveChanges();
11 |
12 | IDbCommand GetCommand();
13 |
14 | IRepository GetRepository() where T : IEntity, new();
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Level 2/Prepar/Inspector/Inspector.DAL/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Level 2/Prepar/Inspector/Inspector.Domain/Interfaces/ICatalogManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System.Collections.Generic;
3 |
4 | namespace Inspector.Domain.Interfaces
5 | {
6 | public interface ICatalogManager
7 | {
8 | IEnumerable GetEntities() where T : IEntity, new();
9 |
10 | IEnumerable GetAreas();
11 | IEnumerable GetOrgatizations(string soato);
12 |
13 | void AddArea(Area area);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Level 2/Prepar/Inspector/Inspector.Domain/Interfaces/IFinancialManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 |
3 | namespace Inspector.Domain.Interfaces
4 | {
5 | public interface IFinancialManager
6 | {
7 | void AddFinIndex(FinIndex finIndex);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Level 2/Prepar/Inspector/Inspector.Domain/Interfaces/IReportManager.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Misc;
2 | using System;
3 |
4 | namespace Inspector.Domain.Interfaces
5 | {
6 | public interface IReportManager
7 | {
8 | void GetTotalProductVolume(Filter filter);
9 | void GetTotalRevenue(Filter filter);
10 | void GetTotalProfit(Filter filter);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/Prepar/Inspector/Inspector.Domain/Ioc/IoCException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Inspector.Domain.Ioc
4 | {
5 | public class IoCException : Exception
6 | {
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/Level 2/Prepar/Inspector/Inspector.Domain/Misc/Filter.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Models;
2 | using System;
3 |
4 | namespace Inspector.Domain.Misc
5 | {
6 | public class Filter
7 | {
8 | public string Soato {get;set;}
9 | public DateTime? StartDate { get; set; }
10 | public DateTime? EndDate { get; set; }
11 | public OrgType? OrgType { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Level 2/Prepar/Inspector/Inspector.Domain/Misc/TableAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Inspector.Domain.Misc
4 | {
5 | [AttributeUsage(AttributeTargets.Class)]
6 | public class TableAttribute : Attribute
7 | {
8 | public TableAttribute(string tableName)
9 | {
10 | TableName = tableName;
11 | }
12 |
13 | public string TableName { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Level 2/Prepar/Inspector/Inspector.Domain/Models/Area.cs:
--------------------------------------------------------------------------------
1 | using Inspector.Domain.Misc;
2 | using System.Collections.Generic;
3 | using System.Data;
4 |
5 | namespace Inspector.Domain.Models
6 | {
7 | public class Area : GenericEntity
8 | {
9 | public int Id { get; set; }
10 | public string Name { get; set; }
11 | public string SOATO { get; set; }
12 |
13 | public override string ToString()
14 | {
15 | return Name;
16 | }
17 |
18 | public override void Load(IDataRecord record)
19 | {
20 | Id = record.GetInt32(0);
21 | Name = record.GetString(1);
22 | SOATO = record.GetString(2);
23 | }
24 |
25 | public override void Save(Dictionary dic)
26 | {
27 | //dic.Add("Id", Id);
28 | dic.Add("Name", Name);
29 | dic.Add("SOATO", SOATO);
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Level 2/Prepar/Inspector/Inspector.Domain/Models/GenericEntity.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | namespace Inspector.Domain.Models
3 | {
4 | public abstract class GenericEntity : IEntity
5 | {
6 | public abstract void Load(System.Data.IDataRecord record);
7 |
8 | public string TableName
9 | {
10 | get { throw new System.NotImplementedException(); }
11 | }
12 |
13 | public abstract void Save(Dictionary dic);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Level 2/Prepar/Inspector/Inspector.Domain/Models/IEntity.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Data;
3 |
4 | namespace Inspector.Domain.Models
5 | {
6 | public interface IEntity
7 | {
8 | void Load(IDataRecord record);
9 | string TableName { get; }
10 | void Save(Dictionary dic);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/Prepar/Inspector/Inspector.Domain/Models/OrgType.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.Domain.Models
2 | {
3 | public enum OrgType
4 | {
5 | None = 0,
6 | Small = 1,
7 | Micro = 2,
8 | Large = 3,
9 | Other = 4,
10 | Personal = 5
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/Prepar/Inspector/Inspector.GUI/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/Level 2/Prepar/Inspector/Inspector.GUI/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/Level 2/Prepar/Inspector/Inspector.GUI/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Level 2/Prepar/Inspector/Inspector.GUI/StringExt.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Inspector.GUI
4 | {
5 | internal static class StringExt
6 | {
7 | public static decimal D(this string val)
8 | {
9 | return Convert.ToDecimal(val);
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/Prepar/Inspector/Inspector.GUI/Views/DescriptionView.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Level 2/Prepar/Inspector/Inspector.GUI/Views/DescriptionView.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 |
3 | namespace Inspector.GUI.Views
4 | {
5 | public partial class DescriptionView : UserControl
6 | {
7 | public DescriptionView()
8 | {
9 | InitializeComponent();
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Level 2/Prepar/Inspector/Inspector.GUI/Views/IViewHost.cs:
--------------------------------------------------------------------------------
1 | namespace Inspector.GUI.Views
2 | {
3 | internal interface IViewHost
4 | {
5 | int OrgId { get; }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/Level 2/Prepar/Inspector/Inspector.GUI/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Level 2/Prepar/Inspector/Inspector.Test/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Level 2/Prepar/Inspector/packages/repositories.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Level 2/holder:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/micros-uz/csharp/4fef5a752e372d41aa2ad68432b6f6bef39ef7fe/Level 2/holder
--------------------------------------------------------------------------------
/Level 3/holder:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/micros-uz/csharp/4fef5a752e372d41aa2ad68432b6f6bef39ef7fe/Level 3/holder
--------------------------------------------------------------------------------
/Level 4/IIS_ASP_NET.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/micros-uz/csharp/4fef5a752e372d41aa2ad68432b6f6bef39ef7fe/Level 4/IIS_ASP_NET.jpg
--------------------------------------------------------------------------------
/Level 4/lifecycle-of-an-aspnet-mvc-5-application.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/micros-uz/csharp/4fef5a752e372d41aa2ad68432b6f6bef39ef7fe/Level 4/lifecycle-of-an-aspnet-mvc-5-application.pdf
--------------------------------------------------------------------------------
/Level 5/holder:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/micros-uz/csharp/4fef5a752e372d41aa2ad68432b6f6bef39ef7fe/Level 5/holder
--------------------------------------------------------------------------------
/Links.txt:
--------------------------------------------------------------------------------
1 | Не увлекайтесь интерфейсами!
2 |
3 | http://www.codemanship.co.uk/parlezuml/blog/?postid=934
4 | http://blog.ploeh.dk/2010/12/02/Interfacesarenotabstractions/
5 |
6 | Хорошие абстракции
7 | http://blog.ploeh.dk/2010/12/03/Towardsbetterabstractions/
8 |
9 | SOLID
10 | http://blog.ploeh.dk/2011/06/07/SOLIDCodeisnt/
--------------------------------------------------------------------------------
/pull.cmd:
--------------------------------------------------------------------------------
1 | git pull
--------------------------------------------------------------------------------