private void btnDummy_Click(object sender, EventArgs e) { txtModeloAparelho.Text = "Galaxy"; txtMEI.Text = "123456789"; txtNumNotaFiscal.Text = "987654321"; txtParcelado.Text = "4"; txtDocumentoPortador.Text = "1112223330"; txtEmail.Text = "*****@*****.**"; txtIdade.Text = "37"; txtTelefonePortador.Text = "21976631470"; txtNomePortador.Text = "Vinicius Climaco"; txtValorAparelho.Text = "5000,00"; servicoRegras = new ServiceReference2.RegrasClient(); double valorCotacao = servicoRegras.RegraValorCotacao(double.Parse(txtValorAparelho.Text, System.Globalization.NumberStyles.AllowDecimalPoint), Convert.ToInt32(txtIdade.Text)); lblValorCotacao.Text = valorCotacao.ToString(); }
private void SaidaCampoIdade_ValorAparelho() { try { if (txtIdade.Text == string.Empty) { txtIdade.Text = "1"; } if (txtValorAparelho.Text == string.Empty) { txtValorAparelho.Text = "100,00"; } double valorCotacao = new ServiceReference2.RegrasClient().RegraValorCotacao(double.Parse(txtValorAparelho.Text, System.Globalization.NumberStyles.AllowDecimalPoint), Convert.ToInt32(txtIdade.Text)); lblValorCotacao.Text = valorCotacao.ToString(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error); } }