Exemplo n.º 1
0
        public void setIstruttore(UNFHibernate.Domain.Istruttore i)
        {
            istruttore = i;

            if (istruttore != null)
            {
                textBox1.Text = istruttore.Cognome ?? string.Empty;
                textBox2.Text = istruttore.Nome ?? string.Empty;

                if (istruttore.DataNascita != null)
                {
                    dateTimePicker1.Value = istruttore.DataNascita.Value;
                }
                else
                {
                    Utils.SetPickerValid(dateTimePicker1, false);
                }

                textBox3.Text = istruttore.LuogoNascita ?? string.Empty;

                textBox4.Text = istruttore.Indirizzo ?? string.Empty;
                textBox5.Text = istruttore.Comune ?? string.Empty;
                textBox6.Text = istruttore.CAP ?? string.Empty;
                textBox7.Text = istruttore.Provincia ?? string.Empty;
                textBox8.Text = istruttore.CodiceFiscale ?? string.Empty;

                textBox9.Text  = istruttore.Email ?? string.Empty;
                textBox10.Text = istruttore.NumeroTelefono ?? string.Empty;
                textBox14.Text = istruttore.NumeroCellulare ?? string.Empty;
            }
            else
            {
                Utils.SetPickerValid(dateTimePicker1, false);
            }
        }
Exemplo n.º 2
0
        public void UpdateData()
        {
            if (NeedToCreate)
            {
                istruttore = new UNFHibernate.Domain.Istruttore();
            }

            if (istruttore != null)
            {
                istruttore.Cognome         = textBox1.Text;
                istruttore.Nome            = textBox2.Text;
                istruttore.LuogoNascita    = textBox3.Text;
                istruttore.Indirizzo       = textBox4.Text;
                istruttore.Comune          = textBox5.Text;
                istruttore.CAP             = textBox6.Text;
                istruttore.Provincia       = textBox7.Text;
                istruttore.CodiceFiscale   = textBox8.Text;
                istruttore.Email           = textBox9.Text;
                istruttore.NumeroTelefono  = textBox10.Text;
                istruttore.NumeroCellulare = textBox14.Text;

                if (dateTimePicker1.Format == DateTimePickerFormat.Short)
                {
                    istruttore.DataNascita = dateTimePicker1.Value;
                }
            }
        }
Exemplo n.º 3
0
        public static void Show(MainForm m, UNFHibernate.Domain.Istruttore i)
        {
            ViewIstruttore va = new ViewIstruttore();

            va.setIstruttore(i);
            va.mainform = m;
            va.Show();
        }