public bool ExistePorProcessoERegraEStatus(int processoId, int regraId, RegraVioladaStatus status) { return(this.Session.QueryOver <RegraViolada>() .Where(x => x.Processo.Id == processoId) .Where(x => x.Status == status) .Where(x => x.Regra.Id == regraId) .RowCount() > 0); }
public void AlterarStatus(int id, RegraVioladaStatus status) { this.Session .CreateQuery("update RegraViolada set Status = :status where Id = :id") .SetInt32("id", id) .SetParameter("status", status) .ExecuteUpdate(); }
public int ObterTotalPorProcessoEStatusRegra(int regraId, int processoId, RegraVioladaStatus status) { return(this.Session.QueryOver <RegraViolada>() .Where(x => x.Status == status) .And(x => x.Id == regraId) .JoinQueryOver(x => x.Processo) .Where(x => x.Id == processoId) .RowCount()); }
public void AlterarStatus(Processo processo, int regraId, RegraVioladaStatus statusAtual, RegraVioladaStatus statusNovo) { this.Session .CreateQuery(@" update RegraViolada set Status = :statusNovo where Processo.Id = :processoId and Status = :statusAtual and Regra.Id = :regraId") .SetParameter("statusNovo", statusNovo) .SetParameter("processoId", processo.Id) .SetParameter("statusAtual", statusAtual) .SetParameter("regraId", regraId) .ExecuteUpdate(); }