Beispiel #1
0
        private void SaveOrUpdate()
        {
            _current.Cognome       = txtDescrizione.Text;
            _current.Nome          = txtResp.Text;
            _current.CodiceFiscale = txtIva.Text;


            _current.Resource = cboZone.SelectedItem  as Resource;


            if (dtpNas.EditValue == null)
            {
                _current.DataNascita = DateTime.MinValue;
            }
            else
            {
                _current.DataNascita = dtpNas.DateTime;
            }

            if (cboSex.Text == "Uomo")
            {
                _current.Sesso = AbstractPersona.Sex.Maschio;
            }
            else
            {
                _current.Sesso = AbstractPersona.Sex.Femmina;
            }



            _current.Nazionalita      = cboNazNas.SelectedItem as Nazione;
            _current.ProvinciaNascita = cboProvNas.SelectedItem as Provincia;
            _current.ComuneNascita    = cboComNas.SelectedItem as Comune;

            _current.Residenza.Nazione = cboNazRes.SelectedItem as Nazione;



            _current.Residenza.Provincia = cboProv.SelectedItem as Provincia;
            _current.Residenza.Comune    = cboCom.SelectedItem as Comune;

            _current.Residenza.Via = txtInd.Text;
            _current.Residenza.Cap = txtCap.Text;


            _current.Is_Private = chkPrivate.Checked;


            _current.Comunicazione.Fax             = txtFax.Text;
            _current.Comunicazione.TelefonoUfficio = txtFisso.Text;
            _current.Comunicazione.Cellulare1      = txtcell1.Text;
            _current.Comunicazione.Cellulare2      = txtCell2.Text;
            _current.Comunicazione.Mail            = txtMail.Text;

            _current.Note = txtNote.Text;


            _current.Marca      = txtMarca.Text;
            _current.Matricola  = txtMatricola.Text;
            _current.Modello    = txtModello.Text;
            _current.IsAbbonato = chkAbbonato.Checked;



            CustomerHandler h = new CustomerHandler();

            h.SaveOrUpdate(_current);
        }