Class1.cs 699 B

123456789101112131415161718192021222324
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace WSUniversalLib
  7. {
  8. public class Calculation
  9. {
  10. public int GetQuantityForProduct(int productType,int materialType,int count,float width,float length)
  11. {
  12. double prType=0;
  13. if (productType == 1) prType = 1.1;
  14. if (productType == 2) prType = 2.5;
  15. if (productType == 3) prType = 8.43;
  16. double mType=0;
  17. if (productType == 1) mType = 1.003;
  18. if (productType == 2) mType = 2.0012;
  19. return Convert.ToInt32(width * length * count * prType * mType);
  20. }
  21. }
  22. }