コード例 #1
0
        public List <ClsServicio> obtenerServicios()
        {
            List <ClsServicio> listadoServicios        = new List <ClsServicio>();
            List <ClsServicio> listadoServiciosActivos = new List <ClsServicio>();
            DALServicio        oDalServicio            = new DALServicio();

            try
            {
                listadoServicios = oDalServicio.obtenerServicios();

                foreach (ClsServicio _serv in listadoServicios)
                {
                    if (_serv.Activo == true)
                    {
                        listadoServiciosActivos.Add(_serv);
                    }
                }


                //listadoServiciosActivos = this.actualizarCostosEnProductos(listadoServiciosActivos);
            }
            catch (DalExcepcion ex)
            {
                DalExcepcion oDExcepcion = new DalExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oDExcepcion);
            }
            catch (Exception ex)
            {
                BllExcepcion oBExcepcion = new BllExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oBExcepcion);
            }

            return(listadoServiciosActivos);
        }
コード例 #2
0
        public void altaCliente(ClsCliente oCliente, ClsUsuario oUsuario)
        {
            try
            {
                IHash  interfazSeguridad = new Hash();
                string passHasheada      = interfazSeguridad.obtenerHash(oUsuario.password);
                oUsuario.password = passHasheada;

                //Activo el usuario, ya que es un nuevo empleado.
                oUsuario.activo = true;

                DALUsuario oDalUsuario = new DALUsuario();
                oDalUsuario.altaUsuario(oUsuario, oCliente);

                string pDetalle = "Nuevo Cliente generado ID:" + oCliente.nombre.ToString() + " con susuario: " + oUsuario.usr.ToString() + "satisfactoriamente.";
                string pModulo  = "BLL";
                interfazServiceLayer.registrarEventoNegocio(pDetalle, pModulo);
            }
            catch (DalExcepcion ex)
            {
                DalExcepcion oDExcepcion = new DalExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oDExcepcion);
            }
            catch (Exception ex)
            {
                BllExcepcion oBExcepcion = new BllExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oBExcepcion);
            }
        }
コード例 #3
0
        public void altaBusqueda(ClsBusqueda oBusqueda)
        //public void altaBusqueda(ClsBusqueda oBusqueda, int pId_Puesto)
        {
            DALBusqueda oDalBusqueda = new DALBusqueda();

            //DALPuesto oDalPuesto = new DALPuesto();
            //ClsBusqueda oBusqueda = new Busqueda();

            try
            {
                //oPuesto = oDalPuesto.obtenerPuestos(pId_Puesto);
                oBusqueda.Id_Busqueda      = oBusqueda.Id_Busqueda;
                oBusqueda.FechaPublicacion = DateTime.Now;
                oBusqueda.Descripcion      = oBusqueda.Descripcion;
                oBusqueda.Referencia       = oBusqueda.Referencia;
                oBusqueda.activa           = oBusqueda.activa;

                oDalBusqueda.altaBusqueda(oBusqueda);


                string pDetalle = "Se genero la Busqueda " + oBusqueda.Referencia + " satisfactoriamente.";
                string pModulo  = "BLL";
                interfazServiceLayer.registrarEventoNegocio(pDetalle, pModulo);
            }
            catch (DalExcepcion ex)
            {
                DalExcepcion oDExcepcion = new DalExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oDExcepcion);
            }
            catch (Exception ex)
            {
                BllExcepcion oBExcepcion = new BllExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oBExcepcion);
            }
        }
コード例 #4
0
        public string obtenerGruposPorUsuario(string pUsuario)
        {
            List <ClsGrupo> listadoGrupos = new List <ClsGrupo>();
            DALGrupo        oDalGrupo     = new DALGrupo();

            string _grupo = "";

            try
            {
                listadoGrupos = oDalGrupo.obtenerGruposPorUsuario(pUsuario);

                if (listadoGrupos.Count() > 0)
                {
                    _grupo = listadoGrupos[0].codigoGrupo;
                }
            }
            catch (DalExcepcion ex)
            {
                DalExcepcion oDExcepcion = new DalExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oDExcepcion);
            }
            catch (Exception ex)
            {
                BllExcepcion oBExcepcion = new BllExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oBExcepcion);
            }

            return(_grupo);
        }
コード例 #5
0
        public void actualizarDatosCliente(ClsCliente oCliente)
        {
            DALCliente oDalCliente = new DALCliente();

            try
            {
                oDalCliente.actualizarDatosCliente(oCliente);
            }
            catch (DalExcepcion ex)
            {
                DalExcepcion oDExcepcion = new DalExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oDExcepcion);
            }
            catch (Exception ex)
            {
                BllExcepcion oBExcepcion = new BllExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oBExcepcion);
            }
        }
コード例 #6
0
        public void registrarEvento(BllExcepcion oBExcepcion)
        {
            DALBitacora oDalBitacora = new DALBitacora();

            SL.Bitacora.Bitacora oBitacora = new SL.Bitacora.Bitacora();

            try
            {
                oBitacora.fecha   = DateTime.Now;
                oBitacora.modulo  = "BLL";
                oBitacora.detalle = oBExcepcion.Message;
                oBitacora.tipo    = "Critical";

                oDalBitacora.registrarEvento(oBitacora);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #7
0
        public ClsCliente obtenerClientePorId(int pIdCliente)
        {
            ClsCliente oCliente    = new ClsCliente();
            DALCliente oDalCliente = new DALCliente();

            try
            {
                oCliente = oDalCliente.obtenerClientePorIdCliente(pIdCliente);
            }
            catch (DalExcepcion ex)
            {
                DalExcepcion oDExcepcion = new DalExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oDExcepcion);
            }
            catch (Exception ex)
            {
                BllExcepcion oBExcepcion = new BllExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oBExcepcion);
            }

            return(oCliente);
        }
コード例 #8
0
        public List <ClsGrupo> obtenerPuestos()
        {
            List <ClsGrupo> listadoPuestos = new List <ClsGrupo>();
            DALGrupo        oDalGrupo      = new DALGrupo();

            try
            {
                listadoPuestos = oDalGrupo.obtenerPuestos();
            }
            catch (DalExcepcion ex)
            {
                DalExcepcion oDExcepcion = new DalExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oDExcepcion);
            }
            catch (Exception ex)
            {
                BllExcepcion oBExcepcion = new BllExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oBExcepcion);
            }

            return(listadoPuestos);
        }
コード例 #9
0
        public bool verificarExistenciaUsuario(string pUsuario)
        {
            bool resultado = false;

            try
            {
                DALUsuario oDalUsuario = new DALUsuario();

                resultado = oDalUsuario.verificarExistenciaUsuario(pUsuario);
            }
            catch (DalExcepcion ex)
            {
                DalExcepcion oDExcepcion = new DalExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oDExcepcion);
            }
            catch (Exception ex)
            {
                BllExcepcion oBExcepcion = new BllExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oBExcepcion);
            }

            return(resultado);
        }
コード例 #10
0
        //public void altaEmpleado(Empleado oEmpleado, Usuario oUsuario)
        //{

        //    try
        //    {

        //        IHash interfazSeguridad = new Hash();
        //        string passHasheada = interfazSeguridad.obtenerHash(oUsuario.password);
        //        oUsuario.password = passHasheada;

        //        DALGrupo oDalGrupo = new DALGrupo();
        //        oEmpleado.puesto = oDalGrupo.obtenerPuestoPorId(oEmpleado.puesto.idGrupo);

        //        //Activo el usuario, ya que es un nuevo empleado.
        //        oUsuario.activo = true;

        //        DALUsuario oDalUsuario = new DALUsuario();
        //        oDalUsuario.altaUsuario(oUsuario, oEmpleado);

        //        string pDetalle = "Nuevo Empleado generado ID:" + oEmpleado.nombre.ToString() + " con susuario: " + oUsuario.usuario.ToString() + "satisfactoriamente.";
        //        string pModulo = "BLL";
        //        interfazServiceLayer.registrarEventoNegocio(pDetalle, pModulo);


        //    }
        //    catch (DalExcepcion ex)
        //    {
        //        DalExcepcion oDExcepcion = new DalExcepcion(ex.Message);
        //        interfazServiceLayer.registrarEvento(oDExcepcion);
        //    }
        //    catch (Exception ex)
        //    {
        //        BllExcepcion oBExcepcion = new BllExcepcion(ex.Message);
        //        interfazServiceLayer.registrarEvento(oBExcepcion);
        //    }

        //}

        public Boolean validarUsuario(string pUsuario, string pPassword)
        {
            Boolean    resultado   = false;
            DALUsuario oDalUsuario = new DALUsuario();

            try
            {
                string passwordHasheado = intHash.obtenerHash(pPassword);
                resultado = oDalUsuario.validarUsuario(pUsuario, passwordHasheado);
            }
            catch (DalExcepcion ex)
            {
                DalExcepcion oDExcepcion = new DalExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oDExcepcion);
            }
            catch (Exception ex)
            {
                BllExcepcion oBExcepcion = new BllExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oBExcepcion);
            }


            return(resultado);
        }
コード例 #11
0
        public List <ClsGrupo> obtenerGruposPorIdUsuario(int pIdUsuario)
        {
            List <ClsGrupo> listadoGrupos = new List <ClsGrupo>();
            DALGrupo        oDalGrupo     = new DALGrupo();

            pIdUsuario = 2;

            try
            {
                listadoGrupos = oDalGrupo.obtenerGruposPorIdUsuario(pIdUsuario);
            }
            catch (DalExcepcion ex)
            {
                DalExcepcion oDExcepcion = new DalExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oDExcepcion);
            }
            catch (Exception ex)
            {
                BllExcepcion oBExcepcion = new BllExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oBExcepcion);
            }

            return(listadoGrupos);
        }
コード例 #12
0
        public List <ClsDatosPersonales> obtenerDatosPersonales()
        {
            List <ClsDatosPersonales> listadoDatosPersonales = new List <ClsDatosPersonales>();

            DALCV oDalServicio = new DALCV();

            try
            {
                listadoDatosPersonales = oDalServicio.obtenerDatosPersonales();

                foreach (ClsDatosPersonales _dPers in listadoDatosPersonales)
                {
                    //if (_serv.Activo == true)
                    //{
                    //    listadoDatosPersonales.Add(_serv);
                    //}

                    listadoDatosPersonales.Add(_dPers);
                }


                //listadoServiciosActivos = this.actualizarCostosEnProductos(listadoServiciosActivos);
            }
            catch (DalExcepcion ex)
            {
                DalExcepcion oDExcepcion = new DalExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oDExcepcion);
            }
            catch (Exception ex)
            {
                BllExcepcion oBExcepcion = new BllExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oBExcepcion);
            }

            return(listadoDatosPersonales);
        }