Beispiel #1
0
        private void btnCalcular_Click(object sender, EventArgs e)
        {
            try
            {
                ClsData data = new ClsData();

                if (data.StringEmpty(mskData.Text))
                {
                    throw new Exception("Data inválida");
                }

                if (data.StringEmpty(txtOperador.Text))
                {
                    throw new Exception("Operador não foi informado.");
                }

                if (data.StringEmpty(txtValor.Text))
                {
                    throw new Exception("Valor não foi informado.");
                }


                txtDataFinal.Text = data.CalcularData(mskData.Text, Convert.ToChar(txtOperador.Text), long.Parse(txtValor.Text));
            }
            catch (Exception ex)
            {
                MessageBox.Show($"Verifique os campos. {ex.Message}");
            }
        }