Browse Source

CompanyCoreLib.dll

grisha.finikoff 4 years ago
commit
5419dcbd00

+ 25 - 0
CompanyCoreLib.sln

@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30717.126
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompanyCoreLib", "CompanyCoreLib\CompanyCoreLib.csproj", "{A3AB7740-AF8A-4266-B592-B921344DC80F}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{A3AB7740-AF8A-4266-B592-B921344DC80F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{A3AB7740-AF8A-4266-B592-B921344DC80F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{A3AB7740-AF8A-4266-B592-B921344DC80F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{A3AB7740-AF8A-4266-B592-B921344DC80F}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {D15148E5-EBA2-461D-8B18-0C0F96F5121B}
+	EndGlobalSection
+EndGlobal

+ 35 - 0
CompanyCoreLib/Analytics.cs

@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace CompanyCoreLib
+{
+    public class Analytics
+    {
+        public List<DateTime> PopularMonths(List<DateTime> dates)
+        {
+            List<DataOfOrder> dataOfOrders = new List<DataOfOrder>();
+            foreach (DateTime item in dates)
+            {
+                var data = dataOfOrders.FirstOrDefault(x => x.Date.Month == item.Month && x.Date.Year == item.Year);
+                if (data is null) dataOfOrders.Add(new DataOfOrder { Date = new DateTime(item.Year, item.Month, 1), CountOrder = 1 });
+                else dataOfOrders.FirstOrDefault(x => x.Date.Month == item.Month && x.Date.Year == item.Year).CountOrder += 1;
+            }
+            dataOfOrders = dataOfOrders.OrderByDescending(x => x.CountOrder).ThenBy(x => x.Date).ToList();
+            List<DateTime> SortList = new List<DateTime>();
+            foreach (var item in dataOfOrders)
+            {
+                SortList.Add(item.Date);
+            }
+            return SortList;
+        }
+    }
+
+    class DataOfOrder
+    {
+        public DateTime Date { get; set; }
+        public int CountOrder { get; set; }
+    }
+}

+ 48 - 0
CompanyCoreLib/CompanyCoreLib.csproj

@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{A3AB7740-AF8A-4266-B592-B921344DC80F}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>CompanyCoreLib</RootNamespace>
+    <AssemblyName>CompanyCoreLib</AssemblyName>
+    <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <Deterministic>true</Deterministic>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Analytics.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>

+ 36 - 0
CompanyCoreLib/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// Общие сведения об этой сборке предоставляются следующим набором
+// набора атрибутов. Измените значения этих атрибутов для изменения сведений,
+// связанные со сборкой.
+[assembly: AssemblyTitle("CompanyCoreLib")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("CompanyCoreLib")]
+[assembly: AssemblyCopyright("Copyright ©  2021")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми
+// для компонентов COM. Если необходимо обратиться к типу в этой сборке через
+// COM, задайте атрибуту ComVisible значение TRUE для этого типа.
+[assembly: ComVisible(false)]
+
+// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM
+[assembly: Guid("a3ab7740-af8a-4266-b592-b921344dc80f")]
+
+// Сведения о версии сборки состоят из указанных ниже четырех значений:
+//
+//      Основной номер версии
+//      Дополнительный номер версии
+//      Номер сборки
+//      Редакция
+//
+// Можно задать все значения или принять номера сборки и редакции по умолчанию 
+// используя "*", как показано ниже:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

BIN
CompanyCoreLib/bin/Debug/CompanyCoreLib.dll


BIN
CompanyCoreLib/bin/Debug/CompanyCoreLib.pdb


+ 4 - 0
CompanyCoreLib/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs

@@ -0,0 +1,4 @@
+// <autogenerated />
+using System;
+using System.Reflection;
+[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]

+ 1 - 0
CompanyCoreLib/obj/Debug/CompanyCoreLib.csproj.CoreCompileInputs.cache

@@ -0,0 +1 @@
+e4581e02a63a948f0511ba6e15ba32c58b301a05

+ 6 - 0
CompanyCoreLib/obj/Debug/CompanyCoreLib.csproj.FileListAbsolute.txt

@@ -0,0 +1,6 @@
+C:\Users\Григорий\source\repos\CompanyCoreLib\CompanyCoreLib\bin\Debug\CompanyCoreLib.dll
+C:\Users\Григорий\source\repos\CompanyCoreLib\CompanyCoreLib\bin\Debug\CompanyCoreLib.pdb
+C:\Users\Григорий\source\repos\CompanyCoreLib\CompanyCoreLib\obj\Debug\CompanyCoreLib.csproj.CoreCompileInputs.cache
+C:\Users\Григорий\source\repos\CompanyCoreLib\CompanyCoreLib\obj\Debug\CompanyCoreLib.dll
+C:\Users\Григорий\source\repos\CompanyCoreLib\CompanyCoreLib\obj\Debug\CompanyCoreLib.pdb
+C:\Users\Григорий\source\repos\CompanyCoreLib\CompanyCoreLib\obj\Debug\CompanyCoreLib.csprojAssemblyReference.cache

BIN
CompanyCoreLib/obj/Debug/CompanyCoreLib.csprojAssemblyReference.cache


BIN
CompanyCoreLib/obj/Debug/CompanyCoreLib.dll


BIN
CompanyCoreLib/obj/Debug/CompanyCoreLib.pdb


BIN
CompanyCoreLib/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache