Ejemplo n.º 1
0
    /* IMPORT THE DATA */

    protected void ImportREDCapToDB()
    {
        string info;

        DateTime startupload = DateTime.Now;

        info = String.Format("Begin. {0}<br/>", startupload.ToString());

        string ID          = cboSubject.Value.ToString();
        int    studymeasID = Convert.ToInt32(cboStudymeas.Value.ToString());
        REDCap redcap      = new REDCap(Master.Master_studyID);

        if (redcap.IsREDCapMeasure(studymeasID))
        {
            DataTable     dt_forms  = DataImporter.LinkedREDCapForms(Master.Master_studyID, studymeasID, DbEntityType.studymeas);
            List <string> formnames = dt_forms.AsEnumerable().Select(f => f.Field <string>("form_name")).ToList();


            DataImporter importer = new DataImporter(ID, studymeasID, formnames);
            info += importer.ResultsToString();
        }

        double timeelapsed = Math.Round((DateTime.Now - startupload).TotalSeconds, 2);

        info += String.Format("<br/> End. {0} total seconds.", timeelapsed);

        DisplayImporterResults(info);
    }
Ejemplo n.º 2
0
    protected void btnShowREDCap_OnClick(object sender, EventArgs e)
    {
        string ID          = cboSubject.Value.ToString();
        int    studymeasID = Convert.ToInt32(cboStudymeas.Value.ToString());
        REDCap redcap      = new REDCap(Master.Master_studyID);

        if (redcap.IsREDCapMeasure(studymeasID))
        {
            DataTable     dt_forms  = DataImporter.LinkedREDCapForms(Master.Master_studyID, studymeasID, DbEntityType.studymeas);
            List <string> formnames = dt_forms.AsEnumerable().Select(f => f.Field <string>("form_name")).ToList();

            ASPxGridView grid = redcap.gridDataFromForm(formnames);
            if (grid != null)
            {
                placeholder_REDCap_data.Controls.Clear();
                placeholder_REDCap_data.Controls.Add(grid);
            }
        }
    }