public static IList <YouCom.DTO.ListaNegraDTO> getListadoListaNegra() { IList <YouCom.DTO.ListaNegraDTO> IListaNegra = new List <YouCom.DTO.ListaNegraDTO>(); DataTable pobjDataTable = new DataTable(); if (YouCom.DAL.ListaNegraDAL.getListadoListaNegra(ref pobjDataTable)) { foreach (DataRow wobjDataRow in pobjDataTable.Rows) { YouCom.DTO.ListaNegraDTO lista = new YouCom.DTO.ListaNegraDTO(); lista.IdListaNegra = decimal.Parse(wobjDataRow["idListaNegra"].ToString()); lista.IdFamilia = decimal.Parse(wobjDataRow["idFamilia"].ToString()); lista.IdCondominio = decimal.Parse(wobjDataRow["idCondominio"].ToString()); lista.RutListaNegra = wobjDataRow["rutListaNegra"].ToString(); lista.NombreListaNegra = wobjDataRow["nombreListaNegra"].ToString(); lista.ApellidoListaNegra = wobjDataRow["apellidoListaNegra"].ToString(); lista.MotivoListaNegra = wobjDataRow["motivoListaNegra"].ToString(); lista.UsuarioIngreso = wobjDataRow["usuario_ingreso"].ToString(); lista.FechaIngreso = wobjDataRow["fecha_ingreso"].ToString(); lista.UsuarioModificacion = wobjDataRow["usuario_modificacion"].ToString(); lista.FechaModificacion = wobjDataRow["fecha_modificacion"].ToString(); lista.Estado = wobjDataRow["estado"].ToString(); IListaNegra.Add(lista); } } return(IListaNegra); }
public static bool ActivaListaNegra(YouCom.DTO.ListaNegraDTO theListaNegraDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); wobjSQLHelper.SetParametro("@usuarioIngreso", SqlDbType.VarChar, 50, theListaNegraDTO.UsuarioModificacion); wobjSQLHelper.SetParametro("@pIdListaNegra", SqlDbType.VarChar, 20, theListaNegraDTO.IdListaNegra); try { //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("Activa_ListaNegra", "YouCom")) { case 0: throw new Exception("No se pudo grabar."); case -1: throw new Exception("Hubo un error."); case -2: throw new Exception("Hubo un error."); } //==================================================================================== retorno = true; } catch (Exception eobjException) { throw eobjException; } return(retorno); }
public static bool Update(YouCom.DTO.ListaNegraDTO myListaNegraDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pIdListaNegra", SqlDbType.Decimal, -1, myListaNegraDTO.IdListaNegra); wobjSQLHelper.SetParametro("@pIdFamilia", SqlDbType.Decimal, -1, myListaNegraDTO.TheFamiliaDTO.IdFamilia); wobjSQLHelper.SetParametro("@pIdCondominio", SqlDbType.Decimal, -1, myListaNegraDTO.TheCondominioDTO.IdCondominio); wobjSQLHelper.SetParametro("@pIdComunidad", SqlDbType.Decimal, -1, myListaNegraDTO.TheComunidadDTO.IdComunidad); wobjSQLHelper.SetParametro("@pRutListaNegra", SqlDbType.VarChar, 200, myListaNegraDTO.RutListaNegra); wobjSQLHelper.SetParametro("@pNombreListaNegra", SqlDbType.VarChar, 200, myListaNegraDTO.NombreListaNegra); wobjSQLHelper.SetParametro("@pApellidoPaternoListaNegra", SqlDbType.VarChar, 20, myListaNegraDTO.ApellidoPaternoListaNegra); wobjSQLHelper.SetParametro("@pApellidoMaternoListaNegra", SqlDbType.VarChar, 20, myListaNegraDTO.ApellidoMaternoListaNegra); wobjSQLHelper.SetParametro("@pMotivoListaNegra", SqlDbType.VarChar, 20, myListaNegraDTO.MotivoListaNegra); wobjSQLHelper.SetParametro("@pUsuarioModificacion", SqlDbType.VarChar, 20, myListaNegraDTO.UsuarioModificacion); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("UPD_ListaNegra", "YouCom")) { case 0: throw new Exception("No se pudo grabar."); case -1: throw new Exception("Hubo un error."); case -2: throw new Exception("Hubo un error."); } //==================================================================================== retorno = true; } #region Catch catch (Exception eobjException) { throw eobjException; } #endregion return(retorno); }
public static bool ValidaEliminacionListaNegra(YouCom.DTO.ListaNegraDTO theListaNegraDTO) { DataTable pobjDataTable = new DataTable(); List <YouCom.DTO.ListaNegraDTO> collCasa = new List <YouCom.DTO.ListaNegraDTO>(); bool retorno = false; if (YouCom.DAL.ListaNegraDAL.ValidaEliminacionListaNegra(theListaNegraDTO, ref pobjDataTable)) { foreach (DataRow wobjDataRow in pobjDataTable.Rows) { retorno = true; } } return(retorno); }
public static bool Delete(YouCom.DTO.ListaNegraDTO myListaNegraDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pIdListaNegra", SqlDbType.Decimal, -1, myListaNegraDTO.IdListaNegra); wobjSQLHelper.SetParametro("@pUsuarioModificacion", SqlDbType.VarChar, 20, myListaNegraDTO.UsuarioModificacion); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("DEL_ListaNegra", "YouCom")) { case 0: throw new Exception("No se pudo grabar."); case -1: throw new Exception("Hubo un error."); case -2: throw new Exception("Hubo un error."); } //==================================================================================== retorno = true; } #region Catch catch (Exception eobjException) { throw eobjException; } #endregion return(retorno); }