Exemple #1
0
        public static List <Cause> ListCauses(int riskId)
        {
            List <Cause> List = null;

            try
            {
                List = CauseDAO.getInstance().ListCauses(riskId);
            }
            catch (Exception ex)
            {
                List = new List <Cause>();
            }
            return(List);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        public static bool UpdateCause(int causeId, string description, int percent, int causeType)
        {
            bool response = CauseDAO.getInstance().UpdateCause(causeId, description, percent, causeType);

            return(response);
        }
Exemple #4
0
        public static bool DeleteCause(int causeId)
        {
            bool response = CauseDAO.getInstance().DeleteCause(causeId);

            return(response);
        }
Exemple #5
0
        public static bool SaveCause(String descripcion, int porcentaje, int tipoCausa, int riskId)
        {
            bool response = CauseDAO.getInstance().SaveCause(descripcion, porcentaje, tipoCausa, riskId, Convert.ToInt32(userId));

            return(response);
        }