Ejemplo n.º 1
0
        public static bool ActivaPeriodoHorario(YouCom.DTO.PeriodoHorarioDTO thePeriodoHorarioDTO)
        {
            bool retorno = false;

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

            wobjSQLHelper.SetParametro("@usuarioIngreso", SqlDbType.VarChar, 50, thePeriodoHorarioDTO.UsuarioModificacion);
            wobjSQLHelper.SetParametro("@pIdPeriodoHorario", SqlDbType.VarChar, 20, thePeriodoHorarioDTO.IdPeriodoHorario);

            try
            {
                //====================================================================================
                switch (wobjSQLHelper.EjecutarNQ("Activa_PeriodoHorario", "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);
        }
Ejemplo n.º 2
0
        public static IList <YouCom.DTO.PeriodoHorarioDTO> getListadoPeriodoHorario()
        {
            IList <YouCom.DTO.PeriodoHorarioDTO> IPeriodoHorario = new List <YouCom.DTO.PeriodoHorarioDTO>();

            DataTable pobjDataTable = new DataTable();

            if (YouCom.DAL.PeriodoHorarioDAL.getListadoPeriodoHorario(ref pobjDataTable))
            {
                foreach (DataRow wobjDataRow in pobjDataTable.Rows)
                {
                    YouCom.DTO.PeriodoHorarioDTO tipo_aviso = new YouCom.DTO.PeriodoHorarioDTO();

                    tipo_aviso.IdPeriodoHorario     = decimal.Parse(wobjDataRow["IdPeriodoHorario"].ToString());
                    tipo_aviso.NombrePeriodoHorario = wobjDataRow["nombrePeriodoHorario"].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();

                    IPeriodoHorario.Add(tipo_aviso);
                }
            }

            return(IPeriodoHorario);
        }
Ejemplo n.º 3
0
        public static bool ValidaEliminacionPeriodoHorario(YouCom.DTO.PeriodoHorarioDTO thePeriodoHorarioDTO)
        {
            DataTable pobjDataTable = new DataTable();
            bool      retorno       = false;

            if (YouCom.DAL.PeriodoHorarioDAL.ValidaEliminacionPeriodoHorario(thePeriodoHorarioDTO, ref pobjDataTable))
            {
                foreach (DataRow wobjDataRow in pobjDataTable.Rows)
                {
                    retorno = true;
                }
            }

            return(retorno);
        }
Ejemplo n.º 4
0
        public static bool Update(YouCom.DTO.PeriodoHorarioDTO myPeriodoHorarioDTO)
        {
            bool retorno = false;

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

            try
            {
                //Seteo Parámetros.
                //====================================================================================
                wobjSQLHelper.SetParametro("@pIdPeriodoHorario", SqlDbType.Decimal, -1, myPeriodoHorarioDTO.IdPeriodoHorario);
                wobjSQLHelper.SetParametro("@pIdCondominio", SqlDbType.Decimal, -1, myPeriodoHorarioDTO.TheCondominioDTO.IdCondominio);
                wobjSQLHelper.SetParametro("@pIdComunidad", SqlDbType.Decimal, -1, myPeriodoHorarioDTO.TheComunidadDTO.IdComunidad);
                wobjSQLHelper.SetParametro("@pNombrePeriodoHorario", SqlDbType.VarChar, 200, myPeriodoHorarioDTO.NombrePeriodoHorario);
                wobjSQLHelper.SetParametro("@pUsuarioModificacion", SqlDbType.VarChar, 20, myPeriodoHorarioDTO.UsuarioModificacion);
                //====================================================================================

                //Ejecuto SP.
                //====================================================================================
                switch (wobjSQLHelper.EjecutarNQ("UPD_PeriodoHorario", "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);
        }
Ejemplo n.º 5
0
        public static IList <YouCom.DTO.HorarioTurnoDTO> getListadoHorarioTurno()
        {
            IList <YouCom.DTO.HorarioTurnoDTO> IHorarioTurno = new List <YouCom.DTO.HorarioTurnoDTO>();

            DataTable pobjDataTable = new DataTable();

            if (YouCom.DAL.HorarioTurnoDAL.getListadoHorarioTurno(ref pobjDataTable))
            {
                foreach (DataRow wobjDataRow in pobjDataTable.Rows)
                {
                    YouCom.DTO.HorarioTurnoDTO horario = new YouCom.DTO.HorarioTurnoDTO();

                    horario.IdHorarioTurno = decimal.Parse(wobjDataRow["IdHorarioTurno"].ToString());

                    YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO();
                    myCondominioDTO.IdCondominio = decimal.Parse(wobjDataRow["idCondominio"].ToString());
                    horario.TheCondominioDTO     = myCondominioDTO;

                    YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO();
                    myComunidadDTO.IdComunidad = decimal.Parse(wobjDataRow["idComunidad"].ToString());
                    horario.TheComunidadDTO    = myComunidadDTO;

                    YouCom.DTO.PeriodoHorarioDTO myPeriodoHorarioDTO = new YouCom.DTO.PeriodoHorarioDTO();
                    myPeriodoHorarioDTO.IdPeriodoHorario = decimal.Parse(wobjDataRow["idPeriodoHorario"].ToString());
                    horario.ThePeriodoHorarioDTO         = myPeriodoHorarioDTO;

                    horario.HoraInicio  = wobjDataRow["horaInicio"].ToString();
                    horario.HoraTermino = wobjDataRow["horaTermino"].ToString();

                    horario.UsuarioIngreso      = wobjDataRow["usuario_ingreso"].ToString();
                    horario.FechaIngreso        = wobjDataRow["fecha_ingreso"].ToString();
                    horario.UsuarioModificacion = wobjDataRow["usuario_modificacion"].ToString();
                    horario.FechaModificacion   = wobjDataRow["fecha_modificacion"].ToString();

                    horario.Estado = wobjDataRow["estado"].ToString();

                    IHorarioTurno.Add(horario);
                }
            }

            return(IHorarioTurno);
        }
Ejemplo n.º 6
0
        public static bool Insert(YouCom.DTO.PeriodoHorarioDTO myPeriodoHorarioDTO)
        {
            bool retorno = false;

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

            try
            {
                //Seteo Parámetros.
                //====================================================================================
                wobjSQLHelper.SetParametro("@pNombrePeriodoHorario", SqlDbType.VarChar, 200, myPeriodoHorarioDTO.NombrePeriodoHorario);
                wobjSQLHelper.SetParametro("@pUsuarioIngreso", SqlDbType.VarChar, 20, myPeriodoHorarioDTO.UsuarioIngreso);
                //====================================================================================

                //Ejecuto SP.
                //====================================================================================
                switch (wobjSQLHelper.EjecutarNQ("INS_PeriodoHorario", "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);
        }