public static bool ActivaMensajePorteria(YouCom.DTO.MensajePorteriaDTO theMensajePorteriaDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); wobjSQLHelper.SetParametro("@usuarioIngreso", SqlDbType.VarChar, 50, theMensajePorteriaDTO.UsuarioModificacion); wobjSQLHelper.SetParametro("@pIdMensajePorteria", SqlDbType.VarChar, 20, theMensajePorteriaDTO.IdMensajePorteria); try { //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("Activa_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; } catch (Exception eobjException) { throw eobjException; } return(retorno); }
public static IList <YouCom.DTO.MensajePorteriaDTO> getListadoMensajePorteria() { IList <YouCom.DTO.MensajePorteriaDTO> IMensajePorteria = new List <YouCom.DTO.MensajePorteriaDTO>(); DataTable pobjDataTable = new DataTable(); if (YouCom.Mensajeria.DAL.MensajePorteriaDAL.getListadoMensajePorteria(ref pobjDataTable)) { foreach (DataRow wobjDataRow in pobjDataTable.Rows) { YouCom.DTO.MensajePorteriaDTO tipo_aviso = new YouCom.DTO.MensajePorteriaDTO(); tipo_aviso.IdMensajePorteria = decimal.Parse(wobjDataRow["IdMensajePorteria"].ToString()); tipo_aviso.IdFamilia = decimal.Parse(wobjDataRow["IdFamilia"].ToString()); tipo_aviso.IdPortero = decimal.Parse(wobjDataRow["IdPortero"].ToString()); tipo_aviso.FechaMensaje = DateTime.Parse(wobjDataRow["fechaMensaje"].ToString()); tipo_aviso.DescripcionMensaje = wobjDataRow["descripcionMensaje"].ToString(); tipo_aviso.UsuarioIngreso = wobjDataRow["usuario_ingreso"].ToString(); tipo_aviso.FechaIngreso = wobjDataRow["fecha_ingreso"].ToString(); tipo_aviso.UsuarioModificacion = wobjDataRow["usuario_modificacion"].ToString(); tipo_aviso.FechaModificacion = wobjDataRow["fecha_modificacion"].ToString(); tipo_aviso.Estado = wobjDataRow["estado"].ToString(); IMensajePorteria.Add(tipo_aviso); } } return(IMensajePorteria); }
public static bool ValidaEliminacionMensajePorteria(YouCom.DTO.MensajePorteriaDTO theMensajePorteriaDTO) { DataTable pobjDataTable = new DataTable(); bool retorno = false; if (YouCom.Mensajeria.DAL.MensajePorteriaDAL.ValidaEliminacionMensajePorteria(theMensajePorteriaDTO, ref pobjDataTable)) { foreach (DataRow wobjDataRow in pobjDataTable.Rows) { retorno = true; } } 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); }