123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace WSUniversalLib
- {
- public class Calculation
- {
- public static int GetQuantityForProduct(int productType, int materialType, int count, float width, float length)
- {
-
- float quantity = 0f;
- switch(productType)
- {
- case 1:
- quantity = width * length * count * 1.1f;
- break;
- case 2:
- quantity = width * length * count * 2.5f;
- break;
- case 3:
- quantity = width * length * count * 8.43f;
- break;
- default:
- return -1;
- break;
- }
-
- switch(materialType)
- {
- case 1:
- quantity = quantity * 1.003f;
- break;
- case 2:
- quantity = quantity * 1.0012f;
- break;
- default:
- return -1;
- break;
- }
- return Convert.ToInt32(quantity);
- }
- }
- }
|