示例#1
0
        public static bool ActivaVotacionPropuestaRespuesta(YouCom.DTO.Propuesta.VotacionPropuestaRespuestaDTO theVotacionPropuestaRespuestaDTO)
        {
            bool retorno = false;

            YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper();

            wobjSQLHelper.SetParametro("@pIdVotacionPropuestaRespuesta", SqlDbType.VarChar, 20, theVotacionPropuestaRespuestaDTO.TheVotacionPropuestaDTO.IdVotacionPropuesta);

            try
            {
                //====================================================================================
                switch (wobjSQLHelper.EjecutarNQ("Activa_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;
            }
            catch (Exception eobjException)
            {
                throw eobjException;
            }
            return(retorno);
        }
        public static IList <YouCom.DTO.Propuesta.VotacionPropuestaRespuestaDTO> getListadoVotacionPropuestaRespuesta()
        {
            IList <YouCom.DTO.Propuesta.VotacionPropuestaRespuestaDTO> IVotacionPropuesta = new List <YouCom.DTO.Propuesta.VotacionPropuestaRespuestaDTO>();

            DataTable pobjDataTable = new DataTable();

            if (YouCom.DAL.VotacionPropuestaRespuestaDAL.getListadoVotacionPropuestaRespuesta(ref pobjDataTable))
            {
                foreach (DataRow wobjDataRow in pobjDataTable.Rows)
                {
                    YouCom.DTO.Propuesta.VotacionPropuestaRespuestaDTO votacion = new YouCom.DTO.Propuesta.VotacionPropuestaRespuestaDTO();

                    YouCom.DTO.Propuesta.VotacionPropuestaDTO myVotacionPropuestaDTO = new YouCom.DTO.Propuesta.VotacionPropuestaDTO();
                    myVotacionPropuestaDTO.IdVotacionPropuesta = decimal.Parse(wobjDataRow["idVotacionPropuesta"].ToString());
                    votacion.TheVotacionPropuestaDTO           = myVotacionPropuestaDTO;

                    YouCom.DTO.Propietario.FamiliaDTO myFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO();
                    myFamiliaDTO.IdFamilia              = decimal.Parse(wobjDataRow["idFamilia"].ToString());
                    myFamiliaDTO.NombreFamilia          = wobjDataRow["nombreFamilia"].ToString();
                    myFamiliaDTO.ApellidoPaternoFamilia = wobjDataRow["apellidoPaternoFamilia"].ToString();
                    myFamiliaDTO.ApellidoMaternoFamilia = wobjDataRow["apellidoMaternoFamilia"].ToString();
                    votacion.TheFamiliaDTO              = myFamiliaDTO;

                    votacion.FechaVotacion    = Convert.ToDateTime(wobjDataRow["fechaVotacion"].ToString());
                    votacion.EleccionVotacion = wobjDataRow["eleccionVotacion"].ToString() == "S" ? "SI" : "NO";

                    IVotacionPropuesta.Add(votacion);
                }
            }

            return(IVotacionPropuesta);
        }
        public static bool ValidaEliminacionVotacionPropuestaRespuesta(YouCom.DTO.Propuesta.VotacionPropuestaRespuestaDTO theVotacionPropuestaRespuestaDTO)
        {
            DataTable pobjDataTable = new DataTable();
            bool      retorno       = false;

            if (YouCom.DAL.VotacionPropuestaRespuestaDAL.ValidaEliminacionVotacionPropuestaRespuesta(theVotacionPropuestaRespuestaDTO, ref pobjDataTable))
            {
                foreach (DataRow wobjDataRow in pobjDataTable.Rows)
                {
                    retorno = true;
                }
            }

            return(retorno);
        }
示例#4
0
        public static bool Insert(YouCom.DTO.Propuesta.VotacionPropuestaRespuestaDTO myVotacionPropuestaRespuestaDTO)
        {
            bool retorno = false;

            YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper();

            try
            {
                //Seteo Parámetros.
                //====================================================================================
                wobjSQLHelper.SetParametro("@pIdVotacionPropuesta", SqlDbType.Decimal, -1, myVotacionPropuestaRespuestaDTO.TheVotacionPropuestaDTO.IdVotacionPropuesta);
                wobjSQLHelper.SetParametro("@pIdFamilia", SqlDbType.Decimal, -1, myVotacionPropuestaRespuestaDTO.TheFamiliaDTO.IdFamilia);
                wobjSQLHelper.SetParametro("@pFechaVotacion", SqlDbType.DateTime, -1, myVotacionPropuestaRespuestaDTO.FechaVotacion);
                wobjSQLHelper.SetParametro("@pEleccionVotacion", SqlDbType.Char, 1, myVotacionPropuestaRespuestaDTO.EleccionVotacion);
                //====================================================================================

                //Ejecuto SP.
                //====================================================================================
                switch (wobjSQLHelper.EjecutarNQ("INS_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);
        }
示例#5
0
        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);
        }