Exemplo n.º 1
0
        public ActionResult Index(string pUsuario, string pMostrarMensaje, string pMensaje)
        {
            this.inicializar_barra_superior();
            this.inicializar_barra_lateral();
            this.inicializar_contenido();

            List <ClsServicio> listadoServicios = new List <ClsServicio>();

            try
            {
                listadoServicios = intNegGestionServicio.obtenerServicios();

                if (Session["Perfil"] == null)
                {
                    Session["Perfil"] = "";
                }

                if (Session["usuario"] == null || Session["usuario"].ToString().ToLower() == "invitado")
                {
                    if (pUsuario != null)
                    {
                        Session["usuario"] = pUsuario;

                        //obtengo el perfil del usuario
                        string pPerfil = intNegAbmCliente.obtenerGruposPorUsuario(pUsuario);
                        Session["Perfil"] = pPerfil;
                    }
                    else
                    {
                        Session["usuario"] = "Invitado";
                    }
                }
                else if (Session["usuario"] != null)
                {
                    if (pUsuario != null)
                    {
                        Session["usuario"] = pUsuario;

                        //obtengo el perfil del usuario
                        string pPerfil = intNegAbmCliente.obtenerGruposPorUsuario(pUsuario);
                        Session["Perfil"] = pPerfil;
                    }
                }
            }
            catch (Exception ex)
            {
                WebExcepcion oWExcepcion = new WebExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oWExcepcion);
            }

            if (pMensaje != null && pMostrarMensaje != null)
            {
                @ViewBag.mostrarMensaje = pMostrarMensaje;
                @ViewBag.mensaje        = pMensaje;
            }


            return(View(listadoServicios));
        }
Exemplo n.º 2
0
        public ActionResult Index(ClsServicio oServicio)
        {
            try
            {
                oServicio.listaServicios.Add(oServicio);
            }
            catch (Exception ex)
            {
                WebExcepcion oWExcepcion = new WebExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oWExcepcion);
            }

            return(View());
        }
Exemplo n.º 3
0
        public ActionResult verificarCodigo(string pCodigo)
        {
            bool resultado = false;

            try
            {
                //resultado = interfazABMCliente.verificarExistenciaCodigoProducto(pCodigo);
            }
            catch (Exception ex)
            {
                WebExcepcion oWExcepcion = new WebExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oWExcepcion);
            }

            return(Json(resultado, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 4
0
        public ActionResult altaBusqueda()
        {
            this.inicializar_contenido();

            try
            {
                //var listadoPuestos = intNegGestionServicio.obtenerPuestos();
                //ViewBag.Id_Puesto = new SelectList(listadoPuestos, "Id_Puesto", "DescripciónPuesto");
            }
            catch (Exception ex)
            {
                WebExcepcion oWExcepcion = new WebExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oWExcepcion);
            }

            return(View());
        }
Exemplo n.º 5
0
        public ActionResult Bitacora()
        {
            this.inicializar_contenido();

            List <Bitacora> listadoEventos = new List <Bitacora>();

            try
            {
                listadoEventos = interfazServiceLayer.obtenerEventos();
            }
            catch (Exception ex)
            {
                WebExcepcion oWExcepcion = new WebExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oWExcepcion);
            }

            return(View(listadoEventos));
        }
Exemplo n.º 6
0
        public ActionResult Busqueda()
        {
            this.inicializar_contenido();

            List <ClsBusqueda> listadoBusquedas = new List <ClsBusqueda>();

            try
            {
                listadoBusquedas = intNegGestionServicio.obtenerBusquedas();
            }
            catch (Exception ex)
            {
                WebExcepcion oWExcepcion = new WebExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oWExcepcion);
            }

            return(View(listadoBusquedas));
        }
Exemplo n.º 7
0
        public ActionResult verificarExistenciaUsuario(string pUsuario)
        {
            bool resultado = false;

            try
            {
                resultado = interfazAbmCliente.verificarExistenciaUsuario(pUsuario);
            }
            catch (Exception ex)
            {
                WebExcepcion oWExcepcion = new WebExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oWExcepcion);
            }



            return(RedirectToAction("altaCV", "Account"));
        }
Exemplo n.º 8
0
        public ActionResult editarCliente(int pIdCliente)
        {
            ClsCliente oCliente = new ClsCliente();

            try
            {
                oCliente = intNegAbmCliente.obtenerClientePorId(pIdCliente);
                //var listadoOpcionesDePago = intNegAbmCliente.obtenerOpcionesDePago();
                //ViewBag.opcionDePago = new SelectList(listadoOpcionesDePago, "idOpcionDePago", "nombre");
            }
            catch (Exception ex)
            {
                WebExcepcion oWExcepcion = new WebExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oWExcepcion);
            }

            return(View(oCliente));
        }
Exemplo n.º 9
0
        public ActionResult DetalleCliente(string pUsuario)
        {
            Web.Models.DetalleCliente oDetalleCliente = new Web.Models.DetalleCliente();
            ClsCliente oCliente = new ClsCliente();

            try
            {
                oCliente = intNegAbmCliente.obtenerClientePorUsuario(pUsuario);
                if (oCliente.nombre != null)
                {
                    oDetalleCliente.idCliente = oCliente.idCliente;
                    oDetalleCliente.nombre    = oCliente.nombre;
                    oDetalleCliente.email     = oCliente.mail;
                    oDetalleCliente.direccion = oCliente.direccion;
                    oDetalleCliente.telefono  = oCliente.telefono;

                    //if (oCliente.opcionDePago != null)
                    //{
                    //    oDetalleCliente.opcionDePago = oCliente.opcionDePago;
                    //}

                    //if (oCliente.oEmpleado != null)
                    //{
                    //    oDetalleCliente.oEmpleado = oCliente.oEmpleado;
                    //}

                    //    oDetalleCliente.listadoPedidos = intNegGestionPedido.obtenerPedidosDeCliente(oCliente.idCliente);
                }
                else
                {
                    ViewBag.mostrarMensaje = "ERROR";
                    ViewBag.mensaje        = "Se produjo un error al obtener la información del cliente";

                    return(View(oDetalleCliente));
                }
            }
            catch (Exception ex)
            {
                WebExcepcion oWExcepcion = new WebExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oWExcepcion);
            }

            return(View(oDetalleCliente));
        }
Exemplo n.º 10
0
        public ActionResult CandidatosporBusqueda(string pValor)
        {
            List <ClsBusqueda> listadoCandidatos = new List <ClsBusqueda>();

            try
            {
                if (pValor != "")
                {
                    listadoCandidatos = intNegGestionPostulante.CandidatosporBusqueda(pValor);
                }
            }
            catch (Exception ex)
            {
                WebExcepcion oWExcepcion = new WebExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oWExcepcion);
            }

            return(View("Postulante", listadoCandidatos));
        }
Exemplo n.º 11
0
        public ActionResult buscarBusquedas(string pValor)
        {
            List <ClsBusqueda> listadoBusquedas = new List <ClsBusqueda>();

            try
            {
                if (pValor != "")
                {
                    listadoBusquedas = intNegGestionServicio.buscarBusquedas(pValor);
                }
            }
            catch (Exception ex)
            {
                WebExcepcion oWExcepcion = new WebExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oWExcepcion);
            }

            return(View("Busqueda", listadoBusquedas));
        }
Exemplo n.º 12
0
        public ActionResult buscarPostulantesID(int pValor)
        {
            List <ClsBusqueda> listadoCandidatos = new List <ClsBusqueda>();

            try
            {
                if (pValor != 0)
                {
                    listadoCandidatos = intNegGestionPostulante.buscarPostulantesID(pValor);
                }
            }
            catch (Exception ex)
            {
                WebExcepcion oWExcepcion = new WebExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oWExcepcion);
            }

            return(View("evaluarPostulantes", listadoCandidatos));
        }
Exemplo n.º 13
0
        public ActionResult buscarEventos(string pValor)
        {
            List <Bitacora> listadoEventos = new List <Bitacora>();

            try
            {
                if (pValor != "")
                {
                    listadoEventos = interfazServiceLayer.buscarEventos(pValor);
                }
            }
            catch (Exception ex)
            {
                WebExcepcion oWExcepcion = new WebExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oWExcepcion);
            }

            return(View("Bitacora", listadoEventos));
        }
Exemplo n.º 14
0
        public void registrarEvento(WebExcepcion oWExcepcion)
        {
            DALBitacora oDalBitacora = new DALBitacora();

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

            try
            {
                oBitacora.fecha   = DateTime.Now;
                oBitacora.modulo  = "WEB";
                oBitacora.detalle = oWExcepcion.Message;
                oBitacora.tipo    = "Critical";

                oDalBitacora.registrarEvento(oBitacora);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 15
0
        public ActionResult altaBusqueda(ClsBusqueda oBusqueda)
        {
            try
            {
                //int pId_Puesto = Id_Puesto;
                intNegGestionServicio.altaBusqueda(oBusqueda);

                ViewBag.mostrarMensaje = "OK";
                ViewBag.mensaje        = "Busqueda generada correctamente";
            }
            catch (Exception ex)
            {
                ViewBag.mostrarMensaje = "ERROR";
                ViewBag.mensaje        = "Se produjo un error al generar la Busqueda";

                WebExcepcion oWExcepcion = new WebExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oWExcepcion);
            }


            return(View());
        }
Exemplo n.º 16
0
        public ActionResult AntenasHF()
        {
            List <ClsServicio> listadoServicios = new List <BI.ClsServicio>();

            try
            {
                listadoServicios = intNegGestionServicio.obtenerServicios();


                //Para la cantidad al lado del usuario USUARIO(CANTIDAD)
                if (Models.ListadosGlobales.listadoServicios.Count > 0)
                {
                    foreach (ClsServicio oServicio in Models.ListadosGlobales.listadoServicios)
                    {
                        //if (oServicio.sesionId == Session.SessionID)
                        //{
                        ViewBag.Cantidad = oServicio.listaServicios.Count();
                        break;
                        //}
                        //else
                        //{
                        //    ViewBag.Cantidad = 0;
                        //}
                    }
                }
                else
                {
                    ViewBag.Cantidad = 0;
                }
            }
            catch (Exception ex)
            {
                WebExcepcion oWExcepcion = new WebExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oWExcepcion);
            }

            return(View(listadoServicios));
        }
Exemplo n.º 17
0
        public ActionResult login(Web.Models.LoginModel oLoginModel)
        {
            Boolean resultado = false;

            try
            {
                resultado = interfazAbmCliente.validarUsuario(oLoginModel.usr, oLoginModel.password);
            }
            catch (Exception ex)
            {
                WebExcepcion oWExcepcion = new WebExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oWExcepcion);
            }


            if (resultado == true)
            {
                //Validación correcta

                ClsUsuario oUsuario = new ClsUsuario();
                oUsuario.usr      = oLoginModel.usr;
                oUsuario.password = oLoginModel.password;
                Web.Models.ListadosGlobales.listadoUsuariosLogueados.Add(oUsuario);
                //return RedirectToAction("Account", "altaCV", new { pUsuario = oLoginModel.usr.ToString() });
                return(RedirectToAction("Index", "Home", new { pUsuario = oLoginModel.usr.ToString() }));
            }
            else
            {
                //Validación incorrecta
                ViewBag.mostrarMensaje = "ERROR";
                ViewBag.mensaje        = "Usuario y/o contraseña incorrecta, por favor ingreselos nuevamente";


                return(View());
            }
        }
Exemplo n.º 18
0
        public ActionResult editarCliente(ClsCliente oCliente, int opcionDePago, string pUsuario)
        {
            try
            {
                bool bandera = true;

                if (oCliente.nombre == null)
                {
                    bandera = false;
                }

                if (oCliente.telefono == null)
                {
                    bandera = false;
                }

                if (oCliente.direccion == null)
                {
                    bandera = false;
                }

                if (oCliente.mail == null)
                {
                    bandera = false;
                }


                if (bandera == true)
                {
                    //Verificar que el objeto este completo
                    //OpcionDePago oOpcionDePago = new OpcionDePago();
                    //oOpcionDePago.idOpcionDePago = opcionDePago;
                    //oCliente.opcionDePago = oOpcionDePago;

                    intNegAbmCliente.actualizarDatosCliente(oCliente);

                    //var listadoOpcionesDePago = intNegAbmCliente.obtenerOpcionesDePago();
                    //ViewBag.opcionDePago = new SelectList(listadoOpcionesDePago, "idOpcionDePago", "nombre");

                    ViewBag.mostrarMensaje = "OK";
                    ViewBag.mensaje        = "Datos modificados correctamente";
                }
                else
                {
                    ViewBag.mostrarMensaje = "ERROR";
                    ViewBag.mensaje        = "No deben existir campos vacíos, por favor verifique la información ingresada";

                    //var listadoOpcionesDePago = intNegAbmCliente.obtenerOpcionesDePago();
                    //ViewBag.opcionDePago = new SelectList(listadoOpcionesDePago, "idOpcionDePago", "nombre");

                    return(View(oCliente));
                }
            }
            catch (Exception ex)
            {
                WebExcepcion oWExcepcion = new WebExcepcion(ex.Message);
                interfazServiceLayer.registrarEvento(oWExcepcion);

                ViewBag.mostrarMensaje = "ERROR";
                ViewBag.mensaje        = "Se produjo un error al actualizar los datos";
            }

            return(RedirectToAction("DetalleCliente", "Home", new { pUsuario = pUsuario }));
        }