public static bool Delete(YouCom.DTO.Mensajeria.EleccionNoticiaDTO myEleccionNoticiaDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pIdNoticia", SqlDbType.Decimal, -1, myEleccionNoticiaDTO.TheNoticiaDTO.NoticiaId); wobjSQLHelper.SetParametro("@pIdFamilia", SqlDbType.Decimal, -1, myEleccionNoticiaDTO.TheFamiliaDTO.IdFamilia); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("DEL_EleccionNoticia", "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 Insert(YouCom.DTO.TipoAvisoDTO myTipoAvisoDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pNombreTipo", SqlDbType.VarChar, 200, myTipoAvisoDTO.NombreTipoAviso); wobjSQLHelper.SetParametro("@pUsuarioIngreso", SqlDbType.VarChar, 20, myTipoAvisoDTO.UsuarioIngreso); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("INS_TipoAviso", "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 Insert(YouCom.DTO.Servicio.ServiciosDTO myServiciosDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); DataTable pobjDataTable = new DataTable(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pIdCondominio", SqlDbType.Decimal, -1, myServiciosDTO.TheCondominioDTO.IdCondominio); wobjSQLHelper.SetParametro("@pIdComunidad", SqlDbType.Decimal, -1, myServiciosDTO.TheComunidadDTO.IdComunidad); wobjSQLHelper.SetParametro("@pNombreServicio", SqlDbType.VarChar, 200, myServiciosDTO.NombreServicio); wobjSQLHelper.SetParametro("@pDescripcionServicio", SqlDbType.Text, -1, myServiciosDTO.DescripcionServicio); wobjSQLHelper.SetParametro("@pIdCategoria", SqlDbType.Decimal, -1, myServiciosDTO.TheCategoriaDTO.IdCategoria); wobjSQLHelper.SetParametro("@pFechaInicio", SqlDbType.DateTime, -1, myServiciosDTO.FechaInicio); wobjSQLHelper.SetParametro("@pFechaTermino", SqlDbType.DateTime, -1, myServiciosDTO.FechaTermino); wobjSQLHelper.SetParametro("@pImagenServicio", SqlDbType.VarChar, 200, myServiciosDTO.ImagenServicio); wobjSQLHelper.SetParametro("@pUsuarioIngreso", SqlDbType.VarChar, 20, myServiciosDTO.UsuarioIngreso); wobjSQLHelper.SetParametroOut("@identity", SqlDbType.BigInt, -1); if (wobjSQLHelper.Ejecutar("INS_Servicio", "YouCom", pobjDataTable) <= 0) { myServiciosDTO.IdServicio = decimal.Parse(wobjSQLHelper.GetParametro("@identity").ToString()); } //==================================================================================== retorno = true; } #region Catch catch (Exception eobjException) { throw eobjException; } #endregion return(retorno); }
public static bool Delete(YouCom.DTO.BannerDTO myBannerDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pBannerId", SqlDbType.Decimal, -1, myBannerDTO.BannerId); wobjSQLHelper.SetParametro("@pUsuarioModificacion", SqlDbType.VarChar, 20, myBannerDTO.UsuarioModificacion); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("DEL_Banner", "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 Insert(YouCom.DTO.ComercioDTO myComercioDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pIdCondominio", SqlDbType.Decimal, -1, myComercioDTO.IdCondominio); wobjSQLHelper.SetParametro("@pIdCategoria", SqlDbType.Decimal, -1, myComercioDTO.IdCategoria); wobjSQLHelper.SetParametro("@pNombreComercio", SqlDbType.VarChar, 500, myComercioDTO.NombreComercio); wobjSQLHelper.SetParametro("@pDireccionComercio", SqlDbType.VarChar, 500, myComercioDTO.DireccionComercio); wobjSQLHelper.SetParametro("@pTelefonoComercio", SqlDbType.VarChar, 20, myComercioDTO.TelefonoComercio); wobjSQLHelper.SetParametro("@pUrlComercio", SqlDbType.VarChar, 200, myComercioDTO.UrlComercio); wobjSQLHelper.SetParametro("@pLogoComercio", SqlDbType.VarChar, 200, !string.IsNullOrEmpty(myComercioDTO.LogoComercio) ? myComercioDTO.LogoComercio : System.Data.SqlTypes.SqlString.Null); wobjSQLHelper.SetParametro("@pUsuarioIngreso", SqlDbType.VarChar, 20, myComercioDTO.UsuarioIngreso); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("INS_Comercio", "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 Update(YouCom.DTO.ParametrosDTO myParametrosDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pIdParametros", SqlDbType.Decimal, -1, myParametrosDTO.IdParametro); wobjSQLHelper.SetParametro("@pConcepto", SqlDbType.VarChar, 200, myParametrosDTO.Concepto); wobjSQLHelper.SetParametro("@pCodigo", SqlDbType.VarChar, 200, myParametrosDTO.Codigo); wobjSQLHelper.SetParametro("@pDescriopcion", SqlDbType.VarChar, 200, myParametrosDTO.Descripcion); wobjSQLHelper.SetParametro("@pDescriopcionCorta", SqlDbType.VarChar, 500, myParametrosDTO.DescripcionCorta); wobjSQLHelper.SetParametro("@pOrden", SqlDbType.Decimal, -1, myParametrosDTO.Orden); wobjSQLHelper.SetParametro("@pEstado", SqlDbType.Char, 1, myParametrosDTO.Estado); wobjSQLHelper.SetParametro("@pUsuarioModificacion", SqlDbType.VarChar, 20, myParametrosDTO.UsuarioModificacion); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("UPD_Parametros", "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 Update(YouCom.DTO.ArchivoDTO myArchivoDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pIdArchivo", SqlDbType.Decimal, -1, myArchivoDTO.ArchivoId); wobjSQLHelper.SetParametro("@pIdCondominio", SqlDbType.Decimal, -1, myArchivoDTO.TheCondominioDTO.IdCondominio); wobjSQLHelper.SetParametro("@pIdComunidad", SqlDbType.Decimal, -1, myArchivoDTO.TheComunidadDTO.IdComunidad); wobjSQLHelper.SetParametro("@pIdCategoria", SqlDbType.Decimal, -1, myArchivoDTO.TheCategoriaDTO.IdCategoria); wobjSQLHelper.SetParametro("@pTituloArchivo", SqlDbType.VarChar, 200, myArchivoDTO.ArchivoTitulo); wobjSQLHelper.SetParametro("@pDescripcionArchivo", SqlDbType.VarChar, 500, myArchivoDTO.ArchivoDescripcion); wobjSQLHelper.SetParametro("@pNombreArchivo", SqlDbType.VarChar, 200, !string.IsNullOrEmpty(myArchivoDTO.ArchivoNombre) ? myArchivoDTO.ArchivoNombre : System.Data.SqlTypes.SqlString.Null); wobjSQLHelper.SetParametro("@pUsuarioModificacion", SqlDbType.VarChar, 20, myArchivoDTO.UsuarioModificacion); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("UPD_Archivo", "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 Insert(YouCom.DTO.ForoComunidadDTO myForoComunidadDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pIdFamilia", SqlDbType.Decimal, -1, myForoComunidadDTO.IdFamilia); wobjSQLHelper.SetParametro("@pTitulo", SqlDbType.VarChar, 200, myForoComunidadDTO.TituloForoComunidad); wobjSQLHelper.SetParametro("@pDescripcion", SqlDbType.VarChar, 200, myForoComunidadDTO.DescripcionForoComunidad); wobjSQLHelper.SetParametro("@pIdTipo", SqlDbType.Decimal, -1, myForoComunidadDTO.IdTipo); wobjSQLHelper.SetParametro("@pIdCategoria", SqlDbType.Decimal, -1, myForoComunidadDTO.IdCategoria); wobjSQLHelper.SetParametro("@pFechaPublicacion", SqlDbType.DateTime, -1, myForoComunidadDTO.FechaPublicacion); wobjSQLHelper.SetParametro("@pFechaTermino", SqlDbType.DateTime, -1, myForoComunidadDTO.FechaTermino); wobjSQLHelper.SetParametro("@pUsuarioIngreso", SqlDbType.VarChar, 20, myForoComunidadDTO.UsuarioIngreso); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("INS_ForoComunidad", "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 Insert(YouCom.DTO.ContactoFamiliaDTO myContactoFamiliaDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pIdCondominio", SqlDbType.Decimal, -1, myContactoFamiliaDTO.TheCondominioDTO.IdCondominio); wobjSQLHelper.SetParametro("@pIdComunidad", SqlDbType.Decimal, -1, myContactoFamiliaDTO.TheComunidadDTO.IdComunidad); wobjSQLHelper.SetParametro("@pIdCasa", SqlDbType.Decimal, -1, myContactoFamiliaDTO.TheCasaDTO.IdCasa); wobjSQLHelper.SetParametro("@pIdParentesco", SqlDbType.Decimal, -1, myContactoFamiliaDTO.TheParentescoDTO.IdParentesco); wobjSQLHelper.SetParametro("@pNombreContactoFamilia", SqlDbType.VarChar, 200, myContactoFamiliaDTO.NombreContacto); wobjSQLHelper.SetParametro("@pTelefonoContactoFamilia", SqlDbType.VarChar, 200, myContactoFamiliaDTO.TelefonoContacto); wobjSQLHelper.SetParametro("@pEmailContactoFamilia", SqlDbType.VarChar, 200, myContactoFamiliaDTO.EmailContacto); wobjSQLHelper.SetParametro("@pUsuarioIngreso", SqlDbType.VarChar, 20, myContactoFamiliaDTO.UsuarioIngreso); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("INS_ContactoFamilia", "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 Insert(YouCom.DTO.Propuesta.VotacionPropuestaDTO myVotacionPropuestaDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pIdCondominio", SqlDbType.Decimal, -1, myVotacionPropuestaDTO.TheCondominioDTO.IdCondominio); wobjSQLHelper.SetParametro("@pIdComunidad", SqlDbType.Decimal, -1, myVotacionPropuestaDTO.TheComunidadDTO.IdComunidad); wobjSQLHelper.SetParametro("@pIdPropuesta", SqlDbType.Decimal, -1, myVotacionPropuestaDTO.ThePropuestaDTO.IdPropuesta); wobjSQLHelper.SetParametro("@pFechaInicioVotacionPropuesta", SqlDbType.DateTime, -1, myVotacionPropuestaDTO.FechaInicioVotacionPropuesta); wobjSQLHelper.SetParametro("@pFechaTerminoVotacionPropuesta", SqlDbType.DateTime, -1, myVotacionPropuestaDTO.FechaTerminoVotacionPropuesta); wobjSQLHelper.SetParametro("@pIdVotacionPropuestaEstado", SqlDbType.Decimal, -1, myVotacionPropuestaDTO.TheVotacionPropuestaEstadoDTO.IdVotacionPropuestaEstado); wobjSQLHelper.SetParametro("@pMotivoEstadoVotacionPropuesta", SqlDbType.Text, -1, myVotacionPropuestaDTO.MotivoEstado); wobjSQLHelper.SetParametro("@pUsuarioIngreso", SqlDbType.VarChar, 20, myVotacionPropuestaDTO.UsuarioIngreso); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("INS_VotacionPropuesta", "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 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.IdFamilia); wobjSQLHelper.SetParametro("@pIdCondominio", SqlDbType.Decimal, -1, myListaNegraDTO.IdCondominio); wobjSQLHelper.SetParametro("@pRutListaNegra", SqlDbType.VarChar, 200, myListaNegraDTO.RutListaNegra); wobjSQLHelper.SetParametro("@pNombreListaNegra", SqlDbType.VarChar, 200, myListaNegraDTO.NombreListaNegra); wobjSQLHelper.SetParametro("@pApellidoListaNegra", SqlDbType.VarChar, 20, myListaNegraDTO.ApellidoListaNegra); 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 Insert(YouCom.DTO.Servicio.RankingServicioDTO myRankingServicioDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pIdEmpresaServicio", SqlDbType.Decimal, -1, myRankingServicioDTO.TheEmpresaServicioDTO.IdEmpresaServicio); wobjSQLHelper.SetParametro("@pIdCondominio", SqlDbType.Decimal, -1, myRankingServicioDTO.TheCondominioDTO.IdCondominio); wobjSQLHelper.SetParametro("@pIdComunidad", SqlDbType.Decimal, -1, myRankingServicioDTO.TheComunidadDTO.IdComunidad); wobjSQLHelper.SetParametro("@pIdFamilia", SqlDbType.Decimal, -1, myRankingServicioDTO.TheFamiliaDTO.IdFamilia); wobjSQLHelper.SetParametro("@pComentario", SqlDbType.Text, -1, !string.IsNullOrEmpty(myRankingServicioDTO.Comentario) ? myRankingServicioDTO.Comentario : System.Data.SqlTypes.SqlString.Null); wobjSQLHelper.SetParametro("@pFechaRanking", SqlDbType.DateTime, -1, myRankingServicioDTO.FechaRanking); wobjSQLHelper.SetParametro("@pNota", SqlDbType.Int, -1, myRankingServicioDTO.Nota); wobjSQLHelper.SetParametro("@pUsuarioIngreso", SqlDbType.VarChar, 20, myRankingServicioDTO.UsuarioIngreso); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("INS_RankingServicio", "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 UpdateRegion(RegionDTO theRegionDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); wobjSQLHelper.SetParametro("@usuarioIngreso", SqlDbType.VarChar, 20, theRegionDTO.UsuarioIngreso); wobjSQLHelper.SetParametro("@Descripcion", SqlDbType.VarChar, 20, theRegionDTO.Descripcion); wobjSQLHelper.SetParametro("@IdRegion", SqlDbType.VarChar, 20, theRegionDTO.IdRegion); wobjSQLHelper.SetParametro("@idPais", SqlDbType.VarChar, 20, theRegionDTO.IdPais); try { //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("UDP_Region", "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.ServiciosDTO myServiciosDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //==================================================================================== wobjSQLHelper.SetParametro("@pIdServicio", SqlDbType.Decimal, -1, myServiciosDTO.IdServicio); wobjSQLHelper.SetParametro("@pIdRespServicio", SqlDbType.Decimal, -1, myServiciosDTO.IdRespServicio); wobjSQLHelper.SetParametro("@pNombreServicio", SqlDbType.VarChar, 200, myServiciosDTO.NombreServicio); wobjSQLHelper.SetParametro("@pDescripcionServicio", SqlDbType.Text, -1, myServiciosDTO.DescripcionServicio); wobjSQLHelper.SetParametro("@pIdCategoria", SqlDbType.Decimal, -1, myServiciosDTO.IdCategoria); wobjSQLHelper.SetParametro("@pFechaInicio", SqlDbType.DateTime, -1, myServiciosDTO.FechaInicio); wobjSQLHelper.SetParametro("@pFechaTermino", SqlDbType.DateTime, -1, myServiciosDTO.FechaTermino); wobjSQLHelper.SetParametro("@pUsuarioModificacion", SqlDbType.VarChar, 20, myServiciosDTO.UsuarioModificacion); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("UPD_Servicio", "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 Update(YouCom.DTO.CategoriaDTO myCategoriaDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pIdCategoria", SqlDbType.Decimal, -1, myCategoriaDTO.IdCategoria); wobjSQLHelper.SetParametro("@pNombreCategoria", SqlDbType.VarChar, 20, myCategoriaDTO.NombreCategoria); wobjSQLHelper.SetParametro("@pDescripcionCategoria", SqlDbType.Text, -1, myCategoriaDTO.DescripcionCategoria); wobjSQLHelper.SetParametro("@pIdTipoCategoria", SqlDbType.Decimal, -1, myCategoriaDTO.TheTipoCategoriaDTO.IdTipoCategoria); wobjSQLHelper.SetParametro("@pUsuarioModificacion", SqlDbType.VarChar, 20, myCategoriaDTO.UsuarioModificacion); wobjSQLHelper.SetParametro("@pIdCondominio", SqlDbType.Decimal, -1, myCategoriaDTO.TheCondominioDTO.IdCondominio); wobjSQLHelper.SetParametro("@pIdComunidad", SqlDbType.Decimal, -1, myCategoriaDTO.TheComunidadDTO.IdComunidad); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("UPD_Categoria", "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 Update(YouCom.DTO.ContenidoDTO myContenidoDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pContenidoId", SqlDbType.Decimal, -1, myContenidoDTO.ContenidoId); wobjSQLHelper.SetParametro("@pContenidoTitulo", SqlDbType.VarChar, 200, myContenidoDTO.ContenidoTitulo); wobjSQLHelper.SetParametro("@pContenidoResumen", SqlDbType.VarChar, 200, myContenidoDTO.ContenidoResumen); wobjSQLHelper.SetParametro("@pContenidoBanner", SqlDbType.VarChar, 200, myContenidoDTO.ContenidoBanner); wobjSQLHelper.SetParametro("@pContenidoImagen", SqlDbType.VarChar, 200, myContenidoDTO.ContenidoImagen); wobjSQLHelper.SetParametro("@pContenidoDetalle", SqlDbType.Text, -1, myContenidoDTO.ContenidoDetalle); wobjSQLHelper.SetParametro("@pUsuarioModificacion", SqlDbType.VarChar, 20, myContenidoDTO.UsuarioModificacion); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("UPD_Contenido", "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 Delete(YouCom.DTO.Propuesta.VotacionPropuestaRespuestaDTO theVotacionPropuestaRespuestaDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pIdVotacionPropuestaRespuesta", SqlDbType.Decimal, -1, theVotacionPropuestaRespuestaDTO.TheVotacionPropuestaDTO.IdVotacionPropuesta); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("DEL_VotacionPropuestaRespuesta", "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 Delete(YouCom.DTO.Seguridad.PermisoDTO myPermisoDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@usuario", SqlDbType.Decimal, -1, myPermisoDTO.Usuario); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("DEL_Permisos", "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 UpdateFuncion(FuncionDTO theFuncionDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); wobjSQLHelper.SetParametro("@usuarioIngreso", SqlDbType.VarChar, 20, theFuncionDTO.UsuarioIngreso); wobjSQLHelper.SetParametro("@FuncionNombre", SqlDbType.VarChar, 20, theFuncionDTO.FuncionNombre); wobjSQLHelper.SetParametro("@FuncionCod", SqlDbType.VarChar, 20, theFuncionDTO.FuncionCod); wobjSQLHelper.SetParametro("@funcionTipoCod", SqlDbType.VarChar, 20, theFuncionDTO.FuncionTipoCod); wobjSQLHelper.SetParametro("@funcionGrpCod", SqlDbType.VarChar, 20, theFuncionDTO.FuncionGrupoCod); wobjSQLHelper.SetParametro("@url", SqlDbType.VarChar, 20, theFuncionDTO.Url); wobjSQLHelper.SetParametro("@funcionalidadNegocio", SqlDbType.VarChar, 20, theFuncionDTO.FuncionalidadNegocio); wobjSQLHelper.SetParametro("@envioCorreo", SqlDbType.VarChar, 20, theFuncionDTO.EnviaCorreo); try { //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("UDP_Funcion", "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.MensajePorteriaDTO myMensajePorteriaDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pIdMensajePorteria", SqlDbType.Decimal, -1, myMensajePorteriaDTO.IdMensajePorteria); wobjSQLHelper.SetParametro("@pIdFamilia", SqlDbType.Decimal, -1, myMensajePorteriaDTO.IdFamilia); wobjSQLHelper.SetParametro("@pIdPortero", SqlDbType.Decimal, -1, myMensajePorteriaDTO.IdPortero); wobjSQLHelper.SetParametro("@pFechaMensaje", SqlDbType.DateTime, -1, myMensajePorteriaDTO.FechaMensaje); wobjSQLHelper.SetParametro("@pDescripcionMensaje", SqlDbType.Text, -1, myMensajePorteriaDTO.DescripcionMensaje); wobjSQLHelper.SetParametro("@pUsuarioModificacion", SqlDbType.VarChar, 20, myMensajePorteriaDTO.UsuarioModificacion); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("UPD_MensajePorteria", "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 Insert(YouCom.DTO.ComentarioAvisoDTO myComentarioAvisoDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pIdAviso", SqlDbType.Decimal, -1, myComentarioAvisoDTO.IdAviso); wobjSQLHelper.SetParametro("@pIdFamilia", SqlDbType.Decimal, -1, myComentarioAvisoDTO.IdFamilia); wobjSQLHelper.SetParametro("@pEmailComentarioAviso", SqlDbType.VarChar, 200, myComentarioAvisoDTO.EmailComentarioAviso); wobjSQLHelper.SetParametro("@pComentarioAviso", SqlDbType.Text, -1, myComentarioAvisoDTO.ComentarioAviso); wobjSQLHelper.SetParametro("@pFechaComentarioAviso", SqlDbType.DateTime, -1, myComentarioAvisoDTO.FechaComentarioAviso); wobjSQLHelper.SetParametro("@pUsuarioIngreso", SqlDbType.VarChar, 20, myComentarioAvisoDTO.UsuarioIngreso); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("INS_ComentarioAviso", "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 Insert(YouCom.DTO.HorarioTurnoDTO myHorarioTurnoDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pIdPeriodo", SqlDbType.Decimal, -1, myHorarioTurnoDTO.ThePeriodoHorarioDTO.IdPeriodoHorario); wobjSQLHelper.SetParametro("@pIdCondominio", SqlDbType.Decimal, -1, myHorarioTurnoDTO.TheCondominioDTO.IdCondominio); wobjSQLHelper.SetParametro("@pIdComunidad", SqlDbType.Decimal, -1, myHorarioTurnoDTO.TheComunidadDTO.IdComunidad); wobjSQLHelper.SetParametro("@pHoraInicio", SqlDbType.VarChar, 10, myHorarioTurnoDTO.HoraInicio); wobjSQLHelper.SetParametro("@pHoraTermino", SqlDbType.VarChar, 10, myHorarioTurnoDTO.HoraTermino); wobjSQLHelper.SetParametro("@pUsuarioIngreso", SqlDbType.VarChar, 20, myHorarioTurnoDTO.UsuarioIngreso); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("INS_HorarioTurno", "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 Insert(YouCom.DTO.Servicio.EmpresaServicioDTO myEmpresaServicioDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pIdCondominio", SqlDbType.Decimal, -1, myEmpresaServicioDTO.TheCondominioDTO.IdCondominio); wobjSQLHelper.SetParametro("@pIdComunidad", SqlDbType.Decimal, -1, myEmpresaServicioDTO.TheComunidadDTO.IdComunidad); wobjSQLHelper.SetParametro("@pIdServicio", SqlDbType.Decimal, -1, myEmpresaServicioDTO.TheServiciosDTO.IdServicio); wobjSQLHelper.SetParametro("@pIdGiro", SqlDbType.Decimal, -1, myEmpresaServicioDTO.TheGiroDTO.IdGiro); wobjSQLHelper.SetParametro("@pRazonSocialEmpresaServicio", SqlDbType.VarChar, 300, myEmpresaServicioDTO.RazonSocialEmpresaServicio); wobjSQLHelper.SetParametro("@pRutEmpresaServicio", SqlDbType.VarChar, 20, myEmpresaServicioDTO.RutEmpresaServicio); wobjSQLHelper.SetParametro("@pDireccionEmpresaServicio", SqlDbType.VarChar, 500, myEmpresaServicioDTO.DireccionEmpresaServicio); wobjSQLHelper.SetParametro("@pIdPais", SqlDbType.Decimal, -1, myEmpresaServicioDTO.TheComunaDTO.TheCiudadDTO.TheRegionDTO.ThePaisDTO.IdPais); wobjSQLHelper.SetParametro("@pIdRegion", SqlDbType.Decimal, -1, myEmpresaServicioDTO.TheComunaDTO.TheCiudadDTO.TheRegionDTO.IdRegion); wobjSQLHelper.SetParametro("@pIdCiudad", SqlDbType.Decimal, -1, myEmpresaServicioDTO.TheComunaDTO.TheCiudadDTO.IdCiudad); wobjSQLHelper.SetParametro("@pIdComuna", SqlDbType.Decimal, -1, myEmpresaServicioDTO.TheComunaDTO.IdComuna); wobjSQLHelper.SetParametro("@pTelefonoEmpresaServicio", SqlDbType.VarChar, 20, myEmpresaServicioDTO.TelefonoEmpresaServicio); wobjSQLHelper.SetParametro("@pCelularEmpresaServicio", SqlDbType.VarChar, 20, myEmpresaServicioDTO.CelularEmpresaServicio); wobjSQLHelper.SetParametro("@pEmailEmpresaServicio", SqlDbType.VarChar, 300, myEmpresaServicioDTO.EmailEmpresaServicio); wobjSQLHelper.SetParametro("@pUrlEmpresaServicio", SqlDbType.VarChar, 200, myEmpresaServicioDTO.UrlEmpresaServicio); wobjSQLHelper.SetParametro("@pLogoEmpresaServicio", SqlDbType.VarChar, 200, !string.IsNullOrEmpty(myEmpresaServicioDTO.LogoEmpresaServicio) ? myEmpresaServicioDTO.LogoEmpresaServicio : System.Data.SqlTypes.SqlString.Null); wobjSQLHelper.SetParametro("@pUsuarioIngreso", SqlDbType.VarChar, 20, myEmpresaServicioDTO.UsuarioIngreso); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("INS_EmpresaServicio", "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 Update(YouCom.DTO.ProyectoDTO myProyectoDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pIdProyecto", SqlDbType.Decimal, -1, myProyectoDTO.IdProyecto); wobjSQLHelper.SetParametro("@pIdCondominio", SqlDbType.Decimal, -1, myProyectoDTO.TheCondominioDTO.IdCondominio); wobjSQLHelper.SetParametro("@pIdComunidad", SqlDbType.Decimal, -1, myProyectoDTO.TheComunidadDTO.IdComunidad); wobjSQLHelper.SetParametro("@pIdPropuesta", SqlDbType.Decimal, -1, myProyectoDTO.ThePropuestaDTO.IdPropuesta); wobjSQLHelper.SetParametro("@pNombreProyecto", SqlDbType.VarChar, 500, myProyectoDTO.NombreProyecto); wobjSQLHelper.SetParametro("@pDescripcionProyecto", SqlDbType.Text, -1, myProyectoDTO.DescripcionProyecto); wobjSQLHelper.SetParametro("@pFechaInicioProyecto", SqlDbType.DateTime, -1, myProyectoDTO.FechaInicioProyecto); wobjSQLHelper.SetParametro("@pFechaTerminoProyecto", SqlDbType.DateTime, -1, myProyectoDTO.FechaTerminoProyecto); wobjSQLHelper.SetParametro("@pFechaEntregaProyecto", SqlDbType.DateTime, -1, myProyectoDTO.FechaEntregaProyecto); wobjSQLHelper.SetParametro("@pPresupuestoProyecto", SqlDbType.Decimal, -1, myProyectoDTO.PresupuestoProyecto); wobjSQLHelper.SetParametro("@pDireccionProyecto", SqlDbType.VarChar, 300, myProyectoDTO.DireccionProyecto); wobjSQLHelper.SetParametro("@pIdEmpresaContratista", SqlDbType.Decimal, -1, myProyectoDTO.TheEmpresaContratistaDTO.IdEmpresaContratista); wobjSQLHelper.SetParametro("@pIdProyectoEstado", SqlDbType.Decimal, -1, myProyectoDTO.TheProyectoEstadoDTO.IdProyectoEstado); wobjSQLHelper.SetParametro("@pUsuarioModificacion", SqlDbType.VarChar, 20, myProyectoDTO.UsuarioModificacion); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("UPD_Proyecto", "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 Insert(YouCom.DTO.EventoDTO myEventoDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pIdCondominio", SqlDbType.Decimal, -1, myEventoDTO.IdCondominio); wobjSQLHelper.SetParametro("@pIdCategoria", SqlDbType.Decimal, -1, myEventoDTO.CategoriaId); wobjSQLHelper.SetParametro("@pEventoTitulo", SqlDbType.VarChar, 200, myEventoDTO.EventoTitulo); wobjSQLHelper.SetParametro("@pEventoResumen", SqlDbType.VarChar, 500, myEventoDTO.EventoResumen); wobjSQLHelper.SetParametro("@pEventoDetalle", SqlDbType.Text, -1, myEventoDTO.EventoDetalle); wobjSQLHelper.SetParametro("@pEventoPublicacion", SqlDbType.DateTime, -1, myEventoDTO.EventoPublicacion); wobjSQLHelper.SetParametro("@pEventoInicio", SqlDbType.DateTime, -1, myEventoDTO.EventoInicio); wobjSQLHelper.SetParametro("@pEventoExpiracion", SqlDbType.DateTime, -1, myEventoDTO.EventoExpiracion); wobjSQLHelper.SetParametro("@pEventoAutor", SqlDbType.VarChar, 200, myEventoDTO.EventoAutor); wobjSQLHelper.SetParametro("@pEventoImagen", SqlDbType.VarChar, 200, myEventoDTO.EventoImagen); wobjSQLHelper.SetParametro("@pUsuarioIngreso", SqlDbType.VarChar, 20, myEventoDTO.UsuarioIngreso); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("INS_Evento", "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 Update(YouCom.DTO.NoticiaDTO myNoticiaDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pNoticiaId", SqlDbType.Decimal, -1, myNoticiaDTO.NoticiaId); wobjSQLHelper.SetParametro("@pIdCondominio", SqlDbType.Decimal, -1, myNoticiaDTO.IdCondominio); wobjSQLHelper.SetParametro("@pIdCategoria", SqlDbType.Decimal, -1, myNoticiaDTO.CategoriaId); wobjSQLHelper.SetParametro("@pNoticiaTitulo", SqlDbType.VarChar, 200, myNoticiaDTO.NotiTitulo); wobjSQLHelper.SetParametro("@pNoticiaResumen", SqlDbType.VarChar, 500, myNoticiaDTO.NotiResumen); wobjSQLHelper.SetParametro("@pNoticiaDetalle", SqlDbType.Text, -1, myNoticiaDTO.NotiDetalle); wobjSQLHelper.SetParametro("@pNoticiaPublicacion", SqlDbType.DateTime, -1, myNoticiaDTO.NotiPublicacion); wobjSQLHelper.SetParametro("@pNoticiaInicio", SqlDbType.DateTime, -1, myNoticiaDTO.NotiInicio); wobjSQLHelper.SetParametro("@pNoticiaExpira", SqlDbType.Char, 1, myNoticiaDTO.NotiExpira); wobjSQLHelper.SetParametro("@pNoticiaExpiracion", SqlDbType.DateTime, -1, myNoticiaDTO.NotiExpiracion); wobjSQLHelper.SetParametro("@pNoticiaAutor", SqlDbType.VarChar, 200, myNoticiaDTO.NotiAutor); wobjSQLHelper.SetParametro("@pNoticiaImagen", SqlDbType.VarChar, 200, !string.IsNullOrEmpty(myNoticiaDTO.NotiImagen) ? myNoticiaDTO.NotiImagen : System.Data.SqlTypes.SqlString.Null); wobjSQLHelper.SetParametro("@pUsuarioModificacion", SqlDbType.VarChar, 20, myNoticiaDTO.UsuarioModificacion); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("UPD_Noticia", "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 Update(YouCom.DTO.VacacionesDTO myVacacionesDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pIdVacaciones", SqlDbType.Decimal, -1, myVacacionesDTO.IdVacaciones); wobjSQLHelper.SetParametro("@pIdCasa", SqlDbType.Decimal, -1, myVacacionesDTO.TheCasaDTO.IdCasa); wobjSQLHelper.SetParametro("@pIdCondominio", SqlDbType.Decimal, -1, myVacacionesDTO.TheCondominioDTO.IdCondominio); wobjSQLHelper.SetParametro("@pIdComunidad", SqlDbType.Decimal, -1, myVacacionesDTO.TheComunidadDTO.IdComunidad); wobjSQLHelper.SetParametro("@pIdParentesco", SqlDbType.Decimal, -1, myVacacionesDTO.TheParentescoDTO.IdParentesco); wobjSQLHelper.SetParametro("@pFechaInicio", SqlDbType.DateTime, -1, myVacacionesDTO.FechaInicio); wobjSQLHelper.SetParametro("@pFechaTermino", SqlDbType.DateTime, -1, myVacacionesDTO.FechaTermino); wobjSQLHelper.SetParametro("@pMotivo", SqlDbType.VarChar, 500, myVacacionesDTO.DestinoVacaciones); wobjSQLHelper.SetParametro("@pTelefonoContacto", SqlDbType.VarChar, 20, myVacacionesDTO.TelefonoContacto); wobjSQLHelper.SetParametro("@pNombreContacto", SqlDbType.VarChar, 200, myVacacionesDTO.NombreContacto); wobjSQLHelper.SetParametro("@pUsuarioModificacion", SqlDbType.VarChar, 20, myVacacionesDTO.UsuarioModificacion); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("UPD_Vacaciones", "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 Update(YouCom.DTO.Mensajeria.MensajePropietarioDTO myMensajePropietarioDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pIdMensajePropietario", SqlDbType.Decimal, -1, myMensajePropietarioDTO.IdMensajePropietario); wobjSQLHelper.SetParametro("@pIdCondominio", SqlDbType.Decimal, -1, myMensajePropietarioDTO.TheCondominioDTO.IdCondominio); wobjSQLHelper.SetParametro("@pIdComunidad", SqlDbType.Decimal, -1, myMensajePropietarioDTO.TheComunidadDTO.IdComunidad); wobjSQLHelper.SetParametro("@pIdPadre", SqlDbType.Decimal, -1, myMensajePropietarioDTO.IdPadre); wobjSQLHelper.SetParametro("@pIdCategoria", SqlDbType.Decimal, -1, myMensajePropietarioDTO.TheCategoriaDTO.IdCategoria); wobjSQLHelper.SetParametro("@pIdFamiliaOrigen", SqlDbType.Decimal, -1, myMensajePropietarioDTO.TheFamiliaOrigenDTO.IdFamilia > 0 ? myMensajePropietarioDTO.TheFamiliaOrigenDTO.IdFamilia : System.Data.SqlTypes.SqlDecimal.Null); wobjSQLHelper.SetParametro("@pIdFamiliaDestino", SqlDbType.Decimal, -1, myMensajePropietarioDTO.TheFamiliaDestinoDTO.IdFamilia > 0 ? myMensajePropietarioDTO.TheFamiliaDestinoDTO.IdFamilia : System.Data.SqlTypes.SqlDecimal.Null); wobjSQLHelper.SetParametro("@pFechaMensaje", SqlDbType.DateTime, -1, myMensajePropietarioDTO.MensajeFecha); wobjSQLHelper.SetParametro("@pTituloMensaje", SqlDbType.Text, -1, myMensajePropietarioDTO.MensajeTitulo); wobjSQLHelper.SetParametro("@pDescripcionMensaje", SqlDbType.Text, -1, myMensajePropietarioDTO.MensajeDescripcion); wobjSQLHelper.SetParametro("@pUsuarioModificacion", SqlDbType.VarChar, 20, myMensajePropietarioDTO.UsuarioModificacion); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("UPD_MensajePropietario", "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 Update(YouCom.DTO.GastosComunesDTO myGastosComunesDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pIdGasto", SqlDbType.Decimal, -1, myGastosComunesDTO.IdGastoComun); wobjSQLHelper.SetParametro("@pIdCasa", SqlDbType.Decimal, -1, myGastosComunesDTO.IdCasa); wobjSQLHelper.SetParametro("@pIdCondominio", SqlDbType.Decimal, -1, myGastosComunesDTO.IdCondominio); wobjSQLHelper.SetParametro("@pDescripcionGasto", SqlDbType.VarChar, 500, myGastosComunesDTO.DescripcionGasto); wobjSQLHelper.SetParametro("@pMontoGasto", SqlDbType.VarChar, 200, myGastosComunesDTO.MontoGasto); wobjSQLHelper.SetParametro("@pFechaGasto", SqlDbType.DateTime, -1, myGastosComunesDTO.FechaGasto); wobjSQLHelper.SetParametro("@pArchivoGasto", SqlDbType.VarChar, 200, !string.IsNullOrEmpty(myGastosComunesDTO.ArchivoGasto) ? myGastosComunesDTO.ArchivoGasto : System.Data.SqlTypes.SqlString.Null); wobjSQLHelper.SetParametro("@pEstadoGasto", SqlDbType.VarChar, 10, myGastosComunesDTO.EstadoGasto); wobjSQLHelper.SetParametro("@pFechaPagoGasto", SqlDbType.DateTime, -1, myGastosComunesDTO.FechaPagoGasto); wobjSQLHelper.SetParametro("@pComentarioGasto", SqlDbType.VarChar, 500, !string.IsNullOrEmpty(myGastosComunesDTO.ComentarioGasto) ? myGastosComunesDTO.ComentarioGasto : System.Data.SqlTypes.SqlString.Null); wobjSQLHelper.SetParametro("@pUsuarioModificacion", SqlDbType.VarChar, 20, myGastosComunesDTO.UsuarioModificacion); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("UPD_GastoComun", "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 Insert(YouCom.DTO.AccesoHogar.AccesoHogarDTO myAccesoHogarDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pIdCasa", SqlDbType.Decimal, -1, myAccesoHogarDTO.TheCasaDTO.IdCasa); wobjSQLHelper.SetParametro("@pIdTipoVisita", SqlDbType.Decimal, -1, myAccesoHogarDTO.TheTipoVisitaDTO.IdTipoVisita); wobjSQLHelper.SetParametro("@pIdFrecuencia", SqlDbType.Decimal, -1, myAccesoHogarDTO.TheFrecuenciaDTO.IdFrecuencia); wobjSQLHelper.SetParametro("@pIdFamilia", SqlDbType.Decimal, -1, myAccesoHogarDTO.TheFamiliaDTO.IdFamilia); wobjSQLHelper.SetParametro("@pFechaInicio", SqlDbType.DateTime, -1, myAccesoHogarDTO.FechaInicio); wobjSQLHelper.SetParametro("@pFechaTermino", SqlDbType.DateTime, -1, myAccesoHogarDTO.FechaTermino); wobjSQLHelper.SetParametro("@pHoraInicio", SqlDbType.VarChar, -1, myAccesoHogarDTO.HoraInicio); wobjSQLHelper.SetParametro("@pHoraTermino", SqlDbType.VarChar, -1, myAccesoHogarDTO.HoraTermino); wobjSQLHelper.SetParametro("@pNombreVisita", SqlDbType.VarChar, 200, myAccesoHogarDTO.NombreVisita); wobjSQLHelper.SetParametro("@pApellidoPaternoVisita", SqlDbType.VarChar, 200, myAccesoHogarDTO.ApellidoPaternoVisita); wobjSQLHelper.SetParametro("@pApellidoMaternoVisita", SqlDbType.VarChar, 200, myAccesoHogarDTO.ApellidoMaternoVisita); wobjSQLHelper.SetParametro("@pRutVisita", SqlDbType.VarChar, 20, myAccesoHogarDTO.RutVisita); wobjSQLHelper.SetParametro("@pEmailVisita", SqlDbType.VarChar, 200, myAccesoHogarDTO.EmailVisita); wobjSQLHelper.SetParametro("@pAvisar", SqlDbType.Char, 2, myAccesoHogarDTO.Avisar); wobjSQLHelper.SetParametro("@pUsuarioIngreso", SqlDbType.VarChar, 20, myAccesoHogarDTO.UsuarioIngreso); wobjSQLHelper.SetParametro("@pIdCondominio", SqlDbType.Decimal, -1, myAccesoHogarDTO.TheCondominioDTO.IdCondominio); wobjSQLHelper.SetParametro("@pIdComunidad", SqlDbType.Decimal, -1, myAccesoHogarDTO.TheComunidadDTO.IdComunidad); wobjSQLHelper.SetParametroOut("@identity", SqlDbType.Decimal, -1); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("INS_AccesoHogar", "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."); } //==================================================================================== myAccesoHogarDTO.IdAccesoHogar = decimal.Parse(wobjSQLHelper.GetParametro("@identity").ToString()); retorno = true; } #region Catch catch (Exception eobjException) { throw eobjException; } #endregion return(retorno); }