Beispiel #1
0
        /// <summary>
        /// Inseri novo(a) EventoEntregaControle na lista
        /// </summary>
        /// <returns></returns>
        public override bool Inserir()
        {
            try
            {
                bool ok = eventoEntregaControle.Inserir();
                if (ok)
                {
                    lista.Add(eventoEntregaControle.Control.ID);
                    Indice = lista.Count - 1;
                }

                return(ok);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #2
0
        public void HabilitarPeriodoAreas(int EventoID, int EntregaID)
        {
            try
            {
                EventoEntregaControle oEEC = new EventoEntregaControle();
                List <int>            ListaEntregaControleID = new List <int>();

                string sql = @"SELECT c.ID FROM  tEntregaControle c
                        LEFT JOIN tEventoEntregaControle e ON c.ID = e.EntregaControleID and e.EventoID = " + EventoID + @" 
                        WHERE c.Ativa = 'T' and c.EntregaID = " + EntregaID + " and e.ID is null";

                bd.Consulta(sql);

                while (bd.Consulta().Read())
                {
                    ListaEntregaControleID.Add(bd.LerInt("ID"));
                }

                bd.Fechar();

                foreach (int EntregaControleID in ListaEntregaControleID)
                {
                    oEEC.Limpar();
                    oEEC.EventoID.Valor            = EventoID;
                    oEEC.EntregaControleID.Valor   = EntregaControleID;
                    oEEC.ProcedimentoEntrega.Valor = "";
                    oEEC.DiasTriagem.Valor         = 0;
                    oEEC.Inserir();
                }
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                bd.Fechar();
            }
        }