示例#1
0
    private void UpdateNewCosts(RevisedBudgetOtherCosts otherCosts, int multiplier)
    {
        if (otherCosts.CurrentCosts.TE == ApplicationConstants.DECIMAL_NULL_VALUE && otherCosts.UpdateCosts.TE == ApplicationConstants.DECIMAL_NULL_VALUE)
        {
            otherCosts.NewCosts.TE = ApplicationConstants.DECIMAL_NULL_VALUE;
        }
        else
        {
            otherCosts.NewCosts.TE = ApplicationUtils.GetDecimalValueForSum(otherCosts.CurrentCosts.TE) +
                                     ApplicationUtils.GetDecimalValueForSum(otherCosts.UpdateCosts.TE);
        }

        if (otherCosts.CurrentCosts.ProtoParts == ApplicationConstants.DECIMAL_NULL_VALUE && otherCosts.UpdateCosts.ProtoParts == ApplicationConstants.DECIMAL_NULL_VALUE)
        {
            otherCosts.NewCosts.ProtoParts = ApplicationConstants.DECIMAL_NULL_VALUE;
        }
        else
        {
            otherCosts.NewCosts.ProtoParts = ApplicationUtils.GetDecimalValueForSum(otherCosts.CurrentCosts.ProtoParts) +
                                             ApplicationUtils.GetDecimalValueForSum(otherCosts.UpdateCosts.ProtoParts);
        }

        if (otherCosts.CurrentCosts.ProtoTooling == ApplicationConstants.DECIMAL_NULL_VALUE && otherCosts.UpdateCosts.ProtoTooling == ApplicationConstants.DECIMAL_NULL_VALUE)
        {
            otherCosts.NewCosts.ProtoTooling = ApplicationConstants.DECIMAL_NULL_VALUE;
        }
        else
        {
            otherCosts.NewCosts.ProtoTooling = ApplicationUtils.GetDecimalValueForSum(otherCosts.CurrentCosts.ProtoTooling) +
                                               ApplicationUtils.GetDecimalValueForSum(otherCosts.UpdateCosts.ProtoTooling);
        }

        if (otherCosts.CurrentCosts.Trials == ApplicationConstants.DECIMAL_NULL_VALUE && otherCosts.UpdateCosts.Trials == ApplicationConstants.DECIMAL_NULL_VALUE)
        {
            otherCosts.NewCosts.Trials = ApplicationConstants.DECIMAL_NULL_VALUE;
        }
        else
        {
            otherCosts.NewCosts.Trials = ApplicationUtils.GetDecimalValueForSum(otherCosts.CurrentCosts.Trials) +
                                         ApplicationUtils.GetDecimalValueForSum(otherCosts.UpdateCosts.Trials);
        }

        if (otherCosts.CurrentCosts.OtherExpenses == ApplicationConstants.DECIMAL_NULL_VALUE && otherCosts.UpdateCosts.OtherExpenses == ApplicationConstants.DECIMAL_NULL_VALUE)
        {
            otherCosts.NewCosts.OtherExpenses = ApplicationConstants.DECIMAL_NULL_VALUE;
        }
        else
        {
            otherCosts.NewCosts.OtherExpenses = ApplicationUtils.GetDecimalValueForSum(otherCosts.CurrentCosts.OtherExpenses) +
                                                ApplicationUtils.GetDecimalValueForSum(otherCosts.UpdateCosts.OtherExpenses);
        }
    }