Esempio n. 1
0
        public static IList <YouCom.DTO.CargoDTO> getListadoCargo()
        {
            IList <YouCom.DTO.CargoDTO> ICargo = new List <YouCom.DTO.CargoDTO>();

            DataTable pobjDataTable = new DataTable();

            if (YouCom.DAL.CargoDAL.getListadoCargo(ref pobjDataTable))
            {
                foreach (DataRow wobjDataRow in pobjDataTable.Rows)
                {
                    YouCom.DTO.CargoDTO cargo = new YouCom.DTO.CargoDTO();

                    cargo.IdCargo          = decimal.Parse(wobjDataRow["IdCargo"].ToString());
                    cargo.NombreCargo      = wobjDataRow["nombreCargo"].ToString();
                    cargo.DescripcionCargo = wobjDataRow["descripcionCargo"].ToString();

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

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

                    ICargo.Add(cargo);
                }
            }

            return(ICargo);
        }
Esempio n. 2
0
        public static bool ValidaEliminacionCargo(YouCom.DTO.CargoDTO theCargoDTO, ref DataTable pobjDatatable)
        {
            bool retorno = false;

            YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper();
            wobjSQLHelper.SetParametro("@idCargo", SqlDbType.VarChar, 20, theCargoDTO.IdCargo);

            try
            {
                //====================================================================================
                if (wobjSQLHelper.Ejecutar("validaEliminacionCargo", "YouCom", pobjDatatable) <= 0)
                {
                    retorno = false;
                }
                else
                {
                    retorno = true;
                }
            }
            catch (Exception eobjException)
            {
                throw eobjException;
            }
            return(retorno);
        }
Esempio n. 3
0
        public static bool ActivaCargo(YouCom.DTO.CargoDTO theCargoDTO)
        {
            bool retorno = false;

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

            wobjSQLHelper.SetParametro("@usuarioIngreso", SqlDbType.VarChar, 50, theCargoDTO.UsuarioModificacion);
            wobjSQLHelper.SetParametro("@pIdCargo", SqlDbType.VarChar, 20, theCargoDTO.IdCargo);

            try
            {
                //====================================================================================
                switch (wobjSQLHelper.EjecutarNQ("Activa_Cargo", "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);
        }
Esempio n. 4
0
        public static IList <YouCom.DTO.Servicio.ResponsableDTO> getListadoResponsable()
        {
            IList <YouCom.DTO.Servicio.ResponsableDTO> IResponsable = new List <YouCom.DTO.Servicio.ResponsableDTO>();

            DataTable pobjDataTable = new DataTable();

            if (YouCom.DAL.ResponsableDAL.getListadoResponsable(ref pobjDataTable))
            {
                foreach (DataRow wobjDataRow in pobjDataTable.Rows)
                {
                    YouCom.DTO.Servicio.ResponsableDTO responsable = new YouCom.DTO.Servicio.ResponsableDTO();

                    responsable.IdResponsable = decimal.Parse(wobjDataRow["idResponsable"].ToString());

                    responsable.RutResponsable             = wobjDataRow["rutResponsable"].ToString();
                    responsable.NombreResponsable          = wobjDataRow["nombreResponsable"].ToString();
                    responsable.ApellidoPaternoResponsable = wobjDataRow["apellidoPaternoResponsable"].ToString();
                    responsable.ApellidoMaternoResponsable = wobjDataRow["apellidoMaternoResponsable"].ToString();

                    responsable.TelefonoResponsable = wobjDataRow["telefonoResponsable"].ToString();
                    responsable.CelularResponsable  = wobjDataRow["celularResponsable"].ToString();
                    responsable.EmailResponsable    = wobjDataRow["emailResponsable"].ToString();

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

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

                    YouCom.DTO.CargoDTO myCargoDTO = new YouCom.DTO.CargoDTO();
                    myCargoDTO.IdCargo      = decimal.Parse(wobjDataRow["idCargo"].ToString());
                    myCargoDTO.NombreCargo  = wobjDataRow["nombreCargo"].ToString();
                    responsable.TheCargoDTO = myCargoDTO;

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

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

                    IResponsable.Add(responsable);
                }
            }

            return(IResponsable);
        }
Esempio n. 5
0
        public static bool ValidaEliminacionCargo(YouCom.DTO.CargoDTO theCargoDTO)
        {
            DataTable pobjDataTable = new DataTable();
            bool      retorno       = false;

            if (YouCom.DAL.CargoDAL.ValidaEliminacionCargo(theCargoDTO, ref pobjDataTable))
            {
                foreach (DataRow wobjDataRow in pobjDataTable.Rows)
                {
                    retorno = true;
                }
            }

            return(retorno);
        }
Esempio n. 6
0
        public static IList <YouCom.DTO.DirectivaDTO> getListadoDirectiva()
        {
            IList <YouCom.DTO.DirectivaDTO> IDirectiva = new List <YouCom.DTO.DirectivaDTO>();

            DataTable pobjDataTable = new DataTable();

            if (YouCom.DAL.DirectivaDAL.getListadoDirectiva(ref pobjDataTable))
            {
                foreach (DataRow wobjDataRow in pobjDataTable.Rows)
                {
                    YouCom.DTO.DirectivaDTO directiva = new YouCom.DTO.DirectivaDTO();

                    directiva.IdDirectiva = decimal.Parse(wobjDataRow["idDirectiva"].ToString());

                    YouCom.DTO.CargoDTO myCargoDTO = new YouCom.DTO.CargoDTO();
                    myCargoDTO.IdCargo     = decimal.Parse(wobjDataRow["idCargo"].ToString());
                    myCargoDTO.NombreCargo = wobjDataRow["nombreCargo"].ToString();
                    directiva.TheCargoDTO  = myCargoDTO;

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

                    YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO();
                    myComunidadDTO.IdComunidad         = decimal.Parse(wobjDataRow["idComunidad"].ToString());
                    directiva.TheComunidadDTO          = myComunidadDTO;
                    directiva.RutDirectiva             = wobjDataRow["rutDirectiva"].ToString();
                    directiva.NombreDirectiva          = wobjDataRow["nombreDirectiva"].ToString();
                    directiva.ApellidoPaternoDirectiva = wobjDataRow["apellidoPaternoDirectiva"].ToString();
                    directiva.ApellidoMaternoDirectiva = wobjDataRow["apellidoMaternoDirectiva"].ToString();
                    directiva.TelefonoDirectiva        = wobjDataRow["telefonoDirectiva"].ToString();
                    directiva.ImagenDirectiva          = wobjDataRow["imagenDirectiva"].ToString();
                    directiva.EmailDirectiva           = wobjDataRow["correoDirectiva"].ToString();
                    directiva.FechaNacimientoDirectiva = Convert.ToDateTime(wobjDataRow["fechaNacimientoDirectiva"].ToString());

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

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

                    IDirectiva.Add(directiva);
                }
            }

            return(IDirectiva);
        }
Esempio n. 7
0
        public static bool Update(YouCom.DTO.CargoDTO myCargoDTO)
        {
            bool retorno = false;

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

            try
            {
                //Seteo Parámetros.
                //====================================================================================
                wobjSQLHelper.SetParametro("@pIdCargo", SqlDbType.Decimal, -1, myCargoDTO.IdCargo);
                wobjSQLHelper.SetParametro("@pNombreCargo", SqlDbType.VarChar, 20, myCargoDTO.NombreCargo);
                wobjSQLHelper.SetParametro("@pDescripcionCargo", SqlDbType.VarChar, 500, myCargoDTO.DescripcionCargo);
                wobjSQLHelper.SetParametro("@pUsuarioModificacion", SqlDbType.VarChar, 20, myCargoDTO.UsuarioModificacion);
                //====================================================================================

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