Esempio n. 1
0
        public static bool ActivaPais(YouCom.DTO.PaisDTO thePaisDTO)
        {
            bool retorno = false;

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

            wobjSQLHelper.SetParametro("@usuarioIngreso", SqlDbType.VarChar, 50, thePaisDTO.UsuarioModificacion);
            wobjSQLHelper.SetParametro("@pIdPais", SqlDbType.VarChar, 20, thePaisDTO.IdPais);

            try
            {
                //====================================================================================
                switch (wobjSQLHelper.EjecutarNQ("Activa_Pais", "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. 2
0
        public static bool ValidaEliminacionPais(YouCom.DTO.PaisDTO thePaisDTO, ref DataTable pobjDatatable)
        {
            bool retorno = false;

            YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper();
            wobjSQLHelper.SetParametro("@idPais", SqlDbType.VarChar, 20, thePaisDTO.IdPais);

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

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

            try
            {
                //Seteo Parámetros.
                //====================================================================================
                wobjSQLHelper.SetParametro("@pIdPais", SqlDbType.Decimal, -1, myPaisDTO.IdPais);
                wobjSQLHelper.SetParametro("@pNombrePais", SqlDbType.VarChar, 20, myPaisDTO.NombrePais);
                wobjSQLHelper.SetParametro("@pDescripcionPais", SqlDbType.Text, -1, myPaisDTO.DescripcionPais);
                wobjSQLHelper.SetParametro("@pUsuarioModificacion", SqlDbType.VarChar, 20, myPaisDTO.UsuarioModificacion);
                //====================================================================================

                //Ejecuto SP.
                //====================================================================================
                switch (wobjSQLHelper.EjecutarNQ("UPD_Pais", "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);
        }
Esempio n. 4
0
        public static IList <YouCom.DTO.Servicio.EmpresaServicioDTO> getListadoEmpresaServicio()
        {
            IList <YouCom.DTO.Servicio.EmpresaServicioDTO> IEmpresaServicio = new List <YouCom.DTO.Servicio.EmpresaServicioDTO>();

            DataTable pobjDataTable = new DataTable();

            if (YouCom.DAL.EmpresaServicioDAL.getListadoEmpresaServicio(ref pobjDataTable))
            {
                foreach (DataRow wobjDataRow in pobjDataTable.Rows)
                {
                    YouCom.DTO.Servicio.EmpresaServicioDTO empresa_servicio = new YouCom.DTO.Servicio.EmpresaServicioDTO();

                    empresa_servicio.IdEmpresaServicio = decimal.Parse(wobjDataRow["idEmpresaServicio"].ToString());

                    YouCom.DTO.Servicio.ServiciosDTO myServiciosDTO = new YouCom.DTO.Servicio.ServiciosDTO();
                    myServiciosDTO.IdServicio        = decimal.Parse(wobjDataRow["idServicios"].ToString());
                    myServiciosDTO.NombreServicio    = wobjDataRow["nombreServicio"].ToString();
                    empresa_servicio.TheServiciosDTO = myServiciosDTO;

                    YouCom.DTO.GiroDTO myGiroDTO = new YouCom.DTO.GiroDTO();
                    myGiroDTO.IdGiro            = decimal.Parse(wobjDataRow["idGiro"].ToString());
                    myGiroDTO.NombreGiro        = wobjDataRow["nombreGiro"].ToString();
                    empresa_servicio.TheGiroDTO = myGiroDTO;

                    empresa_servicio.RutEmpresaServicio         = wobjDataRow["RutEmpresaServicio"].ToString();
                    empresa_servicio.RazonSocialEmpresaServicio = wobjDataRow["razonSocialEmpresaServicio"].ToString();
                    empresa_servicio.DireccionEmpresaServicio   = wobjDataRow["direccionEmpresaServicio"].ToString();

                    YouCom.DTO.ComunaDTO myComunaDTO = new YouCom.DTO.ComunaDTO();
                    myComunaDTO.IdComuna = decimal.Parse(wobjDataRow["idComuna"].ToString());

                    YouCom.DTO.CiudadDTO myCiudadDTO = new YouCom.DTO.CiudadDTO();
                    myCiudadDTO.IdCiudad = decimal.Parse(wobjDataRow["idCiudad"].ToString());

                    YouCom.DTO.RegionDTO myRegionDTO = new YouCom.DTO.RegionDTO();
                    myRegionDTO.IdRegion = decimal.Parse(wobjDataRow["idRegion"].ToString());

                    YouCom.DTO.PaisDTO myPaisDTO = new YouCom.DTO.PaisDTO();
                    myPaisDTO.IdPais = decimal.Parse(wobjDataRow["idPais"].ToString());

                    myComunaDTO.TheCiudadDTO = myCiudadDTO;
                    myCiudadDTO.TheRegionDTO = myRegionDTO;
                    myRegionDTO.ThePaisDTO   = myPaisDTO;

                    empresa_servicio.TheComunaDTO = myComunaDTO;

                    empresa_servicio.TelefonoEmpresaServicio = wobjDataRow["telefonoEmpresaServicio"].ToString();
                    empresa_servicio.CelularEmpresaServicio  = wobjDataRow["telefonoEmpresaServicio"].ToString();
                    empresa_servicio.EmailEmpresaServicio    = wobjDataRow["emailEmpresaServicio"].ToString();
                    empresa_servicio.UrlEmpresaServicio      = wobjDataRow["urlEmpresaServicio"].ToString();
                    empresa_servicio.LogoEmpresaServicio     = wobjDataRow["logoEmpresaServicio"].ToString();

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

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

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

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

                    IEmpresaServicio.Add(empresa_servicio);
                }
            }

            return(IEmpresaServicio);
        }