Exemplo n.º 1
0
        private void updateGasChoice(gasTransactType t)
        {
            if (_rechargeDTO != null)
            {
                switch (t)
                {
                    case gasTransactType.gas92:
                        txtGasType.Text = SGMText.GAS_92_TEXT;
                        m_iCurrentPrice = m_iCurrentPriceGas92;
                        //m_iApplyPrice = m_iCurrentPrice > _rechargeDTO.RechargeGas92Price ? _rechargeDTO.RechargeGas92Price : m_iCurrentPrice;

                        if (_rechargeDTO.RechargeGas92Price < m_iCurrentPrice)
                        {
                            m_iApplyPrice = m_iCurrentPrice;
                            m_iSavingMoney = m_iCurrentPrice - _rechargeDTO.RechargeGas92Price;
                        }
                        else
                        {
                            m_iApplyPrice = _rechargeDTO.RechargeGas92Price;
                            m_iSavingMoney = 0;
                        }
                        txtPrice.Text = _rechargeDTO.RechargeGas92Price.ToString(MONEY_FORMAT);
                        m_iCurrentTotal = m_iCurrentTotalGas92;
                        break;
                    case gasTransactType.gas95:
                        txtGasType.Text = SGMText.GAS_95_TEXT;
                        m_iCurrentPrice = m_iCurrentPriceGas95;
                        //m_iApplyPrice = m_iCurrentPrice > _rechargeDTO.RechargeGas95Price ? _rechargeDTO.RechargeGas95Price : m_iCurrentPrice;
                        if (_rechargeDTO.RechargeGas95Price < m_iCurrentPrice)
                        {
                            m_iApplyPrice = m_iCurrentPrice;
                            m_iSavingMoney = m_iCurrentPrice - _rechargeDTO.RechargeGas95Price;
                        }
                        else
                        {
                            m_iApplyPrice = _rechargeDTO.RechargeGas95Price;
                            m_iSavingMoney = 0;
                        }
                        txtPrice.Text = _rechargeDTO.RechargeGas95Price.ToString(MONEY_FORMAT);
                        m_iCurrentTotal = m_iCurrentTotalGas95;
                        break;
                    case gasTransactType.gasDO:
                        txtGasType.Text = SGMText.GAS_DO_TEXT;
                        m_iCurrentPrice = m_iCurrentPriceGasDO;
                        //m_iApplyPrice = m_iCurrentPrice > _rechargeDTO.RechargeGasDOPrice ? _rechargeDTO.RechargeGasDOPrice : m_iCurrentPrice;
                        if (_rechargeDTO.RechargeGasDOPrice < m_iCurrentPrice)
                        {
                            m_iApplyPrice = m_iCurrentPrice;
                            m_iSavingMoney = m_iCurrentPrice - _rechargeDTO.RechargeGasDOPrice;
                        }
                        else
                        {
                            m_iApplyPrice = _rechargeDTO.RechargeGasDOPrice;
                            m_iSavingMoney = 0;
                        }
                        txtPrice.Text = _rechargeDTO.RechargeGasDOPrice.ToString(MONEY_FORMAT);
                        m_iCurrentTotal = m_iCurrentTotalGasDO;
                        break;
                }
                calculatePay();
            }
        }
Exemplo n.º 2
0
        private void updateGasChoice(gasTransactType t)
        {
            if (_rechargeDTO != null)
            {
                switch (t)
                {
                case gasTransactType.gas92:
                    txtGasType.Text = SGMText.GAS_92_TEXT;
                    m_iCurrentPrice = m_iCurrentPriceGas92;
                    //m_iApplyPrice = m_iCurrentPrice > _rechargeDTO.RechargeGas92Price ? _rechargeDTO.RechargeGas92Price : m_iCurrentPrice;


                    if (_rechargeDTO.RechargeGas92Price < m_iCurrentPrice)
                    {
                        m_iApplyPrice  = m_iCurrentPrice;
                        m_iSavingMoney = m_iCurrentPrice - _rechargeDTO.RechargeGas92Price;
                    }
                    else
                    {
                        m_iApplyPrice  = _rechargeDTO.RechargeGas92Price;
                        m_iSavingMoney = 0;
                    }
                    txtPrice.Text   = _rechargeDTO.RechargeGas92Price.ToString(MONEY_FORMAT);
                    m_iCurrentTotal = m_iCurrentTotalGas92;
                    break;

                case gasTransactType.gas95:
                    txtGasType.Text = SGMText.GAS_95_TEXT;
                    m_iCurrentPrice = m_iCurrentPriceGas95;
                    //m_iApplyPrice = m_iCurrentPrice > _rechargeDTO.RechargeGas95Price ? _rechargeDTO.RechargeGas95Price : m_iCurrentPrice;
                    if (_rechargeDTO.RechargeGas95Price < m_iCurrentPrice)
                    {
                        m_iApplyPrice  = m_iCurrentPrice;
                        m_iSavingMoney = m_iCurrentPrice - _rechargeDTO.RechargeGas95Price;
                    }
                    else
                    {
                        m_iApplyPrice  = _rechargeDTO.RechargeGas95Price;
                        m_iSavingMoney = 0;
                    }
                    txtPrice.Text   = _rechargeDTO.RechargeGas95Price.ToString(MONEY_FORMAT);
                    m_iCurrentTotal = m_iCurrentTotalGas95;
                    break;

                case gasTransactType.gasDO:
                    txtGasType.Text = SGMText.GAS_DO_TEXT;
                    m_iCurrentPrice = m_iCurrentPriceGasDO;
                    //m_iApplyPrice = m_iCurrentPrice > _rechargeDTO.RechargeGasDOPrice ? _rechargeDTO.RechargeGasDOPrice : m_iCurrentPrice;
                    if (_rechargeDTO.RechargeGasDOPrice < m_iCurrentPrice)
                    {
                        m_iApplyPrice  = m_iCurrentPrice;
                        m_iSavingMoney = m_iCurrentPrice - _rechargeDTO.RechargeGasDOPrice;
                    }
                    else
                    {
                        m_iApplyPrice  = _rechargeDTO.RechargeGasDOPrice;
                        m_iSavingMoney = 0;
                    }
                    txtPrice.Text   = _rechargeDTO.RechargeGasDOPrice.ToString(MONEY_FORMAT);
                    m_iCurrentTotal = m_iCurrentTotalGasDO;
                    break;
                }
                calculatePay();
            }
        }