Esempio n. 1
0
    protected void LoadNDARview(string shortName, string studymeasIDs)
    {
        int    studyID   = sql.GetUserStudyID();
        string IDexclude = txtIDexclude.Text;

        try
        {
            gvNDARview.DataSource = null;

            DataTable dt = NDAR.GetNDAR_view(shortName, studyID, IDexclude, studymeasIDs);
            if (dt.Rows.Count > 0)
            {
                Session["NDARview"] = dt;

                gridNDARview.DataSource = dt;
                gridNDARview.DataBind();
                gridNDARview.Visible = true;

                gridNDARview.Columns[0].FixedStyle = DevExpress.Web.GridViewColumnFixedStyle.Left;
                gridNDARview.Columns[1].FixedStyle = DevExpress.Web.GridViewColumnFixedStyle.Left;
                gridNDARview.Columns[2].FixedStyle = DevExpress.Web.GridViewColumnFixedStyle.Left;
                gridNDARview.Columns[3].FixedStyle = DevExpress.Web.GridViewColumnFixedStyle.Left;
                gridNDARview.Columns[4].FixedStyle = DevExpress.Web.GridViewColumnFixedStyle.Left;


                //count rows where reason_exclude is not null
                int n_reason_exclude_NotNull = dt.AsEnumerable().Where(f => f.Field <string>("reason_exclude") != "").Count();
                int n_reason_exclude_IsNull  = dt.Rows.Count - n_reason_exclude_NotNull;

                v5.Text      = dt.Rows.Count.ToString();
                v5.ForeColor = Color.Navy;
                v6.Text      = n_reason_exclude_IsNull.ToString();
                v6.ForeColor = Color.Navy;
                v7.Text      = n_reason_exclude_NotNull.ToString();
                v7.ForeColor = Color.DarkRed;
            }
            else
            {
                gvNDARview.Visible = false;

                v5.Text      = "This query returned 0 records.";
                v5.ForeColor = Color.Red;
            }
        }
        catch (Exception ex)
        {
            //To show the query
            string sqlout = NDAR.GetSQL_for_NDAR_view(shortName, studyID, IDexclude, studymeasIDs);
            lblInfo.Text = ex.Message + "<br/><br/>" + sqlout;

            //string sqlout = NDAR.GetSQL_for_NDAR_studymeas_to_include(shortName, studyID, 0);
            //lblInfo.Text =  "<br/><br/>" + sqlout;
        }
    }
Esempio n. 2
0
    protected void LoadDataStructures(string source)
    {
        string where = txtWhere.Text;
        DataTable dt  = new System.Data.DataTable();
        SQL_utils sql = new SQL_utils("data");

        if (chkInStudy.Checked)
        {
            //UWAutism uwac = new UWAutism();
            //int studyID = uwac.Master_studyID;

            int studyID = sql.GetUserStudyID();

            dt = NDAR.LoadFullDataStructureList(source, where, chkUWview.Checked, studyID);
        }
        else
        {
            dt = NDAR.LoadFullDataStructureList(source, where, chkUWview.Checked);
        }


        string code_no_ndar = String.Format("select * from uwautism_research_backend..tblMeasure where " +
                                            " measureID in (select measureID from uwautism_research_backend..tblStudyMeas where studyID={0}) and measureID not in " +
                                            " ( select measureID from def.Tbl a " +
                                            " join NDAR_DS b ON a.tblname = b.uwtable  where measureID>0) "
                                            , Master.Master_studyID);


        DataTable dt_no_ndar = sql.DataTable_from_SQLstring(code_no_ndar);

        sql.Close();

        gridNoNDAR.DataSource = dt_no_ndar;
        gridNoNDAR.DataBind();

        //gvScroll.DataSource = dt;
        //gvScroll.DataBind();
        Session["datastructures"] = dt;

        grid.DataSource = dt;
        grid.DataBind();

        lblN.Text = "No. of Data Structures: " + dt.Rows.Count.ToString();
    }
Esempio n. 3
0
    protected void OpenAllViewdataTabs(object sender, EventArgs e)
    {
        SQL_utils sql = new SQL_utils("data");

        string where = txtWhere.Text;
        int studyID = sql.GetUserStudyID();

        DataTable dt = NDAR.LoadFullDataStructureList("localDB", where, chkUWview.Checked, studyID);

        int counter = 0;

        foreach (DataRow row in dt.Rows)
        {
            string shortName = row["shortName"].ToString();

            string url = "NDARview.aspx?shortName=";

            string url2 = String.Format("window.open('{0}{1}','_blank');", url, shortName);

            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), String.Format("key{0}", counter), url2, true);
            counter++;
        }
    }