コード例 #1
0
        private void OnButtonAdaugaClicked(object sender, EventArgs e)
        {
            Validare();
            if (lblNume.ForeColor == Color.Red || lblPrenume.ForeColor == Color.Red || lblVenit.ForeColor == Color.Red || lblCheltuieli.ForeColor == Color.Red)
            {
                lblInfo.Text = "Datele nu sunt valide";
            }
            else

            {
                int intVenit;
                Int32.TryParse(txtVenit.Text, out intVenit);
                int intCheltuieli;
                Int32.TryParse(txtCheltuieli.Text, out intCheltuieli);
                Cont s = new Cont(txtNume.Text, txtPrenume.Text, intVenit, intCheltuieli);

                lblInfo.Text = s.ConversieLaSir();
                adminConturi.AddCont(s);
            }
        }