Exemple #1
0
        public HttpResponseMessage GetById(int id)
        {
            Inventario items = c.GetById(id);

            if (items == null)
            {
                //Construyendo respuesta del servidor
                return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "No hay ningun Inventario con el id " + id));
            }
            return(Request.CreateResponse(HttpStatusCode.OK, items));
        }
Exemple #2
0
        public IActionResult Edit(int id)
        {
            var viewModel = new InventariosEditViewModel()
            {
                SucursalId = SucursalId, UsuarioId = UserId
            };

            var inventario = _inventario.GetById(id);


            viewModel.DetalleInventario = GetDetalleInventario(inventario);
            viewModel = Mapper.Map(inventario, viewModel);

            return(View(viewModel));
        }