public void AtribuirEstrutura(EstruturaEventoEntregaControle estEC) { this.Control.ID = estEC.ID; this.EventoID.Valor = estEC.EventoID; this.EntregaControleID.Valor = estEC.EntregaControleID; this.ProcedimentoEntrega.Valor = estEC.ProcedimentoEntrega; this.DiasTriagem.Valor = estEC.DiasTriagem; }
public List <EstruturaEventoEntregaControle> Carregar(List <int> eventoIDs, int controleID) { try { List <EstruturaEventoEntregaControle> retorno = new List <EstruturaEventoEntregaControle>(); EstruturaEventoEntregaControle eEECAux = new EstruturaEventoEntregaControle(); string sql = @"SELECT tEventoEntregaControle.ID, tEventoEntregaControle.EventoID, tEventoEntregaControle.EntregaControleID, tEventoEntregaControle.DiasTriagem, CASE WHEN LEN(tEventoEntregaControle.ProcedimentoEntrega) > 0 THEN tEventoEntregaControle.ProcedimentoEntrega ELSE CASE WHEN LEN(tEntregaControle.ProcedimentoEntrega) > 0 THEN tEntregaControle.ProcedimentoEntrega ELSE tEntrega.ProcedimentoEntrega END END AS ProcedimentoEntrega FROM tEventoEntregaControle INNER JOIN tEntregaControle ON tEntregaControle.ID = tEventoEntregaControle.EntregaControleID INNER JOIN tEntrega ON tEntrega.ID = tEntregaControle.EntregaID WHERE EventoID IN (" + Utilitario.ArrayToString(eventoIDs.ToArray()) + ") and EntregaControleID = " + controleID; bd.Consulta(sql); if (bd.Consulta().Read()) { eEECAux.ID = bd.LerInt("ID"); eEECAux.EventoID = bd.LerInt("EventoID"); eEECAux.EntregaControleID = bd.LerInt("EntregaControleID"); eEECAux.ProcedimentoEntrega = bd.LerString("ProcedimentoEntrega"); eEECAux.DiasTriagem = bd.LerInt("DiasTriagem"); retorno.Add(eEECAux); } bd.Fechar(); return(retorno); } catch (Exception ex) { throw ex; } }
public EstruturaEventoEntregaControle Carregar(int eventoID, int controleID) { try { EstruturaEventoEntregaControle eEECAux = new EstruturaEventoEntregaControle(); string sql = @"SELECT tEventoEntregaControle.ID, tEventoEntregaControle.EventoID, tEventoEntregaControle.EntregaControleID, tEventoEntregaControle.DiasTriagem, CASE WHEN LEN(tEventoEntregaControle.ProcedimentoEntrega) > 0 THEN tEventoEntregaControle.ProcedimentoEntrega ELSE CASE WHEN LEN(tEntregaControle.ProcedimentoEntrega) > 0 THEN tEntregaControle.ProcedimentoEntrega ELSE tEntrega.ProcedimentoEntrega END END AS ProcedimentoEntrega FROM tEventoEntregaControle INNER JOIN tEntregaControle ON tEntregaControle.ID = tEventoEntregaControle.EntregaControleID INNER JOIN tEntrega ON tEntrega.ID = tEntregaControle.EntregaID WHERE EventoID = " + eventoID + " and EntregaControleID = " + controleID; bd.Consulta(sql); if (bd.Consulta().Read()) { eEECAux.ID = bd.LerInt("ID"); eEECAux.EventoID = bd.LerInt("EventoID"); eEECAux.EntregaControleID = bd.LerInt("EntregaControleID"); eEECAux.ProcedimentoEntrega = bd.LerString("ProcedimentoEntrega"); eEECAux.DiasTriagem = bd.LerInt("DiasTriagem"); } bd.Fechar(); return(eEECAux); } catch (Exception ex) { throw ex; } }