Esempio n. 1
0
 // Definisco i costruttori
 public Lavoratore(string nome, string cognome, int età, Sesso genere)
 {
     Nome    = nome;
     Cognome = cognome;
     Età     = età;
     Genere  = genere;
 }
Esempio n. 2
0
 public IActionResult Sesso_Delete(Sesso sesso)
 {
     if (sesso != null)
     {
         return(View("ConfirmDelete_Sesso", sesso));
     }
     return(View("Sesso"));
 }
Esempio n. 3
0
 //Costruttore della classe LAVORATORE;
 public Lavoratore(string nome, string cognome, Sesso genere, float stipendio, int anniAnzianità)
 {
     this.Nome          = nome;
     this.Cognome       = cognome;
     this.Genere        = genere;
     this.Stipendio     = stipendio;
     this.AnniAnzianità = anniAnzianità;
 }
Esempio n. 4
0
 public Persona(string nome, string cognome, int età, Sesso genere, DateTime dataDiNascita)
 {
     Nome          = nome;
     Cognome       = cognome;
     Età           = età;
     Genere        = genere;
     DataDiNascita = dataDiNascita;
 }
Esempio n. 5
0
 public IActionResult Sesso_ConfirmDelete(Sesso sesso)
 {
     if (sesso != null)
     {
         _context.Sessi.Remove(sesso);
         _context.SaveChanges();
         return(RedirectToAction("Sesso"));
     }
     return(View("Sesso"));
 }
Esempio n. 6
0
 public IActionResult Sesso_Edit(Sesso sesso)
 {
     if (ModelState.IsValid)
     {
         _context.Sessi.Update(sesso);
         _context.SaveChanges();
         return(RedirectToAction("Sesso"));
     }
     else
     {
         return(View(sesso));
     }
 }
 public Utente(string username, string nome, string cognome, DateTime dataDiNascita, int pesoInKg, int altezzaInCm, Sesso sesso)
 {
     if (String.IsNullOrEmpty(nome) || String.IsNullOrEmpty(cognome) || dataDiNascita == null || pesoInKg <= 0 || altezzaInCm <= 0 || String.IsNullOrEmpty(username))
     {
         throw new ArgumentException();
     }
     _username      = username;
     _nome          = nome;
     _cognome       = cognome;
     _dataDiNascita = dataDiNascita;
     _pesoInKg      = pesoInKg;
     _altezzaInCm   = altezzaInCm;
     _sesso         = sesso;
 }
        private void SaveUtente(object sender, EventArgs e)
        {
            if (!_creaAccountView.isCompleted() || !_creaAccountView.CheckPassword())
            {
                return;
            }
            try
            {
                if (_mpm.CheckUsername(_creaAccountView.textBoxUsername.Text))
                {
                    MessageBox.Show("Username già presente");
                    return;
                }
                Sesso sesso = _creaAccountView.RadioButtonFemmina.Checked ? Sesso.Femmina : Sesso.Maschio;
                _utente = new Utente(_creaAccountView.textBoxUsername.Text, _creaAccountView.TextBoxNome.Text, _creaAccountView.TextBoxCognome.Text,
                                     new DateTime(int.Parse(_creaAccountView.comboBoxAnno.Text), int.Parse(_creaAccountView.comboBoxMese.Text),
                                                  int.Parse(_creaAccountView.comboBoxGiorno.Text)), (int)_creaAccountView.numericUpDownPeso.Value,
                                     (int)_creaAccountView.numericUpDownAltezza.Value, sesso);

                //inseriamo l'utente nel DB
                _mpm.SaveUtente(_utente, _creaAccountView.CreaPassword.Text);

                if (_creaAccountView.checkBoxAutomatica.Checked)
                {
                    UserControl view = (CreaSchedaAutomaticaView)ViewFactory.GetView("CreaSchedaAutomaticaView");
                    CreaSchedaAutomaticaPresenter.GetInstance().Utente = _utente;
                    _mainForm.SetView(view);
                }
                else
                {
                    SetUtente();
                    CreaSchedaManualeView view = (CreaSchedaManualeView)ViewFactory.GetView("CreaSchedaManualeView");
                    view.buttonIndietro.Visible = false;
                    view.buttonIndietro.Enabled = false;
                    _mainForm.SetView(view);
                }
            }
            catch (SqlException)
            {
                MessageBox.Show("Errore nel database: verificare la procedura d'installazione", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Application.Exit();
            }
        }
Esempio n. 9
0
        private void _garaTreeView_AfterSelect(object sender, TreeViewEventArgs e)
        {
            if (e.Node.Tag is Sesso)
            {
                return;
            }

            Disciplina disciplinaSelected = ((Disciplina)e.Node.Tag);

            _selectedSpecialitàGara = Gara.GetInstance().GetSpecialitàGaraForDisciplina(disciplinaSelected);
            _selectedSesso          = (Sesso)e.Node.Parent.Tag;

            if (disciplinaSelected.Equals(Disciplina.STA))
            {
                _misurazioneLabel.Text = "MISURAZIONE (secondi)";
            }
            else
            {
                _misurazioneLabel.Text = "MISURAZIONE (metri)";
            }
        }
Esempio n. 10
0
            public void LoadSocietàAtleti()
            {
                Gara g = Gara.GetInstance();

                XmlElement societàElement = (XmlElement)_xmlDocument.SelectSingleNode("SocietàAtleti/SocietàList");

                foreach (XmlNode societàNode in societàElement.ChildNodes)
                {
                    XmlAttributeCollection ac = societàNode.Attributes;
                    g.AddSocietà(new Società(societàNode.Attributes["p3:nomeSocietà"].Value, societàNode.Attributes["p3:sedeSocietà"].Value, new Guid(societàNode.Attributes["p3:idSocietà"].Value)));
                }

                XmlElement atletiElement = (XmlElement)_xmlDocument.SelectSingleNode("SocietàAtleti/AtletiList");

                foreach (XmlNode atletaNode in atletiElement.ChildNodes)
                {
                    Sesso sesso = Sesso.MASCHIO;
                    if (atletaNode.Attributes["p3:sesso"].Value.Equals("FEMMINA"))
                    {
                        sesso = Sesso.FEMMINA;
                    }

                    g.AddAtleta(new Atleta(
                                    atletaNode.Attributes["p3:nomeAtleta"].Value,
                                    atletaNode.Attributes["p3:cognomeAtleta"].Value,
                                    atletaNode.Attributes["p3:cfAtleta"].Value,
                                    sesso,
                                    Convert.ToDateTime(atletaNode.Attributes["p3:dataDiNascita"].Value),
                                    Convert.ToBoolean(atletaNode.Attributes["p3:istruttore"].Value),
                                    g.GetSocietàForID(new Guid(atletaNode.Attributes["p3:societàDiAppartenenza"].Value)),
                                    Convert.ToDateTime(atletaNode.Attributes["p3:scadenzaCertificato"].Value),
                                    new Guid(atletaNode.Attributes["p3:idAtleta"].Value
                                             )
                                    ));
                }
            }
Esempio n. 11
0
        public IActionResult Sesso_Delete(int id)
        {
            Sesso sesso = _context.Sessi.Where(x => x.idSesso == id).FirstOrDefault();

            return(View(sesso));
        }
Esempio n. 12
0
 public LavoratoriAutonomi(string nome, string cognome, int età, Sesso genere)
     : base(nome, cognome, età, genere)
 {
     BilancioMedio = BilancioMedio;
     AnniAttivita  = AnniAttivita;
 }
Esempio n. 13
0
 public LavoratoriAutonomi(string nome, string cognome, Sesso genere, DateTime dataDiNascita,
                           int stipendioMensile) : base(nome, cognome, genere, dataDiNascita, stipendioMensile)
 {
 }
Esempio n. 14
0
 public Persona(string Nome, string Cognome, string Nazione, DateTime DataNascita, Sesso MioSesso, TipoDocumento MioDocumento, string NumeroDocumento, string CodicePersona)
 {
     this.Nome            = Nome;
     this.Cognome         = Cognome;
     this.Nazione         = Nazione;
     this.DataNascita     = DataNascita;
     this.MioSesso        = MioSesso;
     this.MioDocumento    = MioDocumento;
     this.NumeroDocumento = NumeroDocumento;
     this.CodicePersona   = CodicePersona;
 }
Esempio n. 15
0
 //definisco un costruttore
 public LavoratoriDipendenti(string nome, string cognome, int età, Sesso genere)
     : base(nome, cognome, età, genere)
 {
     Stipendio      = Stipendio;
     AnniAssunzione = AnniAssunzione;
 }
Esempio n. 16
0
 public UtenteAutomatico(string username, string nome, string cognome, DateTime dataDiNascita, int pesoInKg, int altezzaInCm, Sesso sesso, Risorsa risorse, int numeroGiorniAllenamento, TipoAllenamento tipo) : base(username, nome, cognome, dataDiNascita, pesoInKg, altezzaInCm, sesso)
 {
     if (numeroGiorniAllenamento < 0 || numeroGiorniAllenamento > 7)
     {
         throw new ArgumentException();
     }
     _risorse = risorse;
     _numeroGiorniAllenamento = numeroGiorniAllenamento;
     _tipo = tipo;
 }