public static JogoVO Proximo(int atual) { string sql = "select top 1 * from jogos where id > @atual order by id"; var parametros = new SqlParameter[] { new SqlParameter("atual", atual) }; DataTable tabela = Metodos.ExecutaSelect(sql, parametros); if (tabela.Rows.Count == 0) { return(null); } else { return(MontaVO(tabela.Rows[0])); } }
public override void InsereOuAltera(PadraoVO o) { string sql = "sp_IncluiOuAltera" + ProcedureName(); ServDetalheDAO detalheDAO = new ServDetalheDAO(); using (var transacao = new TransactionScope()) { Metodos.ExecutaSQL(sql, CriaParametros(o)); int idAten = Convert.ToInt32(ProximoId()) - 1; foreach (ServDetalheVO detalheVO in (o as AtendimentoVO).servDetalhes) { detalheVO.CodAten = idAten; detalheDAO.InsereOuAltera(detalheVO); } o.Id = idAten; Metodos.ExecutaSQL(sql, CriaParametros(o)); transacao.Complete(); } }
public override void InsereOuAltera(PadraoVO o) { string sql = "sp_Inclui" + ProcedureName(); Metodos.ExecutaSQL(sql, CriaParametros(o)); }
public virtual DataTable Pesquisa(PadraoVO o) { string sql = "sp_Pesquisa" + ProcedureName(); return(Metodos.ExecutaSelect(sql, CriaParametros(o))); }