コード例 #1
0
        public CrudActionTypes SalvarComUc(Dictionary <string, object> valoresUC, int idAgente)
        {
            try
            {
                oDao.StartTransactionMode();
                PrepararInclusao();
                ClassFunctions.SetProperties(oDesligamento, valoresUC);
                AgentePublico oAgente = new AgentePublico(idAgente, oDao);
                oAgente.Ativo = false;
                oAgente.Salvar();
                oDesligamento.AgentePublico = oAgente;

                CampoNuloOuInvalidoException ex = oDesligamento.ValidarExterno();
                if (ex.Mensagens.Count > 0)
                {
                    throw ex;
                }

                CrudActionTypes evento = oDesligamento.Salvar();
                oDao.Commit();
                return(evento);
            }
            catch
            {
                oDao.RollBack();
                throw;
            }
        }
コード例 #2
0
        private void Salvar2(Dictionary <string, object> valores)
        {
            oDao.StartTransactionMode();
            ClassFunctions.SetProperties(oPessoal, valores);
            CrudActionTypes evento = oPessoal.Salvar();

            oDao.Commit();
        }
コード例 #3
0
        //public CrudActionTypes Salvar()
        //{
        //    Validar();
        //    ValidarCadastrado();
        //    if (iID == 0)
        //        return oDao.Insert(this);
        //    else
        //        return oDao.Update(this);
        //}

        public CrudActionTypes Salvar()
        {
            Validar();
            if (iID == 0)
            {
                CrudActionTypes oCrudActionTypes = oDao.Insert(this);
                return(oCrudActionTypes);
            }
            else
            {
                CrudActionTypes oCrudActionTypes = oDao.Update(this);
                return(oCrudActionTypes);
            }
        }
コード例 #4
0
 public CrudActionTypes Salvar(Dictionary <string, object> valores)
 {
     try
     {
         oDao.StartTransactionMode();
         ClassFunctions.SetProperties(oPessoal, valores);
         CrudActionTypes evento = oPessoal.Salvar();
         oDao.Commit();
         return(evento);
     }
     catch
     {
         oDao.RollBack();
         throw;
     }
 }
コード例 #5
0
        //public CrudActionTypes Salvar(Dictionary<string, object> valores)
        //{
        //    ClassFunctions.SetProperties(oPessoal, valores);
        //    return oPessoal.Salvar();
        //}

        public CrudActionTypes Excluir()
        {
            try
            {
                oDao.StartTransactionMode();
                Endereco        end    = oPessoal.Endereco;
                CrudActionTypes evento = oPessoal.Excluir();
                end.Excluir();
                oDao.Commit();
                return(evento);
            }
            catch
            {
                oDao.RollBack();
                throw;
            }
        }