/// <summary> Retrieves in this EffectCollection object all EffectEntity objects which are related via a relation of type 'm:n' with the passed in DecisionNodeEntity. /// All current elements in the collection are removed from the collection.</summary> /// <param name="decisionNodeInstance">DecisionNodeEntity object to be used as a filter in the m:n relation</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param> /// <param name="pageNumber">The page number to retrieve.</param> /// <param name="pageSize">The page size of the page to retrieve.</param> /// <returns>true if the retrieval succeeded, false otherwise</returns> public virtual bool GetMultiManyToManyUsingDecisionNodeCollectionViaRule(IEntity decisionNodeInstance, long maxNumberOfItemsToReturn, ISortExpression sortClauses, int pageNumber, int pageSize) { if (!base.SuppressClearInGetMulti) { this.Clear(); } EffectDAO dao = DAOFactory.CreateEffectDAO(); return(dao.GetMultiUsingDecisionNodeCollectionViaRule(base.Transaction, this, maxNumberOfItemsToReturn, sortClauses, base.EntityFactoryToUse, decisionNodeInstance, pageNumber, pageSize)); }
/// <summary> Retrieves in this EffectCollection object all EffectEntity objects which are related via a relation of type 'm:n' with the passed in PolicyEntity. /// All current elements in the collection are removed from the collection.</summary> /// <param name="policyInstance">PolicyEntity object to be used as a filter in the m:n relation</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param> /// <param name="prefetchPathToUse">the PrefetchPath which defines the graph of objects to fetch.</param> /// <returns>true if the retrieval succeeded, false otherwise</returns> public bool GetMultiManyToManyUsingPolicyCollectionViaRule(IEntity policyInstance, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IPrefetchPath prefetchPathToUse) { if (!base.SuppressClearInGetMulti) { this.Clear(); } EffectDAO dao = DAOFactory.CreateEffectDAO(); return(dao.GetMultiUsingPolicyCollectionViaRule(base.Transaction, this, maxNumberOfItemsToReturn, sortClauses, base.EntityFactoryToUse, policyInstance, prefetchPathToUse)); }
public static List <Effect> ListEffects(int causeId) { List <Effect> List = null; try { List = EffectDAO.getInstance().ListEffects(causeId); } catch (Exception ex) { List = new List <Effect>(); } return(List); }
/// <summary> Gets a scalar value, calculated with the aggregate and expression specified. the field index specified is the field the expression and aggregate are applied on.</summary> /// <param name="fieldIndex">Field index of field to which to apply the aggregate function and expression</param> /// <param name="expressionToExecute">The expression to execute. Can be null</param> /// <param name="aggregateToApply">Aggregate function to apply. </param> /// <param name="filter">The filter to apply to retrieve the scalar</param> /// <param name="relations">The relations to walk</param> /// <param name="groupByClause">The groupby clause to apply to retrieve the scalar</param> /// <returns>the scalar value requested</returns> public virtual object GetScalar(EffectFieldIndex fieldIndex, IExpression expressionToExecute, AggregateFunction aggregateToApply, IPredicate filter, IRelationCollection relations, IGroupByCollection groupByClause) { EntityFields fields = new EntityFields(1); fields[0] = EntityFieldFactory.Create(fieldIndex); if ((fields[0].ExpressionToApply == null) || (expressionToExecute != null)) { fields[0].ExpressionToApply = expressionToExecute; } if ((fields[0].AggregateFunctionToApply == AggregateFunction.None) || (aggregateToApply != AggregateFunction.None)) { fields[0].AggregateFunctionToApply = aggregateToApply; } EffectDAO dao = DAOFactory.CreateEffectDAO(); return(dao.GetScalar(fields, base.Transaction, filter, relations, groupByClause)); }
public static string ToPdf(int projectId) //Este se acerca más { #region html Project project = ProjectDAO.getInstance().GetProjectByCode(projectId); List <Risk> listRisk = RiskDAO.getInstance().ListRisks(projectId); string htmlString = "<table style=\"width: 100%; border: groove;\">" + "<tr style=\"height: 100px;\">" + " <th>" + "<img src=\"imgPronet/logo.png\" style=\"width:200px;\"/>" + "</th>" + "<th>SISTEMA DE GESTIÓN DE RIESGOS DE PROYECTO</th>" + "<th>Código: PRT - SGRP - 2017 </th>" + "</tr> " + "</table>"; htmlString += "<h2 align=\"center\">Proyecto " + project.PROCESS_NAME + "</h2>" + "<h3>Riesgos:</h3>" + "<form style=\"padding: 10px; \">" ; foreach (Risk risk in listRisk) { htmlString += "<ul>" + " <li>"; htmlString += "<label>" + risk.RISK_NAME + "</label></br>"; htmlString += "<label>" + "Tipo: " + risk.RISK_TYPE_NAME + "</label></br>"; htmlString += "<label>" + "Estado: " + risk.STATUS_DESCRIPTION + "</label></br>"; htmlString += "<div style=\"border-style:groove; padding: 10px\">"; List <Cause> listCauses = CauseDAO.getInstance().ListCauses(risk.RISK_ID); if (listCauses.Count > 0) { htmlString += "<label>Identificar: </label>" + "<div style=\"border-style:groove; padding: 10px;\">" + "<label>Causas: </label>" + "<ul>"; foreach (Cause cause in listCauses) { htmlString += " <li>" + " <label>" + cause.CAUSE_DESCRIPTION + "</label>" + " <br />" + " <label>" + "Tipo: " + cause.CAUSE_TYPE_NAME + "</label>" + " <br />" + " <label>" + "Porcentaje: " + cause.CAUSE_PERCENT + "%</label>"; List <Effect> listEffect = EffectDAO.getInstance().ListEffects(cause.CAUSE_ID); if (listEffect.Count > 0) { htmlString += " <br />" + " <strong><label>Consecuencias: </label></strong>" + " <ul>"; foreach (Effect effect in listEffect) { htmlString += " <li> " + " <label>" + effect.DESCRIPTION + "</label>" + " </li>"; } htmlString += "</ul>"; } htmlString += "</li>"; } htmlString += " </ul>"; htmlString += "</div>"; } //htmlString+= "</div>"; AnalysisDetail analysisDetail = AnalysisDetailDAO.getInstance().GetAnalysisDetail(risk.RISK_ID); if (analysisDetail != null) { htmlString += "<label>Detalle de Análisis: </label>" + "<div style=\"border-style:groove; padding: 10px;\">"; htmlString += "<label>Impacto: " + analysisDetail.IMPACT_DESCRIPTION + " </label></br>"; htmlString += "<label>Probabilidad: " + analysisDetail.PROBABILITY_DESCRIPTION + " </label></br>"; htmlString += "<label>Severidad: " + analysisDetail.SEVERIDAD + " </label>"; htmlString += "</div>"; } Treatment treatment = TreatmentDAO.getInstance().GetTreatment(risk.RISK_ID); if (treatment != null) { htmlString += "<label>Tratamiento: </label>" + "<div style=\"border-style:groove; padding: 10px;\">"; htmlString += "<label>Control: " + treatment.CONTROL_NAME + " </label></br>"; htmlString += "<label>Persona encargada: " + treatment.PERSON_IN_CHARGE + " </label></br>"; htmlString += "<label>Descripción: " + treatment.TREATMENT_DESCRIPTION + " </label></br>"; htmlString += "<label>Respuesta al riesgo: " + treatment.RISK_RESPONSE_DESCRIPTION + " </label>"; htmlString += "</div>"; if (treatment.DATE_IMPLEMENTATION != null) { htmlString += "<label>Implementación: </label>" + "<div style=\"border-style:groove; padding: 10px;\">"; htmlString += "<label>Fecha: " + treatment.DATE_IMPLEMENTATION.ToString("dd/MM/yyyy") + " </label></br>"; htmlString += "</div>"; } //htmlString += "</div>"; } htmlString += "</div>"; htmlString += "</li>"; //fin del riesgo htmlString += "</ul>"; } htmlString += "</form>"; #endregion return(htmlString); }
public static bool DeleteEffect(int effectId) { bool response = EffectDAO.getInstance().DeleteEffect(effectId); return(response); }
public static bool UpdateEffect(string description, int effectId) { bool response = EffectDAO.getInstance().UpdateEffect(description, effectId); return(response); }
public static bool SaveEffect(string description, int effectType, int causeId) { bool response = EffectDAO.getInstance().SaveEffect(description, effectType, causeId, Convert.ToInt32(userId)); return(response); }
/// <summary> Retrieves Entity rows in a datatable which match the specified filter. It will always create a new connection to the database.</summary> /// <param name="selectFilter">A predicate or predicate expression which should be used as filter for the entities to retrieve.</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param> /// <param name="relations">The set of relations to walk to construct to total query.</param> /// <param name="pageNumber">The page number to retrieve.</param> /// <param name="pageSize">The page size of the page to retrieve.</param> /// <returns>DataTable with the rows requested.</returns> public static DataTable GetMultiAsDataTable(IPredicate selectFilter, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IRelationCollection relations, int pageNumber, int pageSize) { EffectDAO dao = DAOFactory.CreateEffectDAO(); return(dao.GetMultiAsDataTable(maxNumberOfItemsToReturn, sortClauses, selectFilter, relations, pageNumber, pageSize)); }