public void Alterar(EntEmail objEmail, Int32 IdUsuario) { using (DbConnection connection = db.CreateConnection()) { connection.Open(); DbTransaction transaction = connection.BeginTransaction(); try { dalEmail.Alterar(objEmail, transaction, db); SaveLog(IdUsuario, EntLog.LOG_EDITAR, "E-mail", objEmail.IdEmail, objEmail, transaction, db); transaction.Commit(); } catch (Exception ex) { transaction.Rollback(); SaveLog(IdUsuario, EntLog.LOG_ERRO, "E-mail", objEmail.IdEmail, objEmail, ex.Message, db, connection); throw; } finally { connection.Close(); } } }
public void Alterar(ModeloEmail modelo) { DalEmail dal = new DalEmail(conexao); dal.Alterar(modelo); }