Ver código fonte

догрузила

ra5um1st 2 anos atrás
pai
commit
ad52675dc2

+ 6 - 6
DemoexamUser11.sln

@@ -3,24 +3,24 @@ Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio Version 16
 VisualStudioVersion = 16.0.30907.101
 MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WSUniversalLib", "..\DLL\WSUniversalLib\WSUniversalLib\WSUniversalLib.csproj", "{32959932-E887-42A8-B7A1-1D94DF58EF07}"
-EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WSUniversalLibUnitTests", "WSUniversalLibГnitTests\WSUniversalLibUnitTests.csproj", "{4CF84738-1141-490A-B6B5-6960DE3E63CF}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WSUniversalLib", "Y:\DemoexamUser11\WSUniversalLib\WSUniversalLib\WSUniversalLib.csproj", "{8687F098-32B0-4B5F-AD00-C1F3BCC4E14B}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
 		Release|Any CPU = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{32959932-E887-42A8-B7A1-1D94DF58EF07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{32959932-E887-42A8-B7A1-1D94DF58EF07}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{32959932-E887-42A8-B7A1-1D94DF58EF07}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{32959932-E887-42A8-B7A1-1D94DF58EF07}.Release|Any CPU.Build.0 = Release|Any CPU
 		{4CF84738-1141-490A-B6B5-6960DE3E63CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{4CF84738-1141-490A-B6B5-6960DE3E63CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{4CF84738-1141-490A-B6B5-6960DE3E63CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{4CF84738-1141-490A-B6B5-6960DE3E63CF}.Release|Any CPU.Build.0 = Release|Any CPU
+		{8687F098-32B0-4B5F-AD00-C1F3BCC4E14B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{8687F098-32B0-4B5F-AD00-C1F3BCC4E14B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{8687F098-32B0-4B5F-AD00-C1F3BCC4E14B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{8687F098-32B0-4B5F-AD00-C1F3BCC4E14B}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 50 - 0
WSUniversalLib/WSUniversalLib/Calculation.cs

@@ -0,0 +1,50 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WSUniversalLib
+{
+    public class Calculation
+    {
+        public int GetPriorityForAgent(int agentType, float age, float experience)
+        {
+            int result = -1;
+            float agentCoefficient;
+            switch (agentType)
+            {
+                case 1:
+                    agentCoefficient = 1.8f;
+                    if (age <= 25 && experience <= 3)
+                        agentCoefficient += 0.1f;
+                    break;
+                case 2:
+                    agentCoefficient = 3.2f;
+                    if (age <= 25 && experience <= 3)
+                        agentCoefficient += 0.17f;
+                    break;
+                case 3:
+                    agentCoefficient = 4.1f;
+                    if (age <= 25 && experience <= 3)
+                        agentCoefficient += 0.26f;
+                    break;
+                default:
+                    agentCoefficient = 0;
+                    break;
+            }
+            if (agentCoefficient != 0 && age > 0 && experience > 0 && age < 130 && experience < age)
+            {
+                if (experience > 10 && experience < 20)
+                    agentCoefficient += 0.5f;
+                else if (experience > 20 && experience < 40)
+                    agentCoefficient += 0.7f;
+                else if (experience > 40)
+                    agentCoefficient += 0.9f;
+                result = (int)Math.Round(agentCoefficient * experience);
+            }
+
+            return result;
+        }
+    }
+}

+ 36 - 0
WSUniversalLib/WSUniversalLib/Properties/AssemblyInfo.cs

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

+ 48 - 0
WSUniversalLib/WSUniversalLib/WSUniversalLib.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>{8687F098-32B0-4B5F-AD00-C1F3BCC4E14B}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>WSUniversalLib</RootNamespace>
+    <AssemblyName>WSUniversalLib</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="Calculation.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project>

+ 2 - 2
WSUniversalLibГnitTests/WSUniversalLibUnitTests.csproj

@@ -56,8 +56,8 @@
     <None Include="packages.config" />
   </ItemGroup>
   <ItemGroup>
-    <ProjectReference Include="..\..\DLL\WSUniversalLib\WSUniversalLib\WSUniversalLib.csproj">
-      <Project>{32959932-e887-42a8-b7a1-1d94df58ef07}</Project>
+    <ProjectReference Include="Y:\DemoexamUser11\WSUniversalLib\WSUniversalLib\WSUniversalLib.csproj">
+      <Project>{8687f098-32b0-4b5f-ad00-c1f3bcc4e14b}</Project>
       <Name>WSUniversalLib</Name>
     </ProjectReference>
   </ItemGroup>