public static AnalysisDetail GetAnalysisDetail(int riskId) { AnalysisDetail analysisDetail = new AnalysisDetail(); try { analysisDetail = AnalysisDetailDAO.getInstance().GetAnalysisDetail(riskId); } catch (Exception ex) { analysisDetail = new AnalysisDetail(); } return(analysisDetail); }
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 SaveAnalysisDetail(int impact, int probability, int riskId, string riskType) { bool response = AnalysisDetailDAO.getInstance().SaveAnalysisDetail(impact, probability, riskId, riskType, Convert.ToInt32(userId)); return(response); }