public IActionResult Sincronizar(SyncModel model) { //var model = JsonConvert.DeserializeObject<SyncModel>(json); var obj = JsonConvert.DeserializeObject <EstoqueModel>(model.Item); switch (model.Acao) { case TesteHiper.Common.Enumerator.ETipoAcao.Create: _estoqueService.CadastrarEstoque(obj); break; case TesteHiper.Common.Enumerator.ETipoAcao.Update: _estoqueService.AtualizarEstoque(obj); break; case TesteHiper.Common.Enumerator.ETipoAcao.Delete: _estoqueService.ExcluirEstoque(obj.Guid); break; } return(new ObjectResult("")); }
public IActionResult Cadastrar(EstoqueModel model) { _estoqueService.CadastrarEstoque(model); return(RedirectToAction("Index", "Estoque")); }