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; } }
private void Salvar2(Dictionary <string, object> valores) { oDao.StartTransactionMode(); ClassFunctions.SetProperties(oPessoal, valores); CrudActionTypes evento = oPessoal.Salvar(); oDao.Commit(); }
//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); } }
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; } }
//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; } }