public static bool ActivaEvento(YouCom.DTO.EventoDTO theEventoDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); wobjSQLHelper.SetParametro("@usuarioIngreso", SqlDbType.VarChar, 50, theEventoDTO.UsuarioModificacion); wobjSQLHelper.SetParametro("@pIdEvento", SqlDbType.VarChar, 20, theEventoDTO.EventoId); try { //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("Activa_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; } catch (Exception eobjException) { throw eobjException; } return(retorno); }
public static bool Update(YouCom.DTO.EventoDTO myEventoDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pEventoId", SqlDbType.Decimal, -1, myEventoDTO.EventoId); wobjSQLHelper.SetParametro("@pIdCondominio", SqlDbType.Decimal, -1, myEventoDTO.TheCondominioDTO.IdCondominio); wobjSQLHelper.SetParametro("@pIdComunidad", SqlDbType.Decimal, -1, myEventoDTO.TheComunidadDTO.IdComunidad); wobjSQLHelper.SetParametro("@pIdCategoria", SqlDbType.Decimal, -1, myEventoDTO.TheCategoriaDTO.IdCategoria); 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, 20, myEventoDTO.EventoAutor); wobjSQLHelper.SetParametro("@pEventoImagen", SqlDbType.VarChar, 200, !string.IsNullOrEmpty(myEventoDTO.EventoImagen) ? myEventoDTO.EventoImagen : System.Data.SqlTypes.SqlString.Null); wobjSQLHelper.SetParametro("@pUsuarioModificacion", SqlDbType.VarChar, 20, myEventoDTO.UsuarioModificacion); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("UPD_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 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 ValidaEliminacionEvento(YouCom.DTO.EventoDTO theEventoDTO) { DataTable pobjDataTable = new DataTable(); bool retorno = false; if (YouCom.DAL.EventoDAL.ValidaEliminacionEvento(theEventoDTO, ref pobjDataTable)) { foreach (DataRow wobjDataRow in pobjDataTable.Rows) { retorno = true; } } return(retorno); }
public static IList <YouCom.DTO.EventoDTO> getListadoEvento() { IList <YouCom.DTO.EventoDTO> IEvento = new List <YouCom.DTO.EventoDTO>(); DataTable pobjDataTable = new DataTable(); if (YouCom.DAL.EventoDAL.getListadoEvento(ref pobjDataTable)) { foreach (DataRow wobjDataRow in pobjDataTable.Rows) { YouCom.DTO.EventoDTO evento = new YouCom.DTO.EventoDTO(); evento.EventoId = decimal.Parse(wobjDataRow["evento_id"].ToString()); YouCom.DTO.Seguridad.CondominioDTO myCondominio = new YouCom.DTO.Seguridad.CondominioDTO(); myCondominio.IdCondominio = decimal.Parse(wobjDataRow["idCondominio"].ToString()); evento.TheCondominioDTO = myCondominio; YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO(); myComunidadDTO.IdComunidad = decimal.Parse(wobjDataRow["idComunidad"].ToString()); evento.TheComunidadDTO = myComunidadDTO; YouCom.DTO.CategoriaDTO myCategoriaDTO = new YouCom.DTO.CategoriaDTO(); myCategoriaDTO.IdCategoria = decimal.Parse(wobjDataRow["idCategoria"].ToString()); evento.TheCategoriaDTO = myCategoriaDTO; evento.EventoTitulo = wobjDataRow["evento_titulo"].ToString(); evento.EventoResumen = wobjDataRow["evento_resumen"].ToString(); evento.EventoDetalle = wobjDataRow["evento_detalle"].ToString(); evento.EventoPublicacion = Convert.ToDateTime(wobjDataRow["evento_publicacion"].ToString()); evento.EventoInicio = Convert.ToDateTime(wobjDataRow["evento_inicio"].ToString()); evento.EventoExpiracion = Convert.ToDateTime(wobjDataRow["evento_expiracion"].ToString()); evento.EventoAutor = wobjDataRow["evento_autor"].ToString(); evento.EventoImagen = wobjDataRow["evento_imagen"].ToString(); evento.UsuarioIngreso = wobjDataRow["usuario_ingreso"].ToString(); evento.FechaIngreso = wobjDataRow["fecha_ingreso"].ToString(); evento.UsuarioModificacion = wobjDataRow["usuario_modificacion"].ToString(); evento.FechaModificacion = wobjDataRow["fecha_modificacion"].ToString(); evento.Estado = wobjDataRow["estado"].ToString(); IEvento.Add(evento); } } return(IEvento); }
public static bool Delete(YouCom.DTO.EventoDTO myEventoDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pEventoId", SqlDbType.Decimal, -1, myEventoDTO.EventoId); wobjSQLHelper.SetParametro("@pUsuarioModificacion", SqlDbType.VarChar, 20, myEventoDTO.UsuarioModificacion); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("DEL_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); }