Advertisement
eLVik

vw_QuarterCommodityItem

Dec 2nd, 2021
811
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.21 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. namespace GUTFIRK.ForestManagement.Domain.ModelEntities
  5. {
  6.    
  7.     partial class vw_QuarterCommodityItem
  8.     {
  9.         /// <summary>
  10.         /// Возвращает суммарный запас крупной древесины в общем запасе.
  11.         /// </summary>
  12.         /// <param name="totalVolume">Общий запас.</param>
  13.         /// <returns></returns>
  14.         public double GetRK(double totalVolume)
  15.         {
  16.             return totalVolume * 0.01 * (_RK1.GetValueOrDefault() + _RK2.GetValueOrDefault() + _RK3.GetValueOrDefault() + _RK4.GetValueOrDefault());
  17.         }
  18.  
  19.         /// <summary>
  20.         /// Возвращает суммарный запас средней-1 в общем запасе.
  21.         /// </summary>
  22.         /// <param name="totalVolume">Общий запас.</param>
  23.         /// <returns></returns>
  24.         public double GetRC1(double totalVolume)
  25.         {
  26.             return totalVolume * 0.01 * (_RC11.GetValueOrDefault() + _RC12.GetValueOrDefault() + _RC13.GetValueOrDefault() + _RC14.GetValueOrDefault());
  27.         }
  28.  
  29.         /// <summary>
  30.         /// Возвращает суммарный запас средней-2 в общем запасе.
  31.         /// </summary>
  32.         /// <param name="totalVolume">Общий запас.</param>
  33.         /// <returns></returns>
  34.         public double GetRC2(double totalVolume)
  35.         {
  36.             return totalVolume * 0.01 * (_RC21.GetValueOrDefault() + _RC22.GetValueOrDefault() + _RC23.GetValueOrDefault() + _RC24.GetValueOrDefault());
  37.         }
  38.  
  39.         /// <summary>
  40.         /// Возвращает суммарный запас мелкой древесины в общем запасе.
  41.         /// </summary>
  42.         /// <param name="totalVolume">Общий запас.</param>
  43.         /// <returns></returns>
  44.         public double GetRM(double totalVolume)
  45.         {
  46.             return totalVolume * 0.01 * (_RM11.GetValueOrDefault() + _RM12.GetValueOrDefault() + _RM13.GetValueOrDefault() + _RM2.GetValueOrDefault());
  47.         }
  48.  
  49.         /// <summary>
  50.         /// Возвращает суммарный запас деловой древесины в общем запасе.
  51.         /// </summary>
  52.         /// <param name="totalVolume">Общий запас.</param>
  53.         /// <returns></returns>
  54.         public double GetTimberVolume(double totalVolume)
  55.         {
  56.             double rk = this.GetRK(totalVolume);
  57.             double rc1 = this.GetRC1(totalVolume);
  58.             double rc2 = this.GetRC2(totalVolume);
  59.             double rm = this.GetRM(totalVolume);
  60.             return rk + rc1 + rc2 + rm;
  61.         }
  62.  
  63.         /// <summary>
  64.         /// Возвращает суммарный запас ликвидной древесины в общем запасе.
  65.         /// </summary>
  66.         /// <param name="totalVolume">Общий запас.</param>
  67.         /// <returns></returns>
  68.         public double GetLiquidVolume(double totalVolume)
  69.         {
  70.             double rTimber = this.GetTimberVolume(totalVolume);
  71.             return rTimber + (_RTX.GetValueOrDefault() + _RTP.GetValueOrDefault()) * totalVolume * 0.01;
  72.         }
  73.     }
  74. }
  75.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement