Beispiel #1
0
        public void Put(int pessoaId, FuncionarioModel funcionario)
        {
            try
            {
                var where = $"PESSOA_ID = {pessoaId}";
                if (string.IsNullOrEmpty(MetodosGenericosService.DlookupOrcamentaria("PESSOA_ID", "T_ORCA_FUNCIONARIO", where)))
                {
                    throw new Exception();
                }

                if (funcionario.TIPO_CADASTRO != "Funcionario")
                {
                    throw new Exception();
                }
                var pessoa   = MetodosGenericosService.CopiarPropriedadesObj(funcionario, new PessoaModel());
                var pessoaDB = PessoaService.GetComParametro(new PessoaQO(pessoaId, "")).ToArray()[0];

                ComparisonResult resultando = new CompareLogic().Compare(pessoa, pessoaDB);

                if (!resultando.AreEqual)
                {
                    var res = resultando.Differences;

                    PessoaService.Put(pessoaId, pessoa);
                }

                FuncionarioRepository.Update(pessoaId, funcionario);
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #2
0
 public void Put(int pessoaId, [FromBody] PessoaModel pessoa)
 {
     try
     {
         PessoaService.Put(pessoaId, pessoa);
     }
     catch (Exception)
     {
         throw;
     }
 }