Ver Fonte

Добавьте файлы проекта.

Никита Мелузов há 2 anos atrás
pai
commit
2ab7ad659f
4 ficheiros alterados com 250 adições e 0 exclusões
  1. 135 0
      Calculation.cs
  2. 36 0
      Properties/AssemblyInfo.cs
  3. 48 0
      WSUniversalLib.csproj
  4. 31 0
      WSUniversalLib.sln

+ 135 - 0
Calculation.cs

@@ -0,0 +1,135 @@
+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 priorityGeneral;
+            float prior;
+            float agent;
+            if (age <= 25 && experience <= 3)
+            {
+                switch (agentType)
+                {
+                    case 1:
+                        {
+                            prior = (float)(experience * 1.9);
+                            priorityGeneral = (int)Math.Round(prior);
+                            return priorityGeneral;
+
+                        }
+                    case 2:
+                        {
+                            prior = (float)(experience * 3.37);
+                            priorityGeneral = (int)Math.Round(prior);
+                            return priorityGeneral;
+                        }
+                    case 3:
+                        {
+                            prior = (float)(experience * 4.36);
+                            priorityGeneral = (int)Math.Round(prior);
+                            return priorityGeneral;
+                        }
+                    default:
+                        {
+                            return -1;
+                        }
+                }
+            }
+            else
+            {
+                switch (agentType)
+                {
+                    case 1:
+                        {
+
+                            if (experience > 10 && experience <= 20)
+                            {
+                                agent = (float)2.3;
+                                prior = experience * agent;
+                                priorityGeneral = (int)Math.Round(prior);
+                                return priorityGeneral;
+                            }
+                            else if (experience > 20 && experience < 40)
+                            {
+                                agent = (float)2.5;
+                                prior = experience * agent;
+                                priorityGeneral = (int)Math.Round(prior);
+                                return priorityGeneral;
+                            }
+                            else if (experience >= 40)
+                            {
+                                agent = (float)2.7;
+                                prior = experience * agent;
+                                priorityGeneral = (int)Math.Round(prior);
+                                return priorityGeneral;
+                            }
+                            break;
+                        }
+                    case 2:
+                        {
+                            if (experience > 10 && experience <= 20)
+                            {
+                                agent = (float)3.7;
+                                prior = experience * agent;
+                                priorityGeneral = (int)Math.Round(prior);
+                                return priorityGeneral;
+                            }
+                            else if (experience > 20 && experience < 40)
+                            {
+                                agent = (float)3.9;
+                                prior = experience * agent;
+                                priorityGeneral = (int)Math.Round(prior);
+                                return priorityGeneral;
+                            }
+                            else if (experience >= 40)
+                            {
+                                agent = (float)4.1;
+                                prior = experience * agent;
+                                priorityGeneral = (int)Math.Round(prior);
+                                return priorityGeneral;
+                            }
+                            break;
+                        }
+                    case 3:
+                        {
+                            if (experience > 10 && experience <= 20)
+                            {
+                                agent = (float)4.6;
+                                prior = experience * agent;
+                                priorityGeneral = (int)Math.Round(prior);
+                                return priorityGeneral;
+                            }
+                            else if (experience > 20 && experience < 40)
+                            {
+                                agent = (float)4.8;
+                                prior = experience * agent;
+                                priorityGeneral = (int)Math.Round(prior);
+                                return priorityGeneral;
+                            }
+                            else if (experience >= 40)
+                            {
+                                agent = (float)5;
+                                prior = experience * agent;
+                                priorityGeneral = (int)Math.Round(prior);
+                                return priorityGeneral;
+                            }
+                            break;
+                        }
+                    default:
+                        {
+                            return -1;
+                        }
+                }
+                return -1;
+            }
+
+        }
+    }
+}

+ 36 - 0
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("bdadcf3d-7447-4ac5-ba6d-c5c02273846c")]
+
+// Сведения о версии сборки состоят из указанных ниже четырех значений:
+//
+//      Основной номер версии
+//      Дополнительный номер версии
+//      Номер сборки
+//      Редакция
+//
+// Можно задать все значения или принять номера сборки и редакции по умолчанию 
+// используя "*", как показано ниже:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 48 - 0
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>{BDADCF3D-7447-4AC5-BA6D-C5C02273846C}</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>

+ 31 - 0
WSUniversalLib.sln

@@ -0,0 +1,31 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30804.86
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WSUniversalLib", "WSUniversalLib.csproj", "{BDADCF3D-7447-4AC5-BA6D-C5C02273846C}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTestCalculation", "..\UnitTestProject1\UnitTestCalculation.csproj", "{47F2E20B-7857-47E6-8EEC-71C16D15BF97}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{BDADCF3D-7447-4AC5-BA6D-C5C02273846C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{BDADCF3D-7447-4AC5-BA6D-C5C02273846C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{BDADCF3D-7447-4AC5-BA6D-C5C02273846C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{BDADCF3D-7447-4AC5-BA6D-C5C02273846C}.Release|Any CPU.Build.0 = Release|Any CPU
+		{47F2E20B-7857-47E6-8EEC-71C16D15BF97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{47F2E20B-7857-47E6-8EEC-71C16D15BF97}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{47F2E20B-7857-47E6-8EEC-71C16D15BF97}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{47F2E20B-7857-47E6-8EEC-71C16D15BF97}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {09319192-F499-4F6E-B640-78132E188B79}
+	EndGlobalSection
+EndGlobal