Exemplo n.º 1
0
    protected int LoadDataStructureInfo(string shortName)
    {
        int return_value = 0;
        //Don't need to retrieve all the DSE yet.
        //DataTable dt = NDAR.NDAR_DSE_from_DB(shortName);

        //instead, just get the count of DSE
        int n_dse = NDAR.Get_Count_NDAR_DSE_from_DB(shortName);

        if (shortName != "")
        {
            string source = "UWAC DB";
            NDAR.NDAR_DataStructure ds = NDAR.GetNDARDataStructure(shortName);

            if (ds == null)
            {
                return_value++;
                lblInfo.Text = "**ERROR** '" + shortName + "' is inaccessible from the NDAR API.<br/>";
            }

            //Get the associated table
            string uwtable = sql.StringScalar_from_SQLstring("select coalesce(uwtable, 'NONE') uwtable from NDAR_DS where shortname = '" + shortName + "'");

            if (uwtable == null)
            {
                return_value++;
                lblInfo.Text += "**ERROR** No linked UW table found for '" + shortName + "'.<br/>";
            }


            v0.Text = sql.GetUserStudyName();
            v1.Text = shortName;
            v2.Text = (ds != null) ? ds.title : "";
            v3.Text = n_dse.ToString();
            v4.Text = source;


            return(return_value);
        }
        else
        {
            return(0);
        }
    }