public decimal Result(decimal BasicNum,decimal TotalNum)
  {
   decimal cha=TotalNum-BasicNum;
   decimal output=0;
   if (cha>0&&cha<=500)
   {
    output=decimal.Parse((double.Parse(cha.ToString())*0.05).ToString());
   }
   if (cha>500&&cha<=2000)
   {
    output=decimal.Parse((double.Parse(cha.ToString())*0.1).ToString())-25;
    //output=cha*0.1-25;
   }
   if (cha>2000&&cha<=5000)
   {
    //output=cha*0.15-125;
    output=decimal.Parse((double.Parse(cha.ToString())*0.15).ToString())-125;
    
   }
   if (cha>5000&&cha<=20000)
   {
    //output=cha*0.2-375;
    output=decimal.Parse((double.Parse(cha.ToString())*0.2).ToString())-375;
   }
   if (cha>20000&&cha<=40000)
   {
    //output=cha*0.25-1375;
    output=decimal.Parse((double.Parse(cha.ToString())*0.25).ToString())-1375;
   }
   if (cha>40000&&cha<=60000)
   {
    //output=cha*0.30-3375;
    output=decimal.Parse((double.Parse(cha.ToString())*0.30).ToString())-3375;
   }
   if (cha>60000&&cha<=80000)
   {
    //output=cha*0.35-6375;
    output=decimal.Parse((double.Parse(cha.ToString())*0.35).ToString())-6375;
   }
   if (cha>80000&&cha<=100000)
   {
    //output=cha*0.4-10375;
    output=decimal.Parse((double.Parse(cha.ToString())*0.4).ToString())-10375;
   }
   if (cha>100000&&cha>100000)
   {
    //output=cha*0.45-15375;
    output=decimal.Parse((double.Parse(cha.ToString())*0.45).ToString())-15375;
   }
   return output;

  }

版权声明:本文为Apex-yang原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/Apex-yang/articles/464609.html