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)); } }
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")); }
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")); }
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()); }
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)); }
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()); }
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()); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }