public static bool ActivaVotacionPropuesta(YouCom.DTO.Propuesta.VotacionPropuestaDTO theVotacionPropuestaDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); wobjSQLHelper.SetParametro("@usuarioIngreso", SqlDbType.VarChar, 50, theVotacionPropuestaDTO.UsuarioModificacion); wobjSQLHelper.SetParametro("@pIdVotacionPropuesta", SqlDbType.VarChar, 20, theVotacionPropuestaDTO.IdVotacionPropuesta); try { //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("Activa_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; } 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 IList <YouCom.DTO.Propuesta.VotacionPropuestaDTO> getListadoVotacionPropuesta() { IList <YouCom.DTO.Propuesta.VotacionPropuestaDTO> IVotacionPropuesta = new List <YouCom.DTO.Propuesta.VotacionPropuestaDTO>(); DataTable pobjDataTable = new DataTable(); if (YouCom.DAL.VotacionPropuestaDAL.getListadoVotacionPropuesta(ref pobjDataTable)) { foreach (DataRow wobjDataRow in pobjDataTable.Rows) { YouCom.DTO.Propuesta.VotacionPropuestaDTO votacion = new YouCom.DTO.Propuesta.VotacionPropuestaDTO(); votacion.IdVotacionPropuesta = decimal.Parse(wobjDataRow["idVotacionPropuesta"].ToString()); YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO(); myCondominioDTO.IdCondominio = decimal.Parse(wobjDataRow["idCondominio"].ToString()); votacion.TheCondominioDTO = myCondominioDTO; YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO(); myComunidadDTO.IdComunidad = decimal.Parse(wobjDataRow["idComunidad"].ToString()); votacion.TheComunidadDTO = myComunidadDTO; YouCom.DTO.Propuesta.PropuestaDTO myPropuestaDTO = new YouCom.DTO.Propuesta.PropuestaDTO(); myPropuestaDTO.IdPropuesta = decimal.Parse(wobjDataRow["idPropuesta"].ToString()); myPropuestaDTO.NombrePropuesta = wobjDataRow["nombrePropuesta"].ToString(); myPropuestaDTO.DescripcionPropuesta = wobjDataRow["descripcionPropuesta"].ToString(); 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(); myPropuestaDTO.TheFamiliaDTO = myFamiliaDTO; votacion.ThePropuestaDTO = myPropuestaDTO; YouCom.DTO.Propuesta.VotacionPropuestaEstadoDTO myVotacionPropuestaEstadoDTO = new YouCom.DTO.Propuesta.VotacionPropuestaEstadoDTO(); myVotacionPropuestaEstadoDTO.IdVotacionPropuestaEstado = decimal.Parse(wobjDataRow["idVotacionPropuestaEstado"].ToString()); myVotacionPropuestaEstadoDTO.NombreVotacionPropuestaEstado = wobjDataRow["nombreVotacionPropuestaEstado"].ToString(); votacion.TheVotacionPropuestaEstadoDTO = myVotacionPropuestaEstadoDTO; votacion.FechaInicioVotacionPropuesta = Convert.ToDateTime(wobjDataRow["fechaInicioVotacionPropuesta"].ToString()); votacion.FechaTerminoVotacionPropuesta = Convert.ToDateTime(wobjDataRow["fechaTerminoVotacionPropuesta"].ToString()); votacion.UsuarioIngreso = wobjDataRow["usuario_ingreso"].ToString(); votacion.FechaIngreso = wobjDataRow["fecha_ingreso"].ToString(); votacion.UsuarioModificacion = wobjDataRow["usuario_modificacion"].ToString(); votacion.FechaModificacion = wobjDataRow["fecha_modificacion"].ToString(); votacion.Estado = wobjDataRow["estado"].ToString(); IVotacionPropuesta.Add(votacion); } } return(IVotacionPropuesta); }
public static bool Update(YouCom.DTO.Propuesta.VotacionPropuestaDTO myVotacionPropuestaDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pIdVotacionPropuesta", SqlDbType.Decimal, -1, myVotacionPropuestaDTO.IdVotacionPropuesta); 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("@pUsuarioModificacion", SqlDbType.VarChar, 20, myVotacionPropuestaDTO.UsuarioModificacion); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("UPD_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 ValidaEliminacionPropuesta(YouCom.DTO.Propuesta.VotacionPropuestaDTO theVotacionPropuestaDTO) { DataTable pobjDataTable = new DataTable(); bool retorno = false; if (YouCom.DAL.VotacionPropuestaDAL.ValidaEliminacionVotacionPropuesta(theVotacionPropuestaDTO, ref pobjDataTable)) { foreach (DataRow wobjDataRow in pobjDataTable.Rows) { retorno = true; } } return(retorno); }
public static bool Delete(YouCom.DTO.Propuesta.VotacionPropuestaDTO theVotacionPropuestaDTO) { bool retorno = false; YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper(); try { //Seteo Parámetros. //==================================================================================== wobjSQLHelper.SetParametro("@pIdVotacionPropuesta", SqlDbType.Decimal, -1, theVotacionPropuestaDTO.IdVotacionPropuesta); wobjSQLHelper.SetParametro("@pUsuarioModificacion", SqlDbType.VarChar, 20, theVotacionPropuestaDTO.UsuarioModificacion); //==================================================================================== //Ejecuto SP. //==================================================================================== switch (wobjSQLHelper.EjecutarNQ("DEL_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); }