Пример #1
0
        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(""));
        }
Пример #2
0
 public IActionResult Cadastrar(EstoqueModel model)
 {
     _estoqueService.CadastrarEstoque(model);
     return(RedirectToAction("Index", "Estoque"));
 }