Пример #1
0
        public IActionResult Mensaje(int id)
        {
            var em = new MenuViewModel();

            ViewData["FilterMenu"] = em.menu;
            if (id > 0)
            {
                var ad  = new AdaptadorAtcAdmin(_configuration);
                var msj = ad.MensajeLeerPorId(-1, 0, id);
                if (msj.IdCliente < 1)
                {
                    msj.Cliente = "Todos";
                }
                ViewData["Mensaje"] = msj;
                ViewData["Api"]     = _endPoint;
                return(View(msj));
            }
            else
            {
                var msj = new MensajeWeb();
                if (msj.IdCliente < 1)
                {
                    msj.Cliente = "Todos";
                }
                ViewData["Mensaje"] = msj;
                ViewData["Api"]     = _endPoint;
                return(View(msj));
            }
        }
Пример #2
0
        public IActionResult ModificarMensaje([FromForm] MensajeWeb msj)
        {
            var em = new MenuViewModel();
            var ad = new AdaptadorAtcAdmin(_configuration);

            ad.MensajeModificar(msj);
            ViewData["Api"] = _endPoint;
            return(RedirectToAction("Mensajes", "Home"));
        }
Пример #3
0
        public IActionResult EliminarMensaje(int id)
        {
            //var em = new MenuViewModel();
            //ViewData["FilterMenu"] = em.menu;
            var ad = new AdaptadorAtcAdmin(_configuration);

            ad.MensajeEliminar(id);
            ViewData["Api"] = _endPoint;
            return(RedirectToAction("Mensajes", "Home"));
        }
Пример #4
0
        public IActionResult Mensajes()
        {
            var em = new MenuViewModel();

            ViewData["FilterMenu"] = em.menu;
            var ad  = new AdaptadorAtcAdmin(_configuration);
            var msj = ad.MensajeLeer(-1, 0);

            ViewData["Mensajes"] = msj;
            ViewData["Api"]      = _endPoint;
            return(View());
        }
Пример #5
0
        public IActionResult Web()
        {
            var em = new MenuViewModel();

            ViewData["FilterMenu"] = em.menu;
            ViewData["Message"]    = "";
            var ad = new AdaptadorAtcAdmin(_configuration);
            var b  = ad.DatosEmpresaLeer();

            ViewData["Api"] = _endPoint;
            return(View(b));
        }
Пример #6
0
        public IActionResult Marca(int id)
        {
            var em = new MenuViewModel();

            ViewData["FilterMenu"] = em.menu;
            var ad = new AdaptadorAtcAdmin(_configuration);
            //var c = Int32.Parse(IDSeccion);
            var mc = ad.MarcasLeerPorID(id);

            ViewData["Marca"]   = mc;
            ViewData["Message"] = "Modelos de " + mc.DescripcionSeccion;
            ViewData["Api"]     = _endPoint;
            return(View());
        }
Пример #7
0
        public IActionResult Modelo(int id)
        {
            var em = new MenuViewModel();

            ViewData["FilterMenu"] = em.menu;
            var ad = new AdaptadorAtcAdmin(_configuration);
            //var c = Int32.Parse(IDSeccion);
            var md = ad.ModelosLeerPorID(id);
            var vh = ad.TiposVehiculoLeer();

            ViewData["Modelo"]        = md;
            ViewData["Message"]       = "Carrocerias de " + md.DescripcionFamilia;
            ViewData["TiposVehiculo"] = vh;
            ViewData["Api"]           = _endPoint;
            return(View());
        }
Пример #8
0
        public IActionResult PermisosUsuarioModificar([FromBody] EmpresaWeb empr, int idUsuarioWeb)
        {
            ObjectResult result;
            var          ad = new AdaptadorAtcAdmin(_configuration);

            try
            {
                ad.PermisosUsuarioModificar(empr, idUsuarioWeb);
                result = new ObjectResult(1)
                {
                    StatusCode = (int)HttpStatusCode.OK
                };
            }
            catch (Exception ex)
            {
                result = new ObjectResult(ex)
                {
                    StatusCode = (int)HttpStatusCode.Conflict
                };
                Request.HttpContext.Response.Headers.Add("dsError", ex.Message);
            }
            return(result);
        }
Пример #9
0
        public IActionResult ImagenesCabWeb_Procesar([FromBody] ImagenCabWeb img)
        {
            ObjectResult result;
            var          ad = new AdaptadorAtcAdmin(_configuration);

            try
            {
                var res = ad.ImagenCabWeb_Procesar(img);
                result = new ObjectResult(res)
                {
                    StatusCode = (int)HttpStatusCode.OK
                };
            }
            catch (Exception ex)
            {
                result = new ObjectResult(ex)
                {
                    StatusCode = (int)HttpStatusCode.Conflict
                };
                Request.HttpContext.Response.Headers.Add("dsError", ex.Message);
            }
            return(result);
        }
Пример #10
0
        public IActionResult ClientesLeer([FromBody] PaginacionClientes cl)
        {
            ObjectResult result;
            var          ad = new AdaptadorAtcAdmin(_configuration);

            try
            {
                var res = ad.ClientesLeer(cl.pagina, cl.bloque, cl.nCliente);
                result = new ObjectResult(res)
                {
                    StatusCode = (int)HttpStatusCode.OK
                };
            }
            catch (Exception ex)
            {
                result = new ObjectResult(ex)
                {
                    StatusCode = (int)HttpStatusCode.Conflict
                };
                Request.HttpContext.Response.Headers.Add("dsError", ex.Message);
            }
            return(result);
        }
Пример #11
0
        public IActionResult MarcasEliminar(int IDSeccion)
        {
            ObjectResult result;
            var          ad = new AdaptadorAtcAdmin(_configuration);

            try
            {
                ad.MarcasEliminar(IDSeccion);
                result = new ObjectResult(1)
                {
                    StatusCode = (int)HttpStatusCode.OK
                };
            }
            catch (Exception ex)
            {
                result = new ObjectResult(ex)
                {
                    StatusCode = (int)HttpStatusCode.Conflict
                };
                Request.HttpContext.Response.Headers.Add("dsError", ex.Message);
            }
            return(result);
        }
Пример #12
0
        public IActionResult ModelosCrearModificar([FromBody] Modelo modelo)
        {
            ObjectResult result;
            var          ad = new AdaptadorAtcAdmin(_configuration);

            try
            {
                var res = ad.ModelosCrearModificar(modelo);
                result = new ObjectResult(res)
                {
                    StatusCode = (int)HttpStatusCode.OK
                };
            }
            catch (Exception ex)
            {
                result = new ObjectResult(ex)
                {
                    StatusCode = (int)HttpStatusCode.Conflict
                };
                Request.HttpContext.Response.Headers.Add("dsError", ex.Message);
            }
            return(result);
        }
Пример #13
0
        public IActionResult DomiciliosLeerPorIDCliente(int idCliente)
        {
            ObjectResult result;
            var          ad = new AdaptadorAtcAdmin(_configuration);

            try
            {
                var res = ad.DomiciliosLeerPorIDCliente(idCliente);
                result = new ObjectResult(res)
                {
                    StatusCode = (int)HttpStatusCode.OK
                };
            }
            catch (Exception ex)
            {
                result = new ObjectResult(ex)
                {
                    StatusCode = (int)HttpStatusCode.Conflict
                };
                Request.HttpContext.Response.Headers.Add("dsError", ex.Message);
            }
            return(result);
        }
Пример #14
0
        public IActionResult TiposVidrioLeerPorID(int IDTipoVidrio)
        {
            ObjectResult result;
            var          ad = new AdaptadorAtcAdmin(_configuration);

            try
            {
                var res = ad.TiposVidrioLeerPorID(IDTipoVidrio);
                result = new ObjectResult(res)
                {
                    StatusCode = (int)HttpStatusCode.OK
                };
            }
            catch (Exception ex)
            {
                result = new ObjectResult(ex)
                {
                    StatusCode = (int)HttpStatusCode.Conflict
                };
                Request.HttpContext.Response.Headers.Add("dsError", ex.Message);
            }
            return(result);
        }
Пример #15
0
        public IActionResult ArticulosLeerPorCategoriaYCadena(int IDCategoria, string cadena)
        {
            ObjectResult result;
            var          ad = new AdaptadorAtcAdmin(_configuration);

            try
            {
                var res = ad.ArticulosLeerPorCategoriaYCadena(IDCategoria, cadena);
                result = new ObjectResult(res)
                {
                    StatusCode = (int)HttpStatusCode.OK
                };
            }
            catch (Exception ex)
            {
                result = new ObjectResult(ex)
                {
                    StatusCode = (int)HttpStatusCode.Conflict
                };
                Request.HttpContext.Response.Headers.Add("dsError", ex.Message);
            }
            return(result);
        }
Пример #16
0
        public IActionResult UsuariosWebEliminar(int IDUsuarioWeb)
        {
            ObjectResult result;
            var          ad = new AdaptadorAtcAdmin(_configuration);

            try
            {
                ad.UsuariosWebEliminar(IDUsuarioWeb);
                //var res = new EsquemaViewModel(carr);
                result = new ObjectResult(1)
                {
                    StatusCode = (int)HttpStatusCode.OK
                };
            }
            catch (Exception ex)
            {
                result = new ObjectResult(ex)
                {
                    StatusCode = (int)HttpStatusCode.Conflict
                };
                Request.HttpContext.Response.Headers.Add("dsError", ex.Message);
            }
            return(result);
        }
Пример #17
0
        public IActionResult TiposVehiculoEliminar(int IDTipoVehiculo)
        {
            ObjectResult result;
            var          ad = new AdaptadorAtcAdmin(_configuration);

            try
            {
                //var res = new LecturasViewModel(_configuration, bs);
                ad.TiposVehiculoEliminar(IDTipoVehiculo);
                result = new ObjectResult(1)
                {
                    StatusCode = (int)HttpStatusCode.OK
                };
            }
            catch (Exception ex)
            {
                result = new ObjectResult(ex)
                {
                    StatusCode = (int)HttpStatusCode.Conflict
                };
                Request.HttpContext.Response.Headers.Add("dsError", ex.Message);
            }
            return(result);
        }
Пример #18
0
        public IActionResult MarcasLeerPorCadena(string cadena)
        {
            ObjectResult result;
            var          ad = new AdaptadorAtcAdmin(_configuration);

            try
            {
                //var res = new LecturasViewModel(_configuration, bs);
                var res = ad.MarcasLeerPorCadena(cadena);
                result = new ObjectResult(res)
                {
                    StatusCode = (int)HttpStatusCode.OK
                };
            }
            catch (Exception ex)
            {
                result = new ObjectResult(ex)
                {
                    StatusCode = (int)HttpStatusCode.Conflict
                };
                Request.HttpContext.Response.Headers.Add("dsError", ex.Message);
            }
            return(result);
        }
Пример #19
0
        public IActionResult ArticulosModificar([FromBody] BuscaArticulo bs)
        {
            ObjectResult result;
            var          ad = new AdaptadorAtcAdmin(_configuration);

            try
            {
                //var res = new LecturasViewModel(_configuration, bs);
                var res = ad.ArticulosModificar(bs);
                result = new ObjectResult(res)
                {
                    StatusCode = (int)HttpStatusCode.OK
                };
            }
            catch (Exception ex)
            {
                result = new ObjectResult(ex)
                {
                    StatusCode = (int)HttpStatusCode.Conflict
                };
                Request.HttpContext.Response.Headers.Add("dsError", ex.Message);
            }
            return(result);
        }