public AgendamentoInfo ListarPorCodigo(int age_codigo) { List <SqlParameter> lParam = new List <SqlParameter>(); List <AgendamentoInfo> lstAgendamento = new List <AgendamentoInfo>(); StoredProcedure sp = null; SqlDataReader dr = null; try { lParam.Add(new SqlParameter(paramAGE_Codigo, age_codigo)); using (sp = new StoredProcedure(spListarPorCodigo, lParam, ConexoesBanco.PlusCondominios)) { dr = sp.GetDataReader(); NovaInstanciaClasse instancia = new NovaInstanciaClasse(); if (dr.Read()) { return(instancia.NovaInstancia <AgendamentoInfo>(dr)); } return(null); } } catch (Exception exc) { throw new Exception(exc.Message, exc); } finally { lParam = null; } }
public List <AgendamentoInfo> ListarTodos() { List <SqlParameter> lParam = new List <SqlParameter>(); List <AgendamentoInfo> lst = new List <AgendamentoInfo>(); StoredProcedure sp = null; SqlDataReader dr = null; try { using (sp = new StoredProcedure(spListarTodos, lParam, ConexoesBanco.PlusCondominios)) { dr = sp.GetDataReader(); while (dr.Read()) { NovaInstanciaClasse instancia = new NovaInstanciaClasse(); lst.Add(instancia.NovaInstancia <AgendamentoInfo>(dr)); instancia = null; } } } catch (Exception exc) { throw new Exception(exc.Message, exc); } finally { lParam = null; } return(lst); }
public UsuarioInfo AutenticaUsuario(string usu_login, string usu_senha) { List <SqlParameter> lParam = new List <SqlParameter>(); List <UsuarioInfo> lstUsuario = new List <UsuarioInfo>(); StoredProcedure sp = null; SqlDataReader dr = null; try { lParam.Add(new SqlParameter(paramUSU_Login, usu_login)); lParam.Add(new SqlParameter(paramUSU_Senha, usu_senha)); using (sp = new StoredProcedure(spAutenticaUsuario, lParam, ConexoesBanco.PlusCondominios)) { dr = sp.GetDataReader(); NovaInstanciaClasse instancia = new NovaInstanciaClasse(); if (dr.Read()) { return(instancia.NovaInstancia <UsuarioInfo>(dr)); } return(null); } } catch (Exception exc) { throw new Exception(exc.Message, exc); } finally { lParam = null; } }
public List <PerfilInfo> ListarPerfilPorNome(string prf_nome) { List <SqlParameter> lParam = new List <SqlParameter>(); List <PerfilInfo> lst = new List <PerfilInfo>(); StoredProcedure sp = null; SqlDataReader dr = null; try { lParam.Add(new SqlParameter(paramPRF_Nome, prf_nome)); using (sp = new StoredProcedure(spListarPerfilPorNome, lParam, ConexoesBanco.PlusCondominios)) { dr = sp.GetDataReader(); while (dr.Read()) { NovaInstanciaClasse instancia = new NovaInstanciaClasse(); lst.Add(instancia.NovaInstancia <PerfilInfo>(dr)); instancia = null; } } } catch (Exception exc) { throw new Exception(exc.Message, exc); } finally { lParam = null; } return(lst); }
public List <ProprietarioInfo> ListarPorParametro(ProprietarioInfo proprietarioInfo) { List <SqlParameter> lParam = new List <SqlParameter>(); List <ProprietarioInfo> lst = new List <ProprietarioInfo>(); StoredProcedure sp = null; SqlDataReader dr = null; try { lParam.Add(new SqlParameter(paramPRT_Codigo, proprietarioInfo.PRT_Codigo)); lParam.Add(new SqlParameter(paramPRT_Cpf, proprietarioInfo.PRT_Cpf)); lParam.Add(new SqlParameter(paramPRT_Rg, proprietarioInfo.PRT_Rg)); lParam.Add(new SqlParameter(paramPRT_Nome, proprietarioInfo.PRT_Nome)); using (sp = new StoredProcedure(spListarPorParametro, lParam, ConexoesBanco.PlusCondominios)) { dr = sp.GetDataReader(); while (dr.Read()) { NovaInstanciaClasse instancia = new NovaInstanciaClasse(); lst.Add(instancia.NovaInstancia <ProprietarioInfo>(dr)); instancia = null; } } } catch (Exception exc) { throw new Exception(exc.Message, exc); } finally { lParam = null; } return(lst); }