Beispiel #1
0
        public static bool SaveTreatment(string description, int riskResponse, int riskId, string controlName, string personInCharge)
        {
            bool response = TreatmentDAO.getInstance().SaveTreatment(description, riskResponse, riskId, Convert.ToInt32(userId),
                                                                     controlName, personInCharge);

            return(response);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                user = Session["User"].ToString();
                if (user == "admin")
                {
                    ddlDoctor.Visible = true;
                    lblDoctor.Visible = true;
                    DataSet dsDoctor = new DoctorDAO().getDocs();
                    ddlDoctor.DataSource     = dsDoctor;
                    ddlDoctor.DataTextField  = "name";
                    ddlDoctor.DataValueField = "docID";
                    ddlDoctor.DataBind();
                }
                else
                {
                    ddlDoctor.Visible = false;
                    lblDoctor.Visible = false;
                }

                DataSet dsPatient = new PatientDAO().getPatients();
                ddlPatient.DataSource     = dsPatient;
                ddlPatient.DataTextField  = "Name";
                ddlPatient.DataValueField = "ID";
                ddlPatient.DataBind();

                DataSet dsTreatment = new TreatmentDAO().getAllTreatments();
                ddlTreatment.DataSource     = dsTreatment;
                ddlTreatment.DataTextField  = "Name";
                ddlTreatment.DataValueField = "Name";
                ddlTreatment.DataBind();
                ddlTreatment.Items.Insert(0, "Please select a treatment");
            }
        }
Beispiel #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         id = Convert.ToInt32(Request.QueryString["id"]);
         tbPatientID.Text = id.ToString();
         SqlDataReader DR = new TreatmentDAO().getTreatments();
         while (DR.Read())
         {
             ddlTreatment.Items.Add(DR[0].ToString());
         }
     }
 }
Beispiel #4
0
        public static Treatment GetTreatment(int riskId)
        {
            Treatment treatment = new Treatment();

            try
            {
                treatment = TreatmentDAO.getInstance().GetTreatment(riskId);
            }
            catch (Exception ex)
            {
                treatment = new Treatment();
            }
            return(treatment);
        }
    public DataSet getHist(int id)
    {
        SqlDataReader DR    = new TreatmentDAO().getTreatments();
        string        query = "";

        c.dataSet = new DataSet();
        while (DR.Read())
        {
            query     = "select dID, cost, date from " + DR[0].ToString() + " where pID=" + id;
            c.sqlComm = new SqlCommand(query, c.sqlConn);
            c.sqlAdap = new SqlDataAdapter(c.sqlComm);
            c.sqlAdap.Fill(c.dataSet);
        }
        return(c.dataSet);
    }
    public DataSet getEarn(string s)
    {
        SqlDataReader DR    = new TreatmentDAO().getTreatments();
        string        query = "";

        c.dataSet = new DataSet();
        while (DR.Read())
        {
            query     = "select * from " + DR[0].ToString() + " where date LIKE '%" + s + "'";
            c.sqlComm = new SqlCommand(query, c.sqlConn);
            c.sqlAdap = new SqlDataAdapter(c.sqlComm);
            c.sqlAdap.Fill(c.dataSet);
        }
        return(c.dataSet);
    }
        public static Treatment GetTreatment(int riskId)
        {
            Treatment treatment = new Treatment();

            try
            {
                treatment = TreatmentDAO.getInstance().GetTreatment(riskId);

                User user = UserDAO.getInstance().GetUserById(treatment.PERSON_IN_CHARGE);

                treatment.PERSON_IN_CHARGE_NAME = user.FULL_NAME;
            }
            catch (Exception ex)
            {
                treatment = new Treatment();
            }
            return(treatment);
        }
Beispiel #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);
        }
        /// <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)
        {
            TreatmentDAO dao = DAOFactory.CreateTreatmentDAO();

            return(dao.GetMultiAsDataTable(maxNumberOfItemsToReturn, sortClauses, selectFilter, relations, pageNumber, pageSize));
        }