Пример #1
0
        public static List <Risk> ListRisks(int projectId)
        {
            List <Risk> List = null;

            try
            {
                List = RiskDAO.getInstance().ListRisks(projectId);
            }
            catch (Exception ex)
            {
                List = new List <Risk>();
            }
            return(List);
        }
Пример #2
0
        protected void btnConsultar2_Click(object sender, EventArgs e)
        {
            string desde = ddlRango1.SelectedValue;
            string hasta = ddlRango2.SelectedValue;

            List <Risk> risks = RiskDAO.getInstance().ListRisksFilter(Convert.ToInt32(desde), Convert.ToInt32(hasta));

            rpv2.Reset();
            rpv2.LocalReport.ReportPath = Server.MapPath("reportes/Reporte1.rdlc");

            ReportDataSource rds = new ReportDataSource("DataSet1", risks);

            rpv2.LocalReport.DataSources.Clear();
            rpv2.LocalReport.DataSources.Add(rds);
            rpv2.DataBind();
            rpv2.LocalReport.Refresh();
        }
Пример #3
0
        //protected void btnConsultar1_Click(object sender, EventArgs e)
        //{
        //    string desde = ddlRango1.SelectedValue;
        //    string hasta = ddlRango2.SelectedValue;

        //    List<Risk> risks = RiskDAO.getInstance().RisksByStatusCount(Convert.ToInt32(desde), Convert.ToInt32(hasta));

        //}

        public string obtenerDatos()
        {
            string desde = ddlRango1.SelectedValue;
            string hasta = ddlRango2.SelectedValue;

            List <Risk> risks = RiskDAO.getInstance().RisksByStatusCount(Convert.ToInt32(desde), Convert.ToInt32(hasta));

            DataTable Datos = new DataTable();

            Datos.Columns.Add(new DataColumn("Estado", typeof(string)));
            Datos.Columns.Add(new DataColumn("Cantidad", typeof(string)));

            int cerrado = 0;
            int abierto = 0;

            foreach (Risk r in risks)
            {
                if (r.STATUS_DESCRIPTION == "Cerrado")
                {
                    cerrado++;
                }
                if (r.STATUS_DESCRIPTION == "Abierto")
                {
                    abierto++;
                }
            }
            Datos.Rows.Add(new Object[] { "Cerrado", cerrado });
            Datos.Rows.Add(new Object[] { "Abierto", abierto });

            string strDatos;

            strDatos = "[['Estado', 'Cantidad'],";

            foreach (DataRow dr in Datos.Rows)
            {
                strDatos = strDatos + "[";
                strDatos = strDatos + "'" + dr[0] + "'" + "," + dr[1];
                strDatos = strDatos + "],";
            }
            strDatos = strDatos.Substring(0, strDatos.Length - 1);
            strDatos = strDatos + "]";
            return(strDatos);
        }
Пример #4
0
        public static int[] lista1(int desde, int hasta)
        {
            List <Risk> risks = RiskDAO.getInstance().RisksByStatus(desde, hasta);

            int[] estados = new int[2];
            int   cerrado = 0;
            int   abierto = 0;

            foreach (Risk r in risks)
            {
                if (r.STATUS_DESCRIPTION == "Cerrado")
                {
                    cerrado++;
                }
                if (r.STATUS_DESCRIPTION == "Abierto")
                {
                    abierto++;
                }
            }
            estados = new int[] { abierto, cerrado };

            return(estados);
        }
Пример #5
0
        public static int[] lista2(int desde, int hasta)
        {
            List <Risk> risks = RiskDAO.getInstance().ListRisksFilter(desde, hasta);

            int[] tipos     = new int[2];
            int   logistico = 0;
            int   operativo = 0;

            foreach (Risk r in risks)
            {
                if (r.RISK_TYPE_NAME == "Logístico")
                {
                    logistico++;
                }
                if (r.RISK_TYPE_NAME == "Operativo")
                {
                    operativo++;
                }
            }

            tipos = new int[] { logistico, operativo };

            return(tipos);
        }
Пример #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     riskList = RiskDAO.getInstance().RisksByStatusCount(1, 12);
 }
Пример #7
0
        public static bool CloseRisk(int riskId)
        {
            bool ok = RiskDAO.getInstance().CloseRisk(riskId);

            return(ok);
        }
Пример #8
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);
        }
Пример #9
0
        public static bool DeleteRisk(int riskId)
        {
            bool response = RiskDAO.getInstance().DeleteRisk(riskId);

            return(response);
        }
Пример #10
0
        public static bool UpdateRisk(int riskId, string riskName, int riskType)
        {
            bool response = RiskDAO.getInstance().UpdateRisk(riskId, riskName, riskType);

            return(response);
        }
Пример #11
0
        public static bool SaveRisk(String riskName, int riskType, int projectId)
        {
            bool response = RiskDAO.getInstance().SaveRisk(riskName, riskType, projectId, Convert.ToInt32(userId));

            return(response);
        }