2 Комити d5abbb9631 ... 9e0835e010

Аутор SHA1 Порука Датум
  Елизавета Голубева 9e0835e010 Dll пре 2 година
  Елизавета Голубева 294b666dff Начало пре 2 година
3 измењених фајлова са 81 додато и 30 уклоњено
  1. 69 0
      WSUniversalLib/Calculation.cs
  2. 0 12
      WSUniversalLib/Class1.cs
  3. 12 18
      WSUniversalLib/WSUniversalLib.csproj

+ 69 - 0
WSUniversalLib/Calculation.cs

@@ -0,0 +1,69 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WSUniversalLib
+{
+    public class Calculation
+    {
+        /// <summary>
+        /// Метод расчета нового приоритета
+        /// </summary>
+        /// <param name="agentType"></param>
+        /// <param name="age"></param>
+        /// <param name="experience"></param>
+        /// <returns></returns>
+        public int GetPriorityForAgent(int agentType, float age, float experience)
+        {
+            double proc;
+            if(agentType == 1 && age < 26 && experience < 4)
+            {
+                proc = 1.8 + 0.1;
+            }
+            else if(agentType == 2 && age < 26 && experience < 4)
+            {
+                proc = 3.2 + 0.17;
+            }
+            else if (agentType == 3 && age < 26 && experience < 4)
+            {
+                proc = 4.1 + 0.26;
+            }
+            else if (agentType == 1 && age > 26 && experience > 4)
+            {
+                proc = 1.8;
+            }
+            else if (agentType == 2 && age > 26 && experience > 4)
+            {
+                proc = 3.2;
+            }
+            else if (agentType == 3 && age > 26 && experience > 4)
+            {
+                proc = 4.1;
+            }
+            else
+            {
+                return -1;
+            }
+            
+
+            if (experience > 11)
+            {
+                proc += 0.5;
+            }
+            else if (experience > 21)
+            {
+                proc += 0.7;
+            }
+            else if (experience > 41)
+            {
+                proc += 0.9;
+            }
+
+            int rezult = Convert.ToInt32(Math.Ceiling(experience * proc));
+            return rezult;
+        }
+
+    }
+}

+ 0 - 12
WSUniversalLib/Class1.cs

@@ -1,12 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace WSUniversalLib
-{
-    public class Class1
-    {
-    }
-}

+ 12 - 18
WSUniversalLib/WSUniversalLib.csproj

@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?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>f7e870b9-10ee-4630-b0f8-af7ce5c7e02d</ProjectGuid>
+    <ProjectGuid>{F7E870B9-10EE-4630-B0F8-AF7CE5C7E02D}</ProjectGuid>
     <OutputType>Library</OutputType>
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>WSUniversalLib</RootNamespace>
@@ -31,24 +31,18 @@
     <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"/>
+    <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="Class1.cs" />
+    <Compile Include="Calculation.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- </Project>
+</Project>