using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CLPersone;

namespace AppWindows
{
    public partial class frmInserimento : Form
    {

        Persona persona;

        public Persona Persona
        {
            get { return persona; }
        }
        
        public frmInserimento()
        {
            InitializeComponent();
            cboRuolo.Items.AddRange(Enum.GetNames(typeof(Ruolo)));
        }

        private void btnInserimento_Click(object sender, EventArgs e)
        {
            persona = new Persona();

            persona.CodiceFiscale = edtCodiceFiscale.Text;
            persona.Cognome = edtCognome.Text;
            persona.Nome = edtNome.Text;
            persona.RecapitoTelefonico = edtRecapitoTelefonico.Text;
            persona.Ruolo = (Ruolo) cboRuolo.SelectedIndex;
            DialogResult = DialogResult.OK;
            Close();

        }
    }
}
