private void CalculateTaxType(int type) { TaxAll.Clear(); OrderCalculatees.Clear(); switch (type) { case 1: //emptyTax Cal //TaxCalculationEmptyfix(); TaxCalculationEmtry(); break; case 2: //FarmTax Cal //TaxCalculationFarm(); break; case 3: //homeLandTax Cal //TaxCalculationHomeLand(); break; case 4: //HomeTax Cal //TaxCalculationBuild(); break; default: break; } }
private void TaxCalculationEmtry() { int i = 0; int j = 1; if ((SumPropertyValue >= RangeTax[i, 1]) && (SumPropertyValue <= RangeTax[i, 2])) { double sum = SumPropertyValue * RangeCalTax[i, j]; OrderCalculate OrderCalculate1 = new OrderCalculate(); OrderCalculate1.Deduction = (long)SumPropertyValue; OrderCalculate1.TaxMoney = sum; OrderCalculate1.TaxRate = RangeCalTax[i, j]; OrderCalculatees.Add(OrderCalculate1); TaxAll.Add(sum); } else if ((SumPropertyValue > RangeTax[i, 2]) && (SumPropertyValue <= RangeTax[i, 3])) { double sum = RangeTax[i, j + 1] * RangeCalTax[i, j]; OrderCalculate OrderCalculate1 = new OrderCalculate(); OrderCalculate1.Deduction = RangeTax[i, j + 1]; OrderCalculate1.TaxMoney = sum; OrderCalculate1.TaxRate = RangeCalTax[i, j]; OrderCalculatees.Add(OrderCalculate1); TaxAll.Add(sum); j = 2; OrderCalculate OrderCalculate2 = new OrderCalculate(); double ansValue = SumPropertyValue - RangeTax[i, j]; sum = ansValue * RangeCalTax[i, j]; OrderCalculate2.Deduction = (long)ansValue; OrderCalculate2.TaxMoney = sum; OrderCalculate2.TaxRate = RangeCalTax[i, j]; OrderCalculatees.Add(OrderCalculate2); TaxAll.Add(sum); } else if ((SumPropertyValue > RangeTax[i, 3]) && (SumPropertyValue <= RangeTax[i, 4])) { j = 1; OrderCalculate OrderCalculate1 = new OrderCalculate(); double sum = RangeTax[i, j + 1] * RangeCalTax[i, j]; OrderCalculate1.Deduction = RangeTax[i, j + 1]; OrderCalculate1.TaxMoney = sum; OrderCalculate1.TaxRate = RangeCalTax[i, j]; OrderCalculatees.Add(OrderCalculate1); TaxAll.Add(sum); j = 2; OrderCalculate OrderCalculate2 = new OrderCalculate(); sum = (RangeTax[i, j + 1] - RangeTax[i, j]) * RangeCalTax[i, j]; OrderCalculate2.Deduction = RangeTax[i, j + 1] - RangeTax[i, j]; OrderCalculate2.TaxMoney = sum; OrderCalculate2.TaxRate = RangeCalTax[i, j]; OrderCalculatees.Add(OrderCalculate2); TaxAll.Add(sum); j = 3; OrderCalculate OrderCalculate3 = new OrderCalculate(); double ansValue = SumPropertyValue - RangeTax[i, j]; sum = ansValue * RangeCalTax[i, j]; OrderCalculate3.Deduction = (long)ansValue; OrderCalculate3.TaxMoney = sum; OrderCalculate3.TaxRate = RangeCalTax[i, j]; OrderCalculatees.Add(OrderCalculate3); TaxAll.Add(sum); } else if ((SumPropertyValue > RangeTax[i, 4]) && (SumPropertyValue <= RangeTax[i, 5])) { j = 1; OrderCalculate OrderCalculate1 = new OrderCalculate(); double sum = RangeTax[i, j + 1] * RangeCalTax[i, j]; OrderCalculate1.Deduction = RangeTax[i, j + 1]; OrderCalculate1.TaxMoney = sum; OrderCalculate1.TaxRate = RangeCalTax[i, j]; OrderCalculatees.Add(OrderCalculate1); TaxAll.Add(sum); j = 2; OrderCalculate OrderCalculate2 = new OrderCalculate(); sum = (RangeTax[i, j + 1] - RangeTax[i, j]) * RangeCalTax[i, j]; OrderCalculate2.Deduction = RangeTax[i, j + 1] - RangeTax[i, j]; OrderCalculate2.TaxMoney = sum; OrderCalculate2.TaxRate = RangeCalTax[i, j]; OrderCalculatees.Add(OrderCalculate2); TaxAll.Add(sum); j = 3; OrderCalculate OrderCalculate3 = new OrderCalculate(); sum = (RangeTax[i, j + 1] - RangeTax[i, j]) * RangeCalTax[i, j]; OrderCalculate3.Deduction = RangeTax[i, j + 1] - RangeTax[i, j]; OrderCalculate3.TaxMoney = sum; OrderCalculate3.TaxRate = RangeCalTax[i, j]; OrderCalculatees.Add(OrderCalculate3); TaxAll.Add(sum); j = 4; OrderCalculate OrderCalculate4 = new OrderCalculate(); double ansValue = SumPropertyValue - RangeTax[i, j]; sum = ansValue * RangeCalTax[i, j]; OrderCalculate4.Deduction = (long)ansValue; OrderCalculate4.TaxMoney = sum; OrderCalculate4.TaxRate = RangeCalTax[i, j]; OrderCalculatees.Add(OrderCalculate4); TaxAll.Add(sum); } else if (SumPropertyValue > RangeTax[i, 5]) { j = 1; OrderCalculate OrderCalculate1 = new OrderCalculate(); double sum = RangeTax[i, j + 1] * RangeCalTax[i, j]; OrderCalculate1.Deduction = RangeTax[i, j + 1]; OrderCalculate1.TaxMoney = sum; OrderCalculate1.TaxRate = RangeCalTax[i, j]; OrderCalculatees.Add(OrderCalculate1); TaxAll.Add(sum); j = 2; OrderCalculate OrderCalculate2 = new OrderCalculate(); sum = (RangeTax[i, j + 1] - RangeTax[i, j]) * RangeCalTax[i, j]; OrderCalculate2.Deduction = RangeTax[i, j + 1] - RangeTax[i, j]; OrderCalculate2.TaxMoney = sum; OrderCalculate2.TaxRate = RangeCalTax[i, j]; OrderCalculatees.Add(OrderCalculate2); TaxAll.Add(sum); j = 3; OrderCalculate OrderCalculate3 = new OrderCalculate(); sum = (RangeTax[i, j + 1] - RangeTax[i, j]) * RangeCalTax[i, j]; OrderCalculate3.Deduction = RangeTax[i, j + 1] - RangeTax[i, j]; OrderCalculate3.TaxMoney = sum; OrderCalculate3.TaxRate = RangeCalTax[i, j]; OrderCalculatees.Add(OrderCalculate3); TaxAll.Add(sum); j = 4; OrderCalculate OrderCalculate4 = new OrderCalculate(); sum = (RangeTax[i, j + 1] - RangeTax[i, j]) * RangeCalTax[i, j]; OrderCalculate4.Deduction = RangeTax[i, j + 1] - RangeTax[i, j]; OrderCalculate4.TaxMoney = sum; OrderCalculate4.TaxRate = RangeCalTax[i, j]; OrderCalculatees.Add(OrderCalculate4); TaxAll.Add(sum); j = 5; OrderCalculate OrderCalculate5 = new OrderCalculate(); double ansValue = SumPropertyValue - RangeTax[i, j]; sum = ansValue * RangeCalTax[i, j]; OrderCalculate5.Deduction = (long)ansValue; OrderCalculate5.TaxMoney = sum; OrderCalculate5.TaxRate = RangeCalTax[i, j]; OrderCalculatees.Add(OrderCalculate5); TaxAll.Add(sum); } var SumTax = 0.00; foreach (var item in TaxAll) { SumTax = SumTax + item; } SumTaxValue = Convert.ToDecimal(SumTax); }