Пример #1
0
        public string ConfermaVotazione(int idOrdineGiorno, DateTime dataVotazione, Dictionary<int, Voto> voti, int convocazione)
        {
            try
            {
                var message = string.Empty;

                var ordineGiorno = _daoFactory.GetOrdineGiornoAssembleaDao().Find(idOrdineGiorno, false);

                if (ordineGiorno != null)
                {
                    foreach (var kvp in voti)
                    {
                        if (kvp.Value.IdVotante > 0)
                        {
                            var votazione = _daoFactory.GetVotazioneAssembleaDao().GetById(kvp.Value.IdVotante, false);
                            votazione.Risultato = kvp.Value.Risultato;
                            votazione.DataVotazione = dataVotazione;
                        }
                        else
                        {
                            var votazione = new VotazioneAssemblea(ordineGiorno, _daoFactory.GetConvocazioneAssembleaDao().GetById(kvp.Key, false), dataVotazione, kvp.Value.Risultato, convocazione) {AbilitatoAlVoto = true};
                            _daoFactory.GetVotazioneAssembleaDao().SaveOrUpdate(votazione);
                        }
                    }
                }
                else
                {
                    message = "Attenzione l'ordine del giorno è stato eliminato";
                }
                return message;
            }
            catch (Exception ex)
            {
                _log.ErrorFormat("Errore nella conferma dei presenti all'appello - {0} - ordineGiorno:{1} - dataVotazione:{2} ", ex, Utility.GetMethodDescription(), idOrdineGiorno, dataVotazione);
                throw;
            }
        }
Пример #2
0
 public virtual IUpdatableBusinessEntity Copy()
 {
     var votazione = new VotazioneAssemblea(OrdineGiorno, Votante, DataVotazione, Risultato, Convocazione);
     return votazione;
 }
Пример #3
0
        public string ConfermaVotanti(int idOrdineGiorno, Dictionary<int, Votante> votanti)
        {
            try
            {
                var message = string.Empty;

                var ordineGiorno = _daoFactory.GetOrdineGiornoAssembleaDao().Find(idOrdineGiorno, false);

                if (ordineGiorno != null)
                {
                    _daoFactory.GetVotazioneAssembleaDao().ExecuteQuery("DeleteAssembleaVotanti", new QueryParam("IdOrdineGiorno", ordineGiorno.ID));

                    foreach (var kvp in votanti)
                    {
                        var votazione = new VotazioneAssemblea(ordineGiorno, _daoFactory.GetConvocazioneAssembleaDao().GetById(kvp.Key, false), kvp.Value.AbilitatoAlVoto, 0);
                        _daoFactory.GetVotazioneAssembleaDao().SaveOrUpdate(votazione);
                        votazione = new VotazioneAssemblea(ordineGiorno, _daoFactory.GetConvocazioneAssembleaDao().GetById(kvp.Key, false), kvp.Value.AbilitatoAlVoto, 1);
                        _daoFactory.GetVotazioneAssembleaDao().SaveOrUpdate(votazione);
                    }
                }
                else
                {
                    message = "Attenzione l'ordine del giorno è stato eliminato";
                } return message;


            }
            catch (Exception ex)
            {
                _log.ErrorFormat("Errore nella conferma dei votanti - {0} - ordineGiorno:{1} ", ex, Utility.GetMethodDescription(), idOrdineGiorno);
                throw;
            }
        }